Skip to content

Commit

Permalink
Dev: remove the useless comment and add some type for the properties.
Browse files Browse the repository at this point in the history
  • Loading branch information
ping-yee committed Aug 3, 2023
1 parent 47f0f15 commit be62e2e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
30 changes: 30 additions & 0 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<?php declare(strict_types = 1);

$ignoreErrors = [];
$ignoreErrors[] = [
'message' => '#^PHPDoc type array of property Config\\\\View\\:\\:\\$filters is not covariant with PHPDoc type array\\<string, callable\\-string\\> of overridden property CodeIgniter\\\\Config\\\\View\\:\\:\\$filters\\.$#',
'count' => 1,
'path' => __DIR__ . '/app/Config/View.php',
];
$ignoreErrors[] = [
'message' => '#^PHPDoc type array of property Config\\\\View\\:\\:\\$plugins is not covariant with PHPDoc type array\\<string, callable\\-string\\> of overridden property CodeIgniter\\\\Config\\\\View\\:\\:\\$plugins\\.$#',
'count' => 1,
'path' => __DIR__ . '/app/Config/View.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$callback of function spl_autoload_register expects \\(callable\\(string\\)\\: void\\)\\|null, array\\{\\$this\\(CodeIgniter\\\\Autoloader\\\\Autoloader\\), \'loadClass\'\\} given\\.$#',
'count' => 1,
Expand Down Expand Up @@ -316,6 +326,26 @@
'count' => 1,
'path' => __DIR__ . '/system/ComposerScripts.php',
];
$ignoreErrors[] = [
'message' => '#^Property CodeIgniter\\\\Config\\\\View\\:\\:\\$coreFilters type has no signature specified for callable\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Config/View.php',
];
$ignoreErrors[] = [
'message' => '#^Property CodeIgniter\\\\Config\\\\View\\:\\:\\$corePlugins type has no signature specified for callable\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Config/View.php',
];
$ignoreErrors[] = [
'message' => '#^Property CodeIgniter\\\\Config\\\\View\\:\\:\\$filters type has no signature specified for callable\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Config/View.php',
];
$ignoreErrors[] = [
'message' => '#^Property CodeIgniter\\\\Config\\\\View\\:\\:\\$plugins type has no signature specified for callable\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Config/View.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Controller\\:\\:cachePage\\(\\) has no return type specified\\.$#',
'count' => 1,
Expand Down
2 changes: 1 addition & 1 deletion system/Config/ForeignCharacters.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class ForeignCharacters
{
/**
* Without further ado, the list of foreign characters.
* The list of foreign characters.
*
* @var array<string, string>
*/
Expand Down
12 changes: 8 additions & 4 deletions system/Config/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class View extends BaseConfig
* To prevent potential abuse, all filters MUST be defined here
* in order for them to be available for use within the Parser.
*
* @var array<string>
* @var array<string, string>
* @phpstan-var array<string, callable-string>
*/
public $filters = [];

Expand All @@ -43,14 +44,16 @@ class View extends BaseConfig
* by the core Parser by creating aliases that will be replaced with
* any callable. Can be single or tag pair.
*
* @var array<string>
* @var array<string, string>
* @phpstan-var array<string, callable-string>
*/
public $plugins = [];

/**
* Built-in View filters.
*
* @var array
* @var array<string, string>
* @phpstan-var array<string, callable-string>
*/
protected $coreFilters = [
'abs' => '\abs',
Expand Down Expand Up @@ -79,7 +82,8 @@ class View extends BaseConfig
/**
* Built-in View plugins.
*
* @var array
* @var array<string, string>
* @phpstan-var array<string, callable-string>
*/
protected $corePlugins = [
'csp_script_nonce' => '\CodeIgniter\View\Plugins::cspScriptNonce',
Expand Down

0 comments on commit be62e2e

Please sign in to comment.