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

Conflicts:
	system/Router/AutoRouterImproved.php
	system/Router/Router.php
This commit is contained in:
kenjis 2024-02-26 06:59:33 +09:00
commit e1df9f5bcd
No known key found for this signature in database
GPG Key ID: BD254878922AF198
61 changed files with 213 additions and 161 deletions

View File

@ -44,6 +44,7 @@ $finder = Finder::create()
]);
$overrides = [
'phpdoc_array_type' => true,
'phpdoc_no_alias_tag' => [
'replacements' => [
'type' => 'var',
@ -62,6 +63,8 @@ $overrides = [
'phpstan-param',
'phpstan-property',
'phpstan-return',
'phpstan-type',
'phpstan-var',
'property',
'property-read',
'property-write',

View File

@ -29,7 +29,32 @@ $finder = Finder::create()
__DIR__ . '/admin/starter/builds',
]);
$overrides = [];
$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',
],
],
];
$options = [
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',

View File

@ -39,6 +39,30 @@ $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 bool|string[]
* @var array<string>|bool
*/
public $cacheQueryString = false;

View File

@ -45,28 +45,28 @@ class ContentSecurityPolicy extends BaseConfig
/**
* Will default to self if not overridden
*
* @var string|string[]|null
* @var array<string>|string|null
*/
public $defaultSrc;
/**
* Lists allowed scripts' URLs.
*
* @var string|string[]
* @var array<string>|string
*/
public $scriptSrc = 'self';
/**
* Lists allowed stylesheets' URLs.
*
* @var string|string[]
* @var array<string>|string
*/
public $styleSrc = 'self';
/**
* Defines the origins from which images can be loaded.
*
* @var string|string[]
* @var array<string>|string
*/
public $imageSrc = 'self';
@ -75,14 +75,14 @@ class ContentSecurityPolicy extends BaseConfig
*
* Will default to self if not overridden
*
* @var string|string[]|null
* @var array<string>|string|null
*/
public $baseURI;
/**
* Lists the URLs for workers and embedded frame contents
*
* @var string|string[]
* @var array<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 string|string[]
* @var array<string>|string
*/
public $connectSrc = 'self';
/**
* Specifies the origins that can serve web fonts.
*
* @var string|string[]
* @var array<string>|string
*/
public $fontSrc;
/**
* Lists valid endpoints for submission from `<form>` tags.
*
* @var string|string[]
* @var array<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 string|string[]|null
* @var array<string>|string|null
*/
public $frameAncestors;
@ -129,33 +129,33 @@ class ContentSecurityPolicy extends BaseConfig
/**
* Restricts the origins allowed to deliver video and audio.
*
* @var string|string[]|null
* @var array<string>|string|null
*/
public $mediaSrc;
/**
* Allows control over Flash and other plugins.
*
* @var string|string[]
* @var array<string>|string
*/
public $objectSrc = 'self';
/**
* @var string|string[]|null
* @var array<string>|string|null
*/
public $manifestSrc;
/**
* Limits the kinds of plugins a page may invoke.
*
* @var string|string[]|null
* @var array<string>|string|null
*/
public $pluginTypes;
/**
* List of actions allowed.
*
* @var string|string[]|null
* @var array<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 string[]
* @var array<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 string[]
* @var array<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 string[]
* @var array<string>
*/
public array $ruleSets = [
Rules::class,

View File

@ -34,7 +34,7 @@ class View extends BaseView
* { title|esc(js) }
* { created_on|date(Y-m-d)|esc(attr) }
*
* @var array<string, string>
* @var array<string, string>
* @phpstan-var array<string, ParserCallableString>
*/
public $filters = [];
@ -44,7 +44,7 @@ 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>
* @var array<string, array<string>|callable|string>
* @phpstan-var array<string, array<ParserCallableString>|ParserCallableString|ParserCallable>
*/
public $plugins = [];
@ -56,7 +56,7 @@ class View extends BaseView
*
* All classes must implement CodeIgniter\View\ViewDecoratorInterface
*
* @var class-string<ViewDecoratorInterface>[]
* @var array<class-string<ViewDecoratorInterface>>
*/
public array $decorators = [];
}

View File

@ -70,7 +70,7 @@ trait ResponseTrait
* Either 'json' or 'xml'. If null is set, it will be determined through
* content negotiation.
*
* @var string|null
* @var string|null
* @phpstan-var 'html'|'json'|'xml'|null
*/
protected $format = 'json';
@ -240,7 +240,7 @@ trait ResponseTrait
/**
* Used when the data provided by the client cannot be validated on one or more fields.
*
* @param string|string[] $errors
* @param array<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 string[] List of file paths
* @return array<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 string[] List of file paths
* @return array<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 string[] List of file paths
* @return array<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 string[] List of file paths
* @return array<string> List of file paths
*/
public function listNamespaceFiles(string $prefix, string $path): array;
}

View File

@ -47,15 +47,15 @@ use stdClass;
* - process various callbacks
* - allow intermingling calls to the db connection
*
* @phpstan-type row_array array<int|string, float|int|null|object|string>
* @phpstan-type row_array array<int|string, float|int|null|object|string>
* @phpstan-type event_data_beforeinsert array{data: row_array}
* @phpstan-type event_data_afterinsert array{id: int|string, data: row_array, result: bool}
* @phpstan-type event_data_beforefind array{id?: int|string, method: string, singleton: bool, limit?: int, offset?: int}
* @phpstan-type event_data_afterfind array{id: int|string|null|list<int|string>, data: row_array|list<row_array>|object|null, method: string, singleton: bool}
* @phpstan-type event_data_afterinsert array{id: int|string, data: row_array, result: bool}
* @phpstan-type event_data_beforefind array{id?: int|string, method: string, singleton: bool, limit?: int, offset?: int}
* @phpstan-type event_data_afterfind array{id: int|string|null|list<int|string>, data: row_array|list<row_array>|object|null, method: string, singleton: bool}
* @phpstan-type event_data_beforeupdate array{id: null|list<int|string>, data: row_array}
* @phpstan-type event_data_afterupdate array{id: null|list<int|string>, data: row_array|object, result: bool}
* @phpstan-type event_data_afterupdate array{id: null|list<int|string>, data: row_array|object, result: bool}
* @phpstan-type event_data_beforedelete array{id: null|list<int|string>, purge: bool}
* @phpstan-type event_data_afterdelete array{id: null|list<int|string>, data: null, purge: bool, result: bool}
* @phpstan-type event_data_afterdelete array{id: null|list<int|string>, data: null, purge: bool, result: bool}
*/
abstract class BaseModel
{
@ -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 false|int|string[] Number of rows affected or FALSE on failure, SQL array when testMode
* @return array<string>|false|int 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 false|int|string[] Number of rows affected or FALSE on failure, SQL array when testMode
* @return array<string>|false|int 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 bool|string[]
* @var array<string>|bool
*/
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 string|string[]|null Route filters, that is, the filters specified in the routes file
* @return array<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 string[]
* @var array<string>
*/
protected $ignoredNamespaces = [
'CodeIgniter',

View File

@ -359,7 +359,7 @@ class LocalizationFinder extends BaseCommand
}
/**
* @param SplFileInfo[] $files
* @param array<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 class-string[]
* @var array<class-string>
*/
private array $protectedControllers;

View File

@ -40,7 +40,7 @@ final class ControllerFinder
}
/**
* @return class-string[]
* @return array<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 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 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
*/
function cookies(array $cookies = [], bool $getGlobal = true): CookieStore
{

View File

@ -41,7 +41,7 @@ class View extends BaseConfig
*
* @psalm-suppress UndefinedDocblockClass
*
* @var array<string, string>
* @var array<string, string>
* @phpstan-var array<string, parser_callable_string>
*/
public $filters = [];
@ -53,7 +53,7 @@ class View extends BaseConfig
*
* @psalm-suppress UndefinedDocblockClass
*
* @var array<string, array<string>|callable|string>
* @var array<string, array<string>|callable|string>
* @phpstan-var array<string, array<parser_callable_string>|parser_callable_string|parser_callable>
*/
public $plugins = [];
@ -61,7 +61,7 @@ class View extends BaseConfig
/**
* Built-in View filters.
*
* @var array<string, string>
* @var array<string, string>
* @phpstan-var array<string, parser_callable_string>
*/
protected $coreFilters = [
@ -91,7 +91,7 @@ class View extends BaseConfig
/**
* Built-in View plugins.
*
* @var array<string, array<string>|callable|string>
* @var array<string, array<string>|callable|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 class-string<ViewDecoratorInterface>[]
* @var array<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 string[] $headers
* @param array<string> $headers
*
* @return static
*
@ -46,7 +46,7 @@ class CookieStore implements Countable, IteratorAggregate
public static function fromCookieHeaders(array $headers, bool $raw = false)
{
/**
* @var Cookie[] $cookies
* @var array<Cookie> $cookies
*/
$cookies = array_filter(array_map(static function (string $header) use ($raw) {
try {
@ -62,7 +62,7 @@ class CookieStore implements Countable, IteratorAggregate
}
/**
* @param Cookie[] $cookies
* @param array<Cookie> $cookies
*
* @throws CookieException
*/

View File

@ -118,7 +118,7 @@ class CookieException extends FrameworkException
/**
* Thrown when the queried Cookie object does not exist in the cookie collection.
*
* @param string[] $data
* @param array<string> $data
*
* @return static
*/

View File

@ -284,14 +284,14 @@ class BaseBuilder
/**
* Strings that determine if a string represents a literal value or a field name
*
* @var string[]
* @var array<string>
*/
protected $isLiteralStr = [];
/**
* RegExp used to get operators
*
* @var string[]
* @var array<string>
*/
protected $pregOperators = [];
@ -1778,7 +1778,7 @@ class BaseBuilder
*
* @param '_deleteBatch'|'_insertBatch'|'_updateBatch'|'_upsertBatch' $renderMethod
*
* @return false|int|string[] Number of rows inserted or FALSE on failure, SQL array when testMode
* @return array<string>|false|int 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 false|int|string[] Number of affected rows or FALSE on failure, SQL array when testMode
* @return array<string>|false|int 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 false|int|string[] Number of affected rows or FALSE on failure, SQL array when testMode
* @return array<string>|false|int 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 RawSql[]|string|string[] $set
* @param bool $addToDefault adds update fields to the default ones
* @param array|null $ignore ignores items in set
* @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
*
* @return $this
*/
@ -2180,7 +2180,7 @@ class BaseBuilder
*
* @param array|object|null $set a dataset
*
* @return false|int|string[] Number of rows inserted or FALSE on failure, SQL array when testMode
* @return array<string>|false|int 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 false|int|string[] Number of rows affected or FALSE on failure, SQL array when testMode
* @return array<string>|false|int 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 false|int|string[] Number of rows affected or FALSE on failure, SQL array when testMode
* @return array<string>|false|int Number of rows affected or FALSE on failure, SQL array when testMode
*/
public function deleteBatch($set = null, $constraints = null, int $batchSize = 100)
{

View File

@ -203,7 +203,7 @@ abstract class BaseConnection implements ConnectionInterface
/**
* Connection ID
*
* @var false|object|resource
* @var false|object|resource
* @phpstan-var false|TConnection
*/
public $connID = false;
@ -211,7 +211,7 @@ abstract class BaseConnection implements ConnectionInterface
/**
* Result ID
*
* @var false|object|resource
* @var false|object|resource
* @phpstan-var false|TResult
*/
public $resultID = false;
@ -1308,10 +1308,10 @@ abstract class BaseConnection implements ConnectionInterface
/**
* Escape String
*
* @param string|string[] $str Input string
* @param bool $like Whether or not the string will be used in a LIKE condition
* @param array<string>|string $str Input string
* @param bool $like Whether or not the string will be used in a LIKE condition
*
* @return string|string[]
* @return array<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 string|string[] $str
* @param array<string>|string $str
*
* @return string|string[]
* @return array<string>|string
*/
public function escapeLikeString($str)
{
@ -1546,7 +1546,7 @@ abstract class BaseConnection implements ConnectionInterface
/**
* Returns an object with field data
*
* @return stdClass[]
* @return array<stdClass>
*/
public function getFieldData(string $table)
{

View File

@ -31,7 +31,7 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
/**
* The prepared statement itself.
*
* @var object|resource|null
* @var object|resource|null
* @phpstan-var TStatement|null
*/
protected $statement;
@ -61,7 +61,7 @@ abstract class BasePreparedQuery implements PreparedQueryInterface
/**
* A reference to the db connection to use.
*
* @var BaseConnection
* @var BaseConnection
* @phpstan-var BaseConnection<TConnection, TResult>
*/
protected $db;

View File

@ -27,7 +27,7 @@ abstract class BaseResult implements ResultInterface
/**
* Connection ID
*
* @var object|resource
* @var object|resource
* @phpstan-var TConnection
*/
public $connID;
@ -35,7 +35,7 @@ abstract class BaseResult implements ResultInterface
/**
* Result ID
*
* @var false|object|resource
* @var false|object|resource
* @phpstan-var false|TResult
*/
public $resultID;
@ -43,14 +43,14 @@ abstract class BaseResult implements ResultInterface
/**
* Result Array
*
* @var array[]
* @var array<array>
*/
public $resultArray = [];
/**
* Result Object
*
* @var object[]
* @var array<object>
*/
public $resultObject = [];

View File

@ -41,7 +41,7 @@ class Forge
/**
* List of keys.
*
* @var list<array{fields?: string[], keyName?: string}>
* @var list<array{fields?: array<string>, keyName?: string}>
*/
protected $keys = [];
@ -55,7 +55,7 @@ class Forge
/**
* Primary keys.
*
* @var array{fields?: string[], keyName?: string}
* @var array{fields?: array<string>, keyName?: string}
*/
protected $primaryKeys = [];
@ -401,8 +401,8 @@ class Forge
/**
* Add Foreign Key
*
* @param string|string[] $fieldName
* @param string|string[] $tableField
* @param array<string>|string $fieldName
* @param array<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 string|string[] $str Input string
* @param array<string>|string $str Input string
*
* @return string|string[]
* @return array<string>|string
*/
public function escapeLikeStringDirect($str)
{
@ -413,7 +413,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with field data
*
* @return stdClass[]
* @return array<stdClass>
*
* @throws DatabaseException
*/
@ -445,7 +445,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with index data
*
* @return stdClass[]
* @return array<stdClass>
*
* @throws DatabaseException
* @throws LogicException
@ -491,7 +491,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with Foreign key data
*
* @return stdClass[]
* @return array<stdClass>
*
* @throws DatabaseException
*/

View File

@ -283,7 +283,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with field data
*
* @return stdClass[]
* @return array<stdClass>
*
* @throws DatabaseException
*/
@ -327,7 +327,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with index data
*
* @return stdClass[]
* @return array<stdClass>
*
* @throws DatabaseException
*/
@ -376,7 +376,7 @@ class Connection extends BaseConnection
/**
* Returns an array of objects with Foreign key data
*
* @return stdClass[]
* @return array<stdClass>
*
* @throws DatabaseException
*/

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -61,7 +61,7 @@ class Events
/**
* A list of found files.
*
* @var string[]
* @var array<string>
*/
protected static $files = [];
@ -255,7 +255,7 @@ class Events
/**
* Returns the files that were found/loaded during this request.
*
* @return string[]
* @return array<string>
*/
public static function getFiles()
{

View File

@ -34,7 +34,7 @@ class FileCollection implements Countable, IteratorAggregate
/**
* The current list of file paths.
*
* @var string[]
* @var array<string>
*/
protected $files = [];
@ -77,9 +77,9 @@ class FileCollection implements Countable, IteratorAggregate
/**
* Removes files that are not part of the given directory (recursive).
*
* @param string[] $files
* @param array<string> $files
*
* @return string[]
* @return array<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 string[] $files
* @param string $pattern Regex or pseudo-regex string
* @param array<string> $files
* @param string $pattern Regex or pseudo-regex string
*
* @return string[]
* @return array<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 string[] $files
* @param array<string> $files
*/
public function __construct(array $files = [])
{
@ -138,7 +138,7 @@ class FileCollection implements Countable, IteratorAggregate
/**
* Optimizes and returns the current file list.
*
* @return string[]
* @return array<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 string[] $files The new file list to use
* @param array<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 string|string[] $paths
* @param array<string>|string $paths
*
* @return $this
*/
@ -201,7 +201,7 @@ class FileCollection implements Countable, IteratorAggregate
/**
* Verifies and adds files to the list.
*
* @param string[] $files
* @param array<string> $files
*
* @return $this
*/
@ -229,7 +229,7 @@ class FileCollection implements Countable, IteratorAggregate
/**
* Removes files from the list.
*
* @param string[] $files
* @param array<string> $files
*
* @return $this
*/
@ -258,7 +258,7 @@ class FileCollection implements Countable, IteratorAggregate
* Verifies and adds files from each
* directory to the list.
*
* @param string[] $directories
* @param array<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 UploadedFile|UploadedFile[]
* @return array<UploadedFile>|UploadedFile
*/
protected function createFileObject(array $array)
{

View File

@ -352,7 +352,7 @@ interface ResponseInterface extends MessageInterface
/**
* Returns the cookie
*
* @return Cookie|Cookie[]|null
* @return array<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 Cookie[]
* @return array<Cookie>
*/
public function getCookies();

View File

@ -583,7 +583,7 @@ trait ResponseTrait
* @param string $prefix Cookie prefix.
* '': the default prefix
*
* @return Cookie|Cookie[]|null
* @return array<Cookie>|Cookie|null
*/
public function getCookie(?string $name = null, string $prefix = '')
{
@ -648,7 +648,7 @@ trait ResponseTrait
/**
* Returns all cookies currently set.
*
* @return Cookie[]
* @return array<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 string|string[] $default Default value
* @param bool $htmlEscape Whether to escape HTML special characters or not
* @param string $field Field name
* @param array<string>|string $default Default value
* @param bool $htmlEscape Whether to escape HTML special characters or not
*
* @return string|string[]
* @return array<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 string[] $args
* @param array|string $message
* @param array<string> $args
*
* @return array|string
*/

View File

@ -45,7 +45,7 @@ class ErrorlogHandler extends BaseHandler
/**
* Constructor.
*
* @param mixed[] $config
* @param array<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 string[] method name
* @var array<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 false|int|string[] Number of rows affected or FALSE on failure, SQL array when testMode
* @return array<string>|false|int 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, self[]|null>
* @var array<string, array<self>|null>
*/
private static array $discovered = [];
@ -62,7 +62,7 @@ class Publisher extends FileCollection
/**
* List of file published curing the last write operation.
*
* @var string[]
* @var array<string>
*/
private array $published = [];
@ -97,7 +97,7 @@ class Publisher extends FileCollection
/**
* Discovers and returns all Publishers in the specified namespace directory.
*
* @return self[]
* @return array<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 string[]
* @return array<string>
*/
final public function getPublished(): array
{
@ -268,7 +268,7 @@ class Publisher extends FileCollection
/**
* Verifies and adds paths to the list.
*
* @param string[] $paths
* @param array<string> $paths
*
* @return $this
*/
@ -296,7 +296,7 @@ class Publisher extends FileCollection
/**
* Downloads and stages files from an array of URIs.
*
* @param string[] $uris
* @param array<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 class-string[]
* @var array<class-string>
*/
private array $protectedControllers;
@ -126,8 +126,8 @@ final class AutoRouterImproved implements AutoRouterInterface
private ?string $uri = null;
/**
* @param class-string[] $protectedControllers
* @param string $defaultController Short classname
* @param array<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 string|string[] $subdomains
* @param array<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 string[]
* @var array<string>
*/
protected $filtersInfo = [];
@ -217,7 +217,7 @@ class Router implements RouterInterface
/**
* Returns the filter info for the matched route, if any.
*
* @return string[]
* @return array<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 string[] The filter aliases
* @return array<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 ?int[]
* @var ?array<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 string[] Keys currently present in the store
* @return array<string> Keys currently present in the store
*/
public function getCacheInfo()
{

View File

@ -31,7 +31,7 @@ final class MockInputOutput extends InputOutput
/**
* Output lines.
*
* @var array<int, string>
* @var array<int, string>
* @phpstan-var list<string>
*/
private array $outputs = [];

View File

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

View File

@ -483,7 +483,7 @@ class TestResponse
/**
* Forward any unrecognized method calls to our DOMParser instance.
*
* @param mixed[] $params
* @param array<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 string[] $errors The custom error message.
* @param array<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 string[] Rule group.
* @return array<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 string[] $errors
* @param array<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 string[] Rule group.
* @return array<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, array<string>|callable|string>
* @phpstan-var array<string, array<parser_callable_string>|parser_callable_string|parser_callable>
*/
protected $plugins = [];

View File

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

View File

@ -737,8 +737,8 @@ class ValidationTest extends CIUnitTestCase
/**
* @dataProvider provideRulesSetup
*
* @param string|string[] $rules
* @param string $expected
* @param array<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 string[]
* @return array<string>
*/
public function getNodeTypes(): array
{

View File

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

View File

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