Dev: remove the useless comment and add some type for the properties.

This commit is contained in:
ping-yee 2023-08-04 00:04:16 +08:00
parent 47f0f157b2
commit be62e2ed5f
No known key found for this signature in database
GPG Key ID: C548278C3B604B42
3 changed files with 39 additions and 5 deletions

View File

@ -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,
@ -316,6 +326,26 @@ $ignoreErrors[] = [
'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,

View File

@ -17,7 +17,7 @@ namespace CodeIgniter\Config;
class ForeignCharacters
{
/**
* Without further ado, the list of foreign characters.
* The list of foreign characters.
*
* @var array<string, string>
*/

View File

@ -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 = [];
@ -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',
@ -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',