From be62e2ed5f4865739ec9e93a66b57be6be15cf94 Mon Sep 17 00:00:00 2001 From: ping-yee <611077101@mail.nknu.edu.tw> Date: Fri, 4 Aug 2023 00:04:16 +0800 Subject: [PATCH] Dev: remove the useless comment and add some type for the properties. --- phpstan-baseline.php | 30 +++++++++++++++++++++++++++++ system/Config/ForeignCharacters.php | 2 +- system/Config/View.php | 12 ++++++++---- 3 files changed, 39 insertions(+), 5 deletions(-) diff --git a/phpstan-baseline.php b/phpstan-baseline.php index 58ade466d21c..cf5e2fe76b2d 100644 --- a/phpstan-baseline.php +++ b/phpstan-baseline.php @@ -1,6 +1,16 @@ '#^PHPDoc type array of property Config\\\\View\\:\\:\\$filters is not covariant with PHPDoc type array\\ 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\\ 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, @@ -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, diff --git a/system/Config/ForeignCharacters.php b/system/Config/ForeignCharacters.php index 3fac83dd29c2..a8569f5419c5 100644 --- a/system/Config/ForeignCharacters.php +++ b/system/Config/ForeignCharacters.php @@ -17,7 +17,7 @@ class ForeignCharacters { /** - * Without further ado, the list of foreign characters. + * The list of foreign characters. * * @var array */ diff --git a/system/Config/View.php b/system/Config/View.php index cf5c77dd7cea..de4ed62b936a 100644 --- a/system/Config/View.php +++ b/system/Config/View.php @@ -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 + * @var array + * @phpstan-var array */ public $filters = []; @@ -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 + * @var array + * @phpstan-var array */ public $plugins = []; /** * Built-in View filters. * - * @var array + * @var array + * @phpstan-var array */ protected $coreFilters = [ 'abs' => '\abs', @@ -79,7 +82,8 @@ class View extends BaseConfig /** * Built-in View plugins. * - * @var array + * @var array + * @phpstan-var array */ protected $corePlugins = [ 'csp_script_nonce' => '\CodeIgniter\View\Plugins::cspScriptNonce',