Merge remote-tracking branch 'upstream/develop' into 4.5

Conflicts:
	psalm-baseline.xml
	system/Router/AutoRouterImproved.php
	system/Router/Router.php
This commit is contained in:
kenjis 2024-02-26 09:42:51 +09:00
commit 99a9148b0a
No known key found for this signature in database
GPG Key ID: BD254878922AF198
63 changed files with 184 additions and 267 deletions

View File

@ -43,38 +43,7 @@ $finder = Finder::create()
__DIR__ . '/spark',
]);
$overrides = [
'phpdoc_array_type' => true,
'phpdoc_no_alias_tag' => [
'replacements' => [
'type' => 'var',
'link' => 'see',
],
],
'phpdoc_align' => [
'align' => 'vertical',
'spacing' => 1,
'tags' => [
'method',
'param',
'phpstan-assert',
'phpstan-assert-if-true',
'phpstan-assert-if-false',
'phpstan-param',
'phpstan-property',
'phpstan-return',
'phpstan-type',
'phpstan-var',
'property',
'property-read',
'property-write',
'return',
'throws',
'type',
'var',
],
],
];
$overrides = [];
$options = [
'cacheFile' => 'build/.php-cs-fixer.cache',

View File

@ -29,32 +29,7 @@ $finder = Finder::create()
__DIR__ . '/admin/starter/builds',
]);
$overrides = [
'phpdoc_array_type' => true,
'phpdoc_align' => [
'align' => 'vertical',
'spacing' => 1,
'tags' => [
'method',
'param',
'phpstan-assert',
'phpstan-assert-if-true',
'phpstan-assert-if-false',
'phpstan-param',
'phpstan-property',
'phpstan-return',
'phpstan-type',
'phpstan-var',
'property',
'property-read',
'property-write',
'return',
'throws',
'type',
'var',
],
],
];
$overrides = [];
$options = [
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',

View File

@ -39,30 +39,6 @@ $overrides = [
'import_symbols' => false,
'leading_backslash_in_global_namespace' => true,
],
'phpdoc_array_type' => true,
'phpdoc_align' => [
'align' => 'vertical',
'spacing' => 1,
'tags' => [
'method',
'param',
'phpstan-assert',
'phpstan-assert-if-true',
'phpstan-assert-if-false',
'phpstan-param',
'phpstan-property',
'phpstan-return',
'phpstan-type',
'phpstan-var',
'property',
'property-read',
'property-write',
'return',
'throws',
'type',
'var',
],
],
];
$options = [

View File

@ -61,7 +61,7 @@ class Cache extends BaseConfig
* ['q'] = Enabled, but only take into account the specified list
* of query parameters.
*
* @var array<string>|bool
* @var bool|list<string>
*/
public $cacheQueryString = false;

View File

@ -45,28 +45,28 @@ class ContentSecurityPolicy extends BaseConfig
/**
* Will default to self if not overridden
*
* @var array<string>|string|null
* @var list<string>|string|null
*/
public $defaultSrc;
/**
* Lists allowed scripts' URLs.
*
* @var array<string>|string
* @var list<string>|string
*/
public $scriptSrc = 'self';
/**
* Lists allowed stylesheets' URLs.
*
* @var array<string>|string
* @var list<string>|string
*/
public $styleSrc = 'self';
/**
* Defines the origins from which images can be loaded.
*
* @var array<string>|string
* @var list<string>|string
*/
public $imageSrc = 'self';
@ -75,14 +75,14 @@ class ContentSecurityPolicy extends BaseConfig
*
* Will default to self if not overridden
*
* @var array<string>|string|null
* @var list<string>|string|null
*/
public $baseURI;
/**
* Lists the URLs for workers and embedded frame contents
*
* @var array<string>|string
* @var list<string>|string
*/
public $childSrc = 'self';
@ -90,21 +90,21 @@ class ContentSecurityPolicy extends BaseConfig
* Limits the origins that you can connect to (via XHR,
* WebSockets, and EventSource).
*
* @var array<string>|string
* @var list<string>|string
*/
public $connectSrc = 'self';
/**
* Specifies the origins that can serve web fonts.
*
* @var array<string>|string
* @var list<string>|string
*/
public $fontSrc;
/**
* Lists valid endpoints for submission from `<form>` tags.
*
* @var array<string>|string
* @var list<string>|string
*/
public $formAction = 'self';
@ -114,7 +114,7 @@ class ContentSecurityPolicy extends BaseConfig
* and `<applet>` tags. This directive can't be used in
* `<meta>` tags and applies only to non-HTML resources.
*
* @var array<string>|string|null
* @var list<string>|string|null
*/
public $frameAncestors;
@ -129,33 +129,33 @@ class ContentSecurityPolicy extends BaseConfig
/**
* Restricts the origins allowed to deliver video and audio.
*
* @var array<string>|string|null
* @var list<string>|string|null
*/
public $mediaSrc;
/**
* Allows control over Flash and other plugins.
*
* @var array<string>|string
* @var list<string>|string
*/
public $objectSrc = 'self';
/**
* @var array<string>|string|null
* @var list<string>|string|null
*/
public $manifestSrc;
/**
* Limits the kinds of plugins a page may invoke.
*
* @var array<string>|string|null
* @var list<string>|string|null
*/
public $pluginTypes;
/**
* List of actions allowed.
*
* @var array<string>|string|null
* @var list<string>|string|null
*/
public $sandbox;

View File

@ -22,7 +22,7 @@ class Format extends BaseConfig
* These formats are only checked when the data passed to the respond()
* method is an array.
*
* @var array<string>
* @var list<string>
*/
public array $supportedResponseFormats = [
'application/json',

View File

@ -31,7 +31,7 @@ class Toolbar extends BaseConfig
* List of toolbar collectors that will be called when Debug Toolbar
* fires up and collects data from.
*
* @var array<string>
* @var list<string>
*/
public array $collectors = [
Timers::class,

View File

@ -18,7 +18,7 @@ class Validation extends BaseConfig
* Stores the classes that contain the
* rules that are available.
*
* @var array<string>
* @var list<string>
*/
public array $ruleSets = [
Rules::class,

View File

@ -6,8 +6,8 @@ use CodeIgniter\Config\View as BaseView;
use CodeIgniter\View\ViewDecoratorInterface;
/**
* @phpstan-type ParserCallable (callable(mixed): mixed)
* @phpstan-type ParserCallableString (callable(mixed): mixed)&string
* @phpstan-type parser_callable (callable(mixed): mixed)
* @phpstan-type parser_callable_string (callable(mixed): mixed)&string
*/
class View extends BaseView
{
@ -35,7 +35,7 @@ class View extends BaseView
* { created_on|date(Y-m-d)|esc(attr) }
*
* @var array<string, string>
* @phpstan-var array<string, ParserCallableString>
* @phpstan-var array<string, parser_callable_string>
*/
public $filters = [];
@ -44,8 +44,8 @@ class View extends BaseView
* by the core Parser by creating aliases that will be replaced with
* any callable. Can be single or tag pair.
*
* @var array<string, array<string>|callable|string>
* @phpstan-var array<string, array<ParserCallableString>|ParserCallableString|ParserCallable>
* @var array<string, callable|list<string>|string>
* @phpstan-var array<string, list<parser_callable_string>|parser_callable_string|parser_callable>
*/
public $plugins = [];
@ -56,7 +56,7 @@ class View extends BaseView
*
* All classes must implement CodeIgniter\View\ViewDecoratorInterface
*
* @var array<class-string<ViewDecoratorInterface>>
* @var list<class-string<ViewDecoratorInterface>>
*/
public array $decorators = [];
}

View File

@ -531,16 +531,6 @@ $ignoreErrors[] = [
'count' => 2,
'path' => __DIR__ . '/system/Database/BaseResult.php',
];
$ignoreErrors[] = [
'message' => '#^Only booleans are allowed in an if condition, array\\<array\\> given\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Database/BaseResult.php',
];
$ignoreErrors[] = [
'message' => '#^Only booleans are allowed in an if condition, array\\<object\\> given\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Database/BaseResult.php',
];
$ignoreErrors[] = [
'message' => '#^Parameter \\#1 \\$className \\(class\\-string\\) of method CodeIgniter\\\\Database\\\\BaseResult\\:\\:getCustomResultObject\\(\\) should be contravariant with parameter \\$className \\(string\\) of method CodeIgniter\\\\Database\\\\ResultInterface\\<TConnection,TResult\\>\\:\\:getCustomResultObject\\(\\)$#',
'count' => 1,
@ -621,6 +611,11 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/system/Database/Forge.php',
];
$ignoreErrors[] = [
'message' => '#^Property CodeIgniter\\\\Database\\\\Forge\\:\\:\\$fields \\(array\\<string, array\\|string\\>\\) does not accept array\\<int\\|string, int\\>\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Database/Forge.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Database\\\\Migration\\:\\:down\\(\\) has no return type specified\\.$#',
'count' => 1,
@ -776,16 +771,6 @@ $ignoreErrors[] = [
'count' => 5,
'path' => __DIR__ . '/system/Database/OCI8/Connection.php',
];
$ignoreErrors[] = [
'message' => '#^Only booleans are allowed in a negated boolean, array given\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Database/OCI8/Connection.php',
];
$ignoreErrors[] = [
'message' => '#^Only booleans are allowed in a negated boolean, array\\<stdClass\\> given\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Database/OCI8/Connection.php',
];
$ignoreErrors[] = [
'message' => '#^PHPDoc type string of property CodeIgniter\\\\Database\\\\OCI8\\\\Connection\\:\\:\\$escapeChar is not the same as PHPDoc type array\\|string of overridden property CodeIgniter\\\\Database\\\\BaseConnection\\<resource,resource\\>\\:\\:\\$escapeChar\\.$#',
'count' => 1,
@ -2456,6 +2441,11 @@ $ignoreErrors[] = [
'count' => 1,
'path' => __DIR__ . '/system/Test/Mock/MockCURLRequest.php',
];
$ignoreErrors[] = [
'message' => '#^Cannot unset offset string on array\\<int, int\\>\\|null\\.$#',
'count' => 2,
'path' => __DIR__ . '/system/Test/Mock/MockCache.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Test\\\\Mock\\\\MockCache\\:\\:assertHas\\(\\) has no return type specified\\.$#',
'count' => 1,

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.20.0@3f284e96c9d9be6fe6b15c79416e1d1903dcfef4">
<files psalm-version="5.21.1@8c473e2437be8b6a8fd8f630f0f11a16b114c494">
<file src="app/Config/View.php">
<UndefinedDocblockClass>
<code><![CDATA[array<string, ParserCallableString>]]></code>
<code><![CDATA[array<string, array<ParserCallableString>|ParserCallableString|ParserCallable>]]></code>
<code><![CDATA[array<string, array<ParserCallableString>|ParserCallableString|ParserCallable>]]></code>
<code><![CDATA[array<string, list<parser_callable_string>|parser_callable_string|parser_callable>]]></code>
<code><![CDATA[array<string, list<parser_callable_string>|parser_callable_string|parser_callable>]]></code>
<code><![CDATA[array<string, parser_callable_string>]]></code>
<code>public $filters = [];</code>
<code>public $plugins = [];</code>
<code>public $plugins = [];</code>
@ -28,8 +28,8 @@
</file>
<file src="system/Config/View.php">
<UndefinedDocblockClass>
<code><![CDATA[array<string, array<parser_callable_string>|parser_callable_string|parser_callable>]]></code>
<code><![CDATA[array<string, array<parser_callable_string>|parser_callable_string|parser_callable>]]></code>
<code><![CDATA[array<string, list<parser_callable_string>|parser_callable_string|parser_callable>]]></code>
<code><![CDATA[array<string, list<parser_callable_string>|parser_callable_string|parser_callable>]]></code>
<code><![CDATA[array<string, parser_callable_string>]]></code>
<code><![CDATA[protected $coreFilters = [
'abs' => '\abs',
@ -119,8 +119,8 @@
</file>
<file src="system/View/Parser.php">
<UndefinedDocblockClass>
<code><![CDATA[array<string, array<parser_callable_string>|parser_callable_string|parser_callable>]]></code>
<code><![CDATA[array<string, array<parser_callable_string>|parser_callable_string|parser_callable>]]></code>
<code><![CDATA[array<string, list<parser_callable_string>|parser_callable_string|parser_callable>]]></code>
<code><![CDATA[array<string, list<parser_callable_string>|parser_callable_string|parser_callable>]]></code>
<code>protected $plugins = [];</code>
<code>protected $plugins = [];</code>
</UndefinedDocblockClass>
@ -156,6 +156,13 @@
<code><![CDATA['Config\TestRegistrar']]></code>
</UndefinedClass>
</file>
<file src="tests/system/Database/Live/OCI8/CallStoredProcedureTest.php">
<UndefinedConstant>
<code>OCI_ASSOC</code>
<code>OCI_B_CURSOR</code>
<code>OCI_RETURN_NULLS</code>
</UndefinedConstant>
</file>
<file src="tests/system/Entity/EntityTest.php">
<EmptyArrayAccess>
<code>$current[$key]</code>

View File

@ -240,7 +240,7 @@ trait ResponseTrait
/**
* Used when the data provided by the client cannot be validated on one or more fields.
*
* @param array<string>|string $errors
* @param list<string>|string $errors
*
* @return ResponseInterface
*/

View File

@ -306,7 +306,7 @@ class FileLocator implements FileLocatorInterface
* Scans the defined namespaces, returning a list of all files
* that are contained within the subpath specified by $path.
*
* @return array<string> List of file paths
* @return list<string> List of file paths
*/
public function listFiles(string $path): array
{
@ -339,7 +339,7 @@ class FileLocator implements FileLocatorInterface
* Scans the provided namespace, returning a list of all files
* that are contained within the sub path specified by $path.
*
* @return array<string> List of file paths
* @return list<string> List of file paths
*/
public function listNamespaceFiles(string $prefix, string $path): array
{

View File

@ -68,7 +68,7 @@ interface FileLocatorInterface
* Scans the defined namespaces, returning a list of all files
* that are contained within the subpath specified by $path.
*
* @return array<string> List of file paths
* @return list<string> List of file paths
*/
public function listFiles(string $path): array;
@ -76,7 +76,7 @@ interface FileLocatorInterface
* Scans the provided namespace, returning a list of all files
* that are contained within the sub path specified by $path.
*
* @return array<string> List of file paths
* @return list<string> List of file paths
*/
public function listNamespaceFiles(string $prefix, string $path): array;
}

View File

@ -485,7 +485,7 @@ abstract class BaseModel
* @param int $batchSize The size of the batch to run
* @param bool $returnSQL True means SQL is returned, false will execute the query
*
* @return array<string>|false|int Number of rows affected or FALSE on failure, SQL array when testMode
* @return false|int|list<string> Number of rows affected or FALSE on failure, SQL array when testMode
*
* @throws DatabaseException
*/
@ -1039,7 +1039,7 @@ abstract class BaseModel
* @param int $batchSize The size of the batch to run
* @param bool $returnSQL True means SQL is returned, false will execute the query
*
* @return array<string>|false|int Number of rows affected or FALSE on failure, SQL array when testMode
* @return false|int|list<string> Number of rows affected or FALSE on failure, SQL array when testMode
*
* @throws DatabaseException
* @throws ReflectionException

View File

@ -38,7 +38,7 @@ final class ResponseCache
* array('q') = Enabled, but only take into account the specified list
* of query parameters.
*
* @var array<string>|bool
* @var bool|list<string>
*/
private $cacheQueryString = false;

View File

@ -808,7 +808,7 @@ class CodeIgniter
* @param RouteCollectionInterface|null $routes A collection interface to use in place
* of the config file.
*
* @return array<string>|string|null Route filters, that is, the filters specified in the routes file
* @return list<string>|string|null Route filters, that is, the filters specified in the routes file
*
* @throws RedirectException
*/

View File

@ -65,7 +65,7 @@ class MigrateStatus extends BaseCommand
/**
* Namespaces to ignore when looking for migrations.
*
* @var array<string>
* @var list<string>
*/
protected $ignoredNamespaces = [
'CodeIgniter',

View File

@ -359,7 +359,7 @@ class LocalizationFinder extends BaseCommand
}
/**
* @param array<SplFileInfo> $files
* @param list<SplFileInfo> $files
*
* @return array<string, array|int>
* @phpstan-return array{'foundLanguageKeys': array<string, array<string, string>>, 'badLanguageKeys': array<int, array<int, string>>, 'countFiles': int}

View File

@ -35,7 +35,7 @@ final class AutoRouteCollector
/**
* List of controllers in Defined Routes that should not be accessed via Auto-Routing.
*
* @var array<class-string>
* @var list<class-string>
*/
private array $protectedControllers;

View File

@ -40,7 +40,7 @@ final class ControllerFinder
}
/**
* @return array<class-string>
* @return list<class-string>
*/
public function find(): array
{

View File

@ -238,8 +238,8 @@ if (! function_exists('cookies')) {
/**
* Fetches the global `CookieStore` instance held by `Response`.
*
* @param array<Cookie> $cookies If `getGlobal` is false, this is passed to CookieStore's constructor
* @param bool $getGlobal If false, creates a new instance of CookieStore
* @param list<Cookie> $cookies If `getGlobal` is false, this is passed to CookieStore's constructor
* @param bool $getGlobal If false, creates a new instance of CookieStore
*/
function cookies(array $cookies = [], bool $getGlobal = true): CookieStore
{

View File

@ -173,7 +173,7 @@ class BaseService
/**
* A cache of the names of services classes found.
*
* @var array<string>
* @var list<string>
*/
private static array $serviceNames = [];

View File

@ -53,8 +53,8 @@ class View extends BaseConfig
*
* @psalm-suppress UndefinedDocblockClass
*
* @var array<string, array<string>|callable|string>
* @phpstan-var array<string, array<parser_callable_string>|parser_callable_string|parser_callable>
* @var array<string, callable|list<string>|string>
* @phpstan-var array<string, list<parser_callable_string>|parser_callable_string|parser_callable>
*/
public $plugins = [];
@ -91,7 +91,7 @@ class View extends BaseConfig
/**
* Built-in View plugins.
*
* @var array<string, array<string>|callable|string>
* @var array<string, callable|list<string>|string>
* @phpstan-var array<string, array<parser_callable_string>|parser_callable_string|parser_callable>
*/
protected $corePlugins = [
@ -114,7 +114,7 @@ class View extends BaseConfig
*
* All classes must implement CodeIgniter\View\ViewDecoratorInterface
*
* @var array<class-string<ViewDecoratorInterface>>
* @var list<class-string<ViewDecoratorInterface>>
*/
public array $decorators = [];

View File

@ -37,7 +37,7 @@ class CookieStore implements Countable, IteratorAggregate
/**
* Creates a CookieStore from an array of `Set-Cookie` headers.
*
* @param array<string> $headers
* @param list<string> $headers
*
* @return static
*
@ -46,7 +46,7 @@ class CookieStore implements Countable, IteratorAggregate
public static function fromCookieHeaders(array $headers, bool $raw = false)
{
/**
* @var array<Cookie> $cookies
* @var list<Cookie> $cookies
*/
$cookies = array_filter(array_map(static function (string $header) use ($raw) {
try {
@ -62,7 +62,7 @@ class CookieStore implements Countable, IteratorAggregate
}
/**
* @param array<Cookie> $cookies
* @param array<array-key, Cookie> $cookies
*
* @throws CookieException
*/

View File

@ -106,7 +106,7 @@ class CookieException extends FrameworkException
/**
* Thrown when the `CookieStore` class is filled with invalid Cookie objects.
*
* @param array<int|string> $data
* @param list<int|string> $data
*
* @return static
*/
@ -118,7 +118,7 @@ class CookieException extends FrameworkException
/**
* Thrown when the queried Cookie object does not exist in the cookie collection.
*
* @param array<string> $data
* @param list<string> $data
*
* @return static
*/

View File

@ -119,7 +119,7 @@ class BaseBuilder
/**
* QB UNION data
*
* @var array<string>
* @var list<string>
*/
protected array $QBUnion = [];
@ -284,14 +284,14 @@ class BaseBuilder
/**
* Strings that determine if a string represents a literal value or a field name
*
* @var array<string>
* @var list<string>
*/
protected $isLiteralStr = [];
/**
* RegExp used to get operators
*
* @var array<string>
* @var list<string>
*/
protected $pregOperators = [];
@ -1778,7 +1778,7 @@ class BaseBuilder
*
* @param '_deleteBatch'|'_insertBatch'|'_updateBatch'|'_upsertBatch' $renderMethod
*
* @return array<string>|false|int Number of rows inserted or FALSE on failure, SQL array when testMode
* @return false|int|list<string> Number of rows inserted or FALSE on failure, SQL array when testMode
*
* @throws DatabaseException
*/
@ -1915,7 +1915,7 @@ class BaseBuilder
*
* @param array|object|null $set
*
* @return array<string>|false|int Number of affected rows or FALSE on failure, SQL array when testMode
* @return false|int|list<string> Number of affected rows or FALSE on failure, SQL array when testMode
*
* @throws DatabaseException
*/
@ -1951,7 +1951,7 @@ class BaseBuilder
*
* @param array|object|null $set a dataset
*
* @return array<string>|false|int Number of affected rows or FALSE on failure, SQL array when testMode
* @return false|int|list<string> Number of affected rows or FALSE on failure, SQL array when testMode
*
* @throws DatabaseException
*/
@ -2036,9 +2036,9 @@ class BaseBuilder
/**
* Sets update fields for upsert, update
*
* @param array<RawSql>|array<string>|string $set
* @param bool $addToDefault adds update fields to the default ones
* @param array|null $ignore ignores items in set
* @param list<RawSql>|list<string>|string $set
* @param bool $addToDefault adds update fields to the default ones
* @param array|null $ignore ignores items in set
*
* @return $this
*/
@ -2180,7 +2180,7 @@ class BaseBuilder
*
* @param array|object|null $set a dataset
*
* @return array<string>|false|int Number of rows inserted or FALSE on failure, SQL array when testMode
* @return false|int|list<string> Number of rows inserted or FALSE on failure, SQL array when testMode
*/
public function insertBatch($set = null, ?bool $escape = null, int $batchSize = 100)
{
@ -2557,7 +2557,7 @@ class BaseBuilder
* @param array|object|null $set a dataset
* @param array|RawSql|string|null $constraints
*
* @return array<string>|false|int Number of rows affected or FALSE on failure, SQL array when testMode
* @return false|int|list<string> Number of rows affected or FALSE on failure, SQL array when testMode
*/
public function updateBatch($set = null, $constraints = null, int $batchSize = 100)
{
@ -2823,7 +2823,7 @@ class BaseBuilder
* @param array|object|null $set a dataset
* @param array|RawSql|null $constraints
*
* @return array<string>|false|int Number of rows affected or FALSE on failure, SQL array when testMode
* @return false|int|list<string> Number of rows affected or FALSE on failure, SQL array when testMode
*/
public function deleteBatch($set = null, $constraints = null, int $batchSize = 100)
{

View File

@ -1308,10 +1308,10 @@ abstract class BaseConnection implements ConnectionInterface
/**
* Escape String
*
* @param array<string>|string $str Input string
* @param bool $like Whether or not the string will be used in a LIKE condition
* @param list<string>|string $str Input string
* @param bool $like Whether or not the string will be used in a LIKE condition
*
* @return array<string>|string
* @return list<string>|string
*/
public function escapeString($str, bool $like = false)
{
@ -1351,9 +1351,9 @@ abstract class BaseConnection implements ConnectionInterface
* Calls the individual driver for platform
* specific escaping for LIKE conditions
*
* @param array<string>|string $str
* @param list<string>|string $str
*
* @return array<string>|string
* @return list<string>|string
*/
public function escapeLikeString($str)
{
@ -1546,7 +1546,7 @@ abstract class BaseConnection implements ConnectionInterface
/**
* Returns an object with field data
*
* @return array<stdClass>
* @return list<stdClass>
*/
public function getFieldData(string $table)
{

View File

@ -43,14 +43,14 @@ abstract class BaseResult implements ResultInterface
/**
* Result Array
*
* @var array<array>
* @var list<array>
*/
public $resultArray = [];
/**
* Result Object
*
* @var array<object>
* @var list<object>
*/
public $resultObject = [];
@ -187,7 +187,7 @@ abstract class BaseResult implements ResultInterface
return [];
}
if ($this->resultObject) {
if ($this->resultObject !== []) {
foreach ($this->resultObject as $row) {
$this->resultArray[] = (array) $row;
}
@ -227,7 +227,7 @@ abstract class BaseResult implements ResultInterface
return [];
}
if ($this->resultArray) {
if ($this->resultArray !== []) {
foreach ($this->resultArray as $row) {
$this->resultObject[] = (object) $row;
}

View File

@ -41,7 +41,7 @@ class Forge
/**
* List of keys.
*
* @var list<array{fields?: array<string>, keyName?: string}>
* @var list<array{fields?: list<string>, keyName?: string}>
*/
protected $keys = [];
@ -55,7 +55,7 @@ class Forge
/**
* Primary keys.
*
* @var array{fields?: array<string>, keyName?: string}
* @var array{fields?: list<string>, keyName?: string}
*/
protected $primaryKeys = [];
@ -401,8 +401,8 @@ class Forge
/**
* Add Foreign Key
*
* @param array<string>|string $fieldName
* @param array<string>|string $tableField
* @param list<string>|string $fieldName
* @param list<string>|string $tableField
*
* @throws DatabaseException
*/

View File

@ -357,9 +357,9 @@ class Connection extends BaseConnection
* additional "ESCAPE x" parameter for specifying the escape character
* in "LIKE" strings, and this handles those directly with a backslash.
*
* @param array<string>|string $str Input string
* @param list<string>|string $str Input string
*
* @return array<string>|string
* @return list<string>|string
*/
public function escapeLikeStringDirect($str)
{
@ -413,7 +413,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with field data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/
@ -445,7 +445,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with index data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
* @throws LogicException
@ -491,7 +491,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with Foreign key data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/

View File

@ -283,7 +283,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with field data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/
@ -327,7 +327,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with index data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/
@ -376,7 +376,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with Foreign key data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/
@ -580,7 +580,7 @@ class Connection extends BaseConnection
$indexs = $this->getIndexData($this->lastInsertedTableName);
$fieldDatas = $this->getFieldData($this->lastInsertedTableName);
if (! $indexs || ! $fieldDatas) {
if ($indexs === [] || $fieldDatas === []) {
return 0;
}

View File

@ -296,7 +296,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with field data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/
@ -331,7 +331,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with index data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/
@ -370,7 +370,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with Foreign key data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/

View File

@ -79,7 +79,7 @@ class Connection extends BaseConnection
*
* Identifiers that must NOT be escaped.
*
* @var array<string>
* @var list<string>
*/
protected $_reserved_identifiers = ['*'];
@ -233,7 +233,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with index data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/
@ -271,7 +271,7 @@ class Connection extends BaseConnection
* Returns an array of objects with Foreign key data
* referenced_object_id parent_object_id
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/
@ -337,7 +337,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with field data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/

View File

@ -253,7 +253,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with field data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/
@ -291,7 +291,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with index data
*
* @return array<stdClass>
* @return list<stdClass>
*
* @throws DatabaseException
*/
@ -348,7 +348,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with Foreign key data
*
* @return array<stdClass>
* @return list<stdClass>
*/
protected function _foreignKeyData(string $table): array
{

View File

@ -46,7 +46,7 @@ class Toolbar
/**
* Collectors to be used and displayed.
*
* @var array<BaseCollector>
* @var list<BaseCollector>
*/
protected $collectors = [];

View File

@ -298,7 +298,7 @@ class Email
/**
* Raw debug messages
*
* @var array<string>
* @var list<string>
*/
private array $debugMessageRaw = [];

View File

@ -54,14 +54,14 @@ class Events
* Stores information about the events
* for display in the debug toolbar.
*
* @var array<array<string, float|string>>
* @var list<array<string, float|string>>
*/
protected static $performanceLog = [];
/**
* A list of found files.
*
* @var array<string>
* @var list<string>
*/
protected static $files = [];
@ -255,7 +255,7 @@ class Events
/**
* Returns the files that were found/loaded during this request.
*
* @return array<string>
* @return list<string>
*/
public static function getFiles()
{
@ -277,7 +277,7 @@ class Events
/**
* Getter for the performance log records.
*
* @return array<array<string, float|string>>
* @return list<array<string, float|string>>
*/
public static function getPerformanceLogs()
{

View File

@ -34,7 +34,7 @@ class FileCollection implements Countable, IteratorAggregate
/**
* The current list of file paths.
*
* @var array<string>
* @var list<string>
*/
protected $files = [];
@ -77,9 +77,9 @@ class FileCollection implements Countable, IteratorAggregate
/**
* Removes files that are not part of the given directory (recursive).
*
* @param array<string> $files
* @param list<string> $files
*
* @return array<string>
* @return list<string>
*/
final protected static function filterFiles(array $files, string $directory): array
{
@ -91,10 +91,10 @@ class FileCollection implements Countable, IteratorAggregate
/**
* Returns any files whose `basename` matches the given pattern.
*
* @param array<string> $files
* @param string $pattern Regex or pseudo-regex string
* @param list<string> $files
* @param string $pattern Regex or pseudo-regex string
*
* @return array<string>
* @return list<string>
*/
final protected static function matchFiles(array $files, string $pattern): array
{
@ -118,7 +118,7 @@ class FileCollection implements Countable, IteratorAggregate
/**
* Loads the Filesystem helper and adds any initial files.
*
* @param array<string> $files
* @param list<string> $files
*/
public function __construct(array $files = [])
{
@ -138,7 +138,7 @@ class FileCollection implements Countable, IteratorAggregate
/**
* Optimizes and returns the current file list.
*
* @return array<string>
* @return list<string>
*/
public function get(): array
{
@ -152,7 +152,7 @@ class FileCollection implements Countable, IteratorAggregate
* Sets the file list directly, files are still subject to verification.
* This works as a "reset" method with [].
*
* @param array<string> $files The new file list to use
* @param list<string> $files The new file list to use
*
* @return $this
*/
@ -166,7 +166,7 @@ class FileCollection implements Countable, IteratorAggregate
/**
* Adds an array/single file or directory to the list.
*
* @param array<string>|string $paths
* @param list<string>|string $paths
*
* @return $this
*/
@ -201,7 +201,7 @@ class FileCollection implements Countable, IteratorAggregate
/**
* Verifies and adds files to the list.
*
* @param array<string> $files
* @param list<string> $files
*
* @return $this
*/
@ -229,7 +229,7 @@ class FileCollection implements Countable, IteratorAggregate
/**
* Removes files from the list.
*
* @param array<string> $files
* @param list<string> $files
*
* @return $this
*/
@ -258,7 +258,7 @@ class FileCollection implements Countable, IteratorAggregate
* Verifies and adds files from each
* directory to the list.
*
* @param array<string> $directories
* @param list<string> $directories
*
* @return $this
*/

View File

@ -165,7 +165,7 @@ class FileCollection
* Given a file array, will create UploadedFile instances. Will
* loop over an array and create objects for each.
*
* @return array<UploadedFile>|UploadedFile
* @return list<UploadedFile>|UploadedFile
*/
protected function createFileObject(array $array)
{

View File

@ -352,7 +352,7 @@ interface ResponseInterface extends MessageInterface
/**
* Returns the cookie
*
* @return array<Cookie>|Cookie|null
* @return array<string, Cookie>|Cookie|null
*/
public function getCookie(?string $name = null, string $prefix = '');
@ -366,7 +366,7 @@ interface ResponseInterface extends MessageInterface
/**
* Returns all cookies currently set.
*
* @return array<Cookie>
* @return array<string, Cookie>
*/
public function getCookies();

View File

@ -583,7 +583,7 @@ trait ResponseTrait
* @param string $prefix Cookie prefix.
* '': the default prefix
*
* @return array<Cookie>|Cookie|null
* @return array<string, Cookie>|Cookie|null
*/
public function getCookie(?string $name = null, string $prefix = '')
{
@ -648,7 +648,7 @@ trait ResponseTrait
/**
* Returns all cookies currently set.
*
* @return array<Cookie>
* @return array<string, Cookie>
*/
public function getCookies()
{

View File

@ -546,11 +546,11 @@ if (! function_exists('set_value')) {
* Grabs a value from the POST array for the specified field so you can
* re-populate an input field or textarea
*
* @param string $field Field name
* @param array<string>|string $default Default value
* @param bool $htmlEscape Whether to escape HTML special characters or not
* @param string $field Field name
* @param list<string>|string $default Default value
* @param bool $htmlEscape Whether to escape HTML special characters or not
*
* @return array<string>|string
* @return list<string>|string
*/
function set_value(string $field, $default = '', bool $htmlEscape = true)
{

View File

@ -175,8 +175,8 @@ class Language
/**
* Advanced message formatting.
*
* @param array|string $message
* @param array<string> $args
* @param array|string $message
* @param list<string> $args
*
* @return array|string
*/

View File

@ -45,7 +45,7 @@ class ErrorlogHandler extends BaseHandler
/**
* Constructor.
*
* @param array<mixed> $config
* @param list<mixed> $config
*/
public function __construct(array $config = [])
{

View File

@ -137,7 +137,7 @@ class Model extends BaseModel
/**
* Builder method names that should not be used in the Model.
*
* @var array<string> method name
* @var list<string> method name
*/
private array $builderMethodsNotAvailable = [
'getCompiledInsert',
@ -456,7 +456,7 @@ class Model extends BaseModel
* @param int $batchSize The size of the batch to run
* @param bool $returnSQL True means SQL is returned, false will execute the query
*
* @return array<string>|false|int Number of rows affected or FALSE on failure, SQL array when testMode
* @return false|int|list<string> Number of rows affected or FALSE on failure, SQL array when testMode
*
* @throws DatabaseException
*/

View File

@ -42,7 +42,7 @@ class Publisher extends FileCollection
/**
* Array of discovered Publishers.
*
* @var array<string, array<self>|null>
* @var array<string, list<self>|null>
*/
private static array $discovered = [];
@ -62,7 +62,7 @@ class Publisher extends FileCollection
/**
* List of file published curing the last write operation.
*
* @var array<string>
* @var list<string>
*/
private array $published = [];
@ -97,7 +97,7 @@ class Publisher extends FileCollection
/**
* Discovers and returns all Publishers in the specified namespace directory.
*
* @return array<self>
* @return list<self>
*/
final public static function discover(string $directory = 'Publishers'): array
{
@ -254,7 +254,7 @@ class Publisher extends FileCollection
/**
* Returns the files published by the last write operation.
*
* @return array<string>
* @return list<string>
*/
final public function getPublished(): array
{
@ -268,7 +268,7 @@ class Publisher extends FileCollection
/**
* Verifies and adds paths to the list.
*
* @param array<string> $paths
* @param list<string> $paths
*
* @return $this
*/
@ -296,7 +296,7 @@ class Publisher extends FileCollection
/**
* Downloads and stages files from an array of URIs.
*
* @param array<string> $uris
* @param list<string> $uris
*
* @return $this
*/

View File

@ -29,7 +29,7 @@ final class AutoRouterImproved implements AutoRouterInterface
/**
* List of controllers in Defined Routes that should not be accessed via this Auto-Routing.
*
* @var array<class-string>
* @var list<class-string>
*/
private array $protectedControllers;
@ -126,8 +126,8 @@ final class AutoRouterImproved implements AutoRouterInterface
private ?string $uri = null;
/**
* @param array<class-string> $protectedControllers
* @param string $defaultController Short classname
* @param list<class-string> $protectedControllers
* @param string $defaultController Short classname
*/
public function __construct(
array $protectedControllers,

View File

@ -1613,7 +1613,7 @@ class RouteCollection implements RouteCollectionInterface
* Compares the subdomain(s) passed in against the current subdomain
* on this page request.
*
* @param array<string>|string $subdomains
* @param list<string>|string $subdomains
*/
private function checkSubdomains($subdomains): bool
{

View File

@ -124,7 +124,7 @@ class Router implements RouterInterface
* The filter info from Route Collection
* if the matched route should be filtered.
*
* @var array<string>
* @var list<string>
*/
protected $filtersInfo = [];
@ -217,7 +217,7 @@ class Router implements RouterInterface
/**
* Returns the filter info for the matched route, if any.
*
* @return array<string>
* @return list<string>
*/
public function getFilters(): array
{

View File

@ -210,7 +210,7 @@ trait FilterTestTrait
* @param string $route The route to test
* @param string $position "before" or "after"
*
* @return array<string> The filter aliases
* @return list<string> The filter aliases
*/
protected function getFiltersForRoute(string $route, string $position): array
{

View File

@ -31,7 +31,7 @@ class MockCache extends BaseHandler implements CacheInterface
/**
* Expiration times.
*
* @var ?array<int>
* @var ?list<int>
*/
protected $expirations = [];
@ -205,7 +205,7 @@ class MockCache extends BaseHandler implements CacheInterface
* The information returned and the structure of the data
* varies depending on the handler.
*
* @return array<string> Keys currently present in the store
* @return list<string> Keys currently present in the store
*/
public function getCacheInfo()
{

View File

@ -28,7 +28,7 @@ class MockSession extends Session
/**
* Holds our "cookie" data.
*
* @var array<Cookie>
* @var list<Cookie>
*/
public $cookies = [];

View File

@ -483,7 +483,7 @@ class TestResponse
/**
* Forward any unrecognized method calls to our DOMParser instance.
*
* @param array<mixed> $params
* @param list<mixed> $params
*/
public function __call(string $function, array $params): mixed
{

View File

@ -235,7 +235,7 @@ class Validation implements ValidationInterface
*
* @param array|bool|float|int|object|string|null $value The data to validate.
* @param array|string $rules The validation rules.
* @param array<string> $errors The custom error message.
* @param list<string> $errors The custom error message.
* @param string|null $dbGroup The database group to use.
*/
public function check($value, $rules, array $errors = [], $dbGroup = null): bool
@ -635,7 +635,7 @@ class Validation implements ValidationInterface
*
* @param string $group Group.
*
* @return array<string> Rule group.
* @return list<string> Rule group.
*
* @throws ValidationException If group not found.
*/

View File

@ -37,7 +37,7 @@ interface ValidationInterface
*
* @param array|bool|float|int|object|string|null $value Value to validate.
* @param array|string $rules
* @param array<string> $errors
* @param list<string> $errors
* @param string|null $dbGroup The database group to use.
*
* @return bool True if valid, else false.
@ -87,7 +87,7 @@ interface ValidationInterface
*
* @param string $group Group.
*
* @return array<string> Rule group.
* @return list<string> Rule group.
*/
public function getRuleGroup(string $group): array;

View File

@ -63,7 +63,7 @@ class Parser extends View
/**
* Stores any plugins registered at run-time.
*
* @var array<string, array<string>|callable|string>
* @var array<string, callable|list<string>|string>
* @phpstan-var array<string, array<parser_callable_string>|parser_callable_string|parser_callable>
*/
protected $plugins = [];

View File

@ -139,7 +139,7 @@ class View implements RendererInterface
* The name of the current section being rendered,
* if any.
*
* @var array<string>
* @var list<string>
*/
protected $sectionStack = [];

View File

@ -25,7 +25,7 @@ use org\bovigo\vfs\visitor\vfsStreamStructureVisitor;
final class FilesystemHelperTest extends CIUnitTestCase
{
/**
* @var array<string, array<mixed>>|array<string, array<string, array<mixed>>>|array<string, array<string, string>>|array<string, mixed>|array<string, string>|mixed
* @var array<string, array<string, list<mixed>>>|array<string, array<string, string>>|array<string, list<mixed>>|array<string, mixed>|array<string, string>|mixed
*/
private array $structure;

View File

@ -737,8 +737,8 @@ class ValidationTest extends CIUnitTestCase
/**
* @dataProvider provideRulesSetup
*
* @param array<string>|string $rules
* @param string $expected
* @param list<string>|string $rules
* @param string $expected
*/
public function testRulesSetup($rules, $expected, array $errors = []): void
{

View File

@ -44,7 +44,7 @@ final class PassStrictParameterToFunctionParameterRector extends AbstractRector
}
/**
* @return array<string>
* @return list<string>
*/
public function getNodeTypes(): array
{

View File

@ -44,7 +44,7 @@ final class RemoveErrorSuppressInTryCatchStmtsRector extends AbstractRector
}
/**
* @return array<string>
* @return list<string>
*/
public function getNodeTypes(): array
{

View File

@ -79,7 +79,7 @@ final class UnderscoreToCamelCaseVariableNameRector extends AbstractRector
}
/**
* @return array<string>
* @return list<string>
*/
public function getNodeTypes(): array
{