mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
style: enable phpdoc_array_type
(#8580)
This commit is contained in:
parent
d0b13665a0
commit
609be527ce
@ -44,6 +44,7 @@ $finder = Finder::create()
|
||||
]);
|
||||
|
||||
$overrides = [
|
||||
'phpdoc_array_type' => true,
|
||||
'phpdoc_no_alias_tag' => [
|
||||
'replacements' => [
|
||||
'type' => 'var',
|
||||
|
@ -29,7 +29,9 @@ $finder = Finder::create()
|
||||
__DIR__ . '/admin/starter/builds',
|
||||
]);
|
||||
|
||||
$overrides = [];
|
||||
$overrides = [
|
||||
'phpdoc_array_type' => true,
|
||||
];
|
||||
|
||||
$options = [
|
||||
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
|
||||
|
@ -39,6 +39,7 @@ $overrides = [
|
||||
'import_symbols' => false,
|
||||
'leading_backslash_in_global_namespace' => true,
|
||||
],
|
||||
'phpdoc_array_type' => true,
|
||||
];
|
||||
|
||||
$options = [
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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',
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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 = [];
|
||||
}
|
||||
|
@ -234,7 +234,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
|
||||
*/
|
||||
|
@ -301,7 +301,7 @@ class FileLocator
|
||||
* 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
|
||||
{
|
||||
@ -334,7 +334,7 @@ class FileLocator
|
||||
* 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
|
||||
{
|
||||
|
@ -439,7 +439,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
|
||||
*/
|
||||
@ -1005,7 +1005,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
|
||||
|
@ -35,7 +35,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;
|
||||
|
||||
|
@ -800,7 +800,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
|
||||
*/
|
||||
|
@ -63,7 +63,7 @@ class MigrateStatus extends BaseCommand
|
||||
/**
|
||||
* Namespaces to ignore when looking for migrations.
|
||||
*
|
||||
* @var string[]
|
||||
* @var array<string>
|
||||
*/
|
||||
protected $ignoredNamespaces = [
|
||||
'CodeIgniter',
|
||||
|
@ -33,7 +33,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;
|
||||
|
||||
|
@ -38,7 +38,7 @@ final class ControllerFinder
|
||||
}
|
||||
|
||||
/**
|
||||
* @return class-string[]
|
||||
* @return array<class-string>
|
||||
*/
|
||||
public function find(): array
|
||||
{
|
||||
|
@ -236,8 +236,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
|
||||
{
|
||||
|
@ -112,7 +112,7 @@ class View extends BaseConfig
|
||||
*
|
||||
* All classes must implement CodeIgniter\View\ViewDecoratorInterface
|
||||
*
|
||||
* @var class-string<ViewDecoratorInterface>[]
|
||||
* @var array<class-string<ViewDecoratorInterface>>
|
||||
*/
|
||||
public array $decorators = [];
|
||||
|
||||
|
@ -35,7 +35,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
|
||||
*
|
||||
@ -44,7 +44,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 {
|
||||
@ -60,7 +60,7 @@ class CookieStore implements Countable, IteratorAggregate
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Cookie[] $cookies
|
||||
* @param array<Cookie> $cookies
|
||||
*
|
||||
* @throws CookieException
|
||||
*/
|
||||
|
@ -116,7 +116,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
|
||||
*/
|
||||
|
@ -281,14 +281,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 = [];
|
||||
|
||||
@ -1763,7 +1763,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
|
||||
*/
|
||||
@ -1900,7 +1900,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
|
||||
*/
|
||||
@ -1936,7 +1936,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
|
||||
*/
|
||||
@ -2021,9 +2021,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
|
||||
*/
|
||||
@ -2165,7 +2165,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)
|
||||
{
|
||||
@ -2531,7 +2531,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)
|
||||
{
|
||||
@ -2793,7 +2793,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)
|
||||
{
|
||||
|
@ -1279,10 +1279,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)
|
||||
{
|
||||
@ -1322,9 +1322,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)
|
||||
{
|
||||
@ -1517,7 +1517,7 @@ abstract class BaseConnection implements ConnectionInterface
|
||||
/**
|
||||
* Returns an object with field data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*/
|
||||
public function getFieldData(string $table)
|
||||
{
|
||||
|
@ -41,14 +41,14 @@ abstract class BaseResult implements ResultInterface
|
||||
/**
|
||||
* Result Array
|
||||
*
|
||||
* @var array[]
|
||||
* @var array<array>
|
||||
*/
|
||||
public $resultArray = [];
|
||||
|
||||
/**
|
||||
* Result Object
|
||||
*
|
||||
* @var object[]
|
||||
* @var array<object>
|
||||
*/
|
||||
public $resultObject = [];
|
||||
|
||||
|
@ -39,7 +39,7 @@ class Forge
|
||||
/**
|
||||
* List of keys.
|
||||
*
|
||||
* @var list<array{fields?: string[], keyName?: string}>
|
||||
* @var list<array{fields?: array<string>, keyName?: string}>
|
||||
*/
|
||||
protected $keys = [];
|
||||
|
||||
@ -53,7 +53,7 @@ class Forge
|
||||
/**
|
||||
* Primary keys.
|
||||
*
|
||||
* @var array{fields?: string[], keyName?: string}
|
||||
* @var array{fields?: array<string>, keyName?: string}
|
||||
*/
|
||||
protected $primaryKeys = [];
|
||||
|
||||
@ -399,8 +399,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
|
||||
*/
|
||||
|
@ -355,9 +355,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)
|
||||
{
|
||||
@ -411,7 +411,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with field data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
@ -443,7 +443,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with index data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
* @throws LogicException
|
||||
@ -489,7 +489,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with Foreign key data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
|
@ -281,7 +281,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with field data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
@ -325,7 +325,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with index data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
@ -374,7 +374,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with Foreign key data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
|
@ -294,7 +294,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with field data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
@ -329,7 +329,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with index data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
@ -368,7 +368,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with Foreign key data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
|
@ -77,7 +77,7 @@ class Connection extends BaseConnection
|
||||
*
|
||||
* Identifiers that must NOT be escaped.
|
||||
*
|
||||
* @var string[]
|
||||
* @var array<string>
|
||||
*/
|
||||
protected $_reserved_identifiers = ['*'];
|
||||
|
||||
@ -231,7 +231,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with index data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
@ -269,7 +269,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
|
||||
*/
|
||||
@ -335,7 +335,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with field data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
|
@ -248,7 +248,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with field data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
@ -286,7 +286,7 @@ class Connection extends BaseConnection
|
||||
/**
|
||||
* Returns an array of objects with index data
|
||||
*
|
||||
* @return stdClass[]
|
||||
* @return array<stdClass>
|
||||
*
|
||||
* @throws DatabaseException
|
||||
*/
|
||||
@ -343,7 +343,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
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ class Toolbar
|
||||
/**
|
||||
* Collectors to be used and displayed.
|
||||
*
|
||||
* @var BaseCollector[]
|
||||
* @var array<BaseCollector>
|
||||
*/
|
||||
protected $collectors = [];
|
||||
|
||||
|
@ -296,7 +296,7 @@ class Email
|
||||
/**
|
||||
* Raw debug messages
|
||||
*
|
||||
* @var string[]
|
||||
* @var array<string>
|
||||
*/
|
||||
private array $debugMessageRaw = [];
|
||||
|
||||
|
@ -59,7 +59,7 @@ class Events
|
||||
/**
|
||||
* A list of found files.
|
||||
*
|
||||
* @var string[]
|
||||
* @var array<string>
|
||||
*/
|
||||
protected static $files = [];
|
||||
|
||||
@ -253,7 +253,7 @@ class Events
|
||||
/**
|
||||
* Returns the files that were found/loaded during this request.
|
||||
*
|
||||
* @return string[]
|
||||
* @return array<string>
|
||||
*/
|
||||
public static function getFiles()
|
||||
{
|
||||
|
@ -32,7 +32,7 @@ class FileCollection implements Countable, IteratorAggregate
|
||||
/**
|
||||
* The current list of file paths.
|
||||
*
|
||||
* @var string[]
|
||||
* @var array<string>
|
||||
*/
|
||||
protected $files = [];
|
||||
|
||||
@ -75,9 +75,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
|
||||
{
|
||||
@ -89,10 +89,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
|
||||
{
|
||||
@ -116,7 +116,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 = [])
|
||||
{
|
||||
@ -136,7 +136,7 @@ class FileCollection implements Countable, IteratorAggregate
|
||||
/**
|
||||
* Optimizes and returns the current file list.
|
||||
*
|
||||
* @return string[]
|
||||
* @return array<string>
|
||||
*/
|
||||
public function get(): array
|
||||
{
|
||||
@ -150,7 +150,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
|
||||
*/
|
||||
@ -164,7 +164,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
|
||||
*/
|
||||
@ -199,7 +199,7 @@ class FileCollection implements Countable, IteratorAggregate
|
||||
/**
|
||||
* Verifies and adds files to the list.
|
||||
*
|
||||
* @param string[] $files
|
||||
* @param array<string> $files
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -227,7 +227,7 @@ class FileCollection implements Countable, IteratorAggregate
|
||||
/**
|
||||
* Removes files from the list.
|
||||
*
|
||||
* @param string[] $files
|
||||
* @param array<string> $files
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -256,7 +256,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
|
||||
*/
|
||||
|
@ -163,7 +163,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)
|
||||
{
|
||||
|
@ -350,7 +350,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 = '');
|
||||
|
||||
@ -364,7 +364,7 @@ interface ResponseInterface extends MessageInterface
|
||||
/**
|
||||
* Returns all cookies currently set.
|
||||
*
|
||||
* @return Cookie[]
|
||||
* @return array<Cookie>
|
||||
*/
|
||||
public function getCookies();
|
||||
|
||||
|
@ -644,7 +644,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 = '')
|
||||
{
|
||||
@ -709,7 +709,7 @@ trait ResponseTrait
|
||||
/**
|
||||
* Returns all cookies currently set.
|
||||
*
|
||||
* @return Cookie[]
|
||||
* @return array<Cookie>
|
||||
*/
|
||||
public function getCookies()
|
||||
{
|
||||
|
@ -544,11 +544,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)
|
||||
{
|
||||
|
@ -173,8 +173,8 @@ class Language
|
||||
/**
|
||||
* Advanced message formatting.
|
||||
*
|
||||
* @param array|string $message
|
||||
* @param string[] $args
|
||||
* @param array|string $message
|
||||
* @param array<string> $args
|
||||
*
|
||||
* @return array|string
|
||||
*/
|
||||
|
@ -43,7 +43,7 @@ class ErrorlogHandler extends BaseHandler
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param mixed[] $config
|
||||
* @param array<mixed> $config
|
||||
*/
|
||||
public function __construct(array $config = [])
|
||||
{
|
||||
|
@ -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',
|
||||
@ -402,7 +402,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
|
||||
*/
|
||||
|
@ -40,7 +40,7 @@ class Publisher extends FileCollection
|
||||
/**
|
||||
* Array of discovered Publishers.
|
||||
*
|
||||
* @var array<string, self[]|null>
|
||||
* @var array<string, array<self>|null>
|
||||
*/
|
||||
private static array $discovered = [];
|
||||
|
||||
@ -60,7 +60,7 @@ class Publisher extends FileCollection
|
||||
/**
|
||||
* List of file published curing the last write operation.
|
||||
*
|
||||
* @var string[]
|
||||
* @var array<string>
|
||||
*/
|
||||
private array $published = [];
|
||||
|
||||
@ -95,7 +95,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
|
||||
{
|
||||
@ -252,7 +252,7 @@ class Publisher extends FileCollection
|
||||
/**
|
||||
* Returns the files published by the last write operation.
|
||||
*
|
||||
* @return string[]
|
||||
* @return array<string>
|
||||
*/
|
||||
final public function getPublished(): array
|
||||
{
|
||||
@ -266,7 +266,7 @@ class Publisher extends FileCollection
|
||||
/**
|
||||
* Verifies and adds paths to the list.
|
||||
*
|
||||
* @param string[] $paths
|
||||
* @param array<string> $paths
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
@ -294,7 +294,7 @@ class Publisher extends FileCollection
|
||||
/**
|
||||
* Downloads and stages files from an array of URIs.
|
||||
*
|
||||
* @param string[] $uris
|
||||
* @param array<string> $uris
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
|
@ -27,7 +27,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;
|
||||
|
||||
@ -100,8 +100,8 @@ final class AutoRouterImproved implements AutoRouterInterface
|
||||
private ?int $paramPos = null;
|
||||
|
||||
/**
|
||||
* @param class-string[] $protectedControllers
|
||||
* @param string $defaultController Short classname
|
||||
* @param array<class-string> $protectedControllers
|
||||
* @param string $defaultController Short classname
|
||||
*
|
||||
* @deprecated $httpVerb is deprecated. No longer used.
|
||||
*/
|
||||
|
@ -1596,7 +1596,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
|
||||
{
|
||||
|
@ -114,7 +114,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 = [];
|
||||
|
||||
@ -228,7 +228,7 @@ class Router implements RouterInterface
|
||||
/**
|
||||
* Returns the filter info for the matched route, if any.
|
||||
*
|
||||
* @return string[]
|
||||
* @return array<string>
|
||||
*/
|
||||
public function getFilters(): array
|
||||
{
|
||||
|
@ -208,7 +208,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
|
||||
{
|
||||
|
@ -29,7 +29,7 @@ class MockCache extends BaseHandler implements CacheInterface
|
||||
/**
|
||||
* Expiration times.
|
||||
*
|
||||
* @var ?int[]
|
||||
* @var ?array<int>
|
||||
*/
|
||||
protected $expirations = [];
|
||||
|
||||
@ -203,7 +203,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()
|
||||
{
|
||||
|
@ -26,7 +26,7 @@ class MockSession extends Session
|
||||
/**
|
||||
* Holds our "cookie" data.
|
||||
*
|
||||
* @var Cookie[]
|
||||
* @var array<Cookie>
|
||||
*/
|
||||
public $cookies = [];
|
||||
|
||||
|
@ -234,7 +234,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
|
||||
@ -626,7 +626,7 @@ class Validation implements ValidationInterface
|
||||
*
|
||||
* @param string $group Group.
|
||||
*
|
||||
* @return string[] Rule group.
|
||||
* @return array<string> Rule group.
|
||||
*
|
||||
* @throws ValidationException If group not found.
|
||||
*/
|
||||
|
@ -34,7 +34,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.
|
||||
@ -84,7 +84,7 @@ interface ValidationInterface
|
||||
*
|
||||
* @param string $group Group.
|
||||
*
|
||||
* @return string[] Rule group.
|
||||
* @return array<string> Rule group.
|
||||
*/
|
||||
public function getRuleGroup(string $group): array;
|
||||
|
||||
|
@ -23,7 +23,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;
|
||||
|
||||
|
@ -640,8 +640,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
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ final class PassStrictParameterToFunctionParameterRector extends AbstractRector
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
* @return array<string>
|
||||
*/
|
||||
public function getNodeTypes(): array
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ final class RemoveErrorSuppressInTryCatchStmtsRector extends AbstractRector
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
* @return array<string>
|
||||
*/
|
||||
public function getNodeTypes(): array
|
||||
{
|
||||
|
@ -79,7 +79,7 @@ final class UnderscoreToCamelCaseVariableNameRector extends AbstractRector
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
* @return array<string>
|
||||
*/
|
||||
public function getNodeTypes(): array
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user