Skip to content

Commit 609be52

Browse files
authored
style: enable phpdoc_array_type (#8580)
1 parent d0b1366 commit 609be52

55 files changed

Lines changed: 140 additions & 136 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
]);
4545

4646
$overrides = [
47+
'phpdoc_array_type' => true,
4748
'phpdoc_no_alias_tag' => [
4849
'replacements' => [
4950
'type' => 'var',

.php-cs-fixer.no-header.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
__DIR__ . '/admin/starter/builds',
3030
]);
3131

32-
$overrides = [];
32+
$overrides = [
33+
'phpdoc_array_type' => true,
34+
];
3335

3436
$options = [
3537
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',

.php-cs-fixer.user-guide.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
'import_symbols' => false,
4040
'leading_backslash_in_global_namespace' => true,
4141
],
42+
'phpdoc_array_type' => true,
4243
];
4344

4445
$options = [

app/Config/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class Cache extends BaseConfig
6161
* ['q'] = Enabled, but only take into account the specified list
6262
* of query parameters.
6363
*
64-
* @var bool|string[]
64+
* @var array<string>|bool
6565
*/
6666
public $cacheQueryString = false;
6767

app/Config/ContentSecurityPolicy.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,28 @@ class ContentSecurityPolicy extends BaseConfig
4545
/**
4646
* Will default to self if not overridden
4747
*
48-
* @var string|string[]|null
48+
* @var array<string>|string|null
4949
*/
5050
public $defaultSrc;
5151

5252
/**
5353
* Lists allowed scripts' URLs.
5454
*
55-
* @var string|string[]
55+
* @var array<string>|string
5656
*/
5757
public $scriptSrc = 'self';
5858

5959
/**
6060
* Lists allowed stylesheets' URLs.
6161
*
62-
* @var string|string[]
62+
* @var array<string>|string
6363
*/
6464
public $styleSrc = 'self';
6565

6666
/**
6767
* Defines the origins from which images can be loaded.
6868
*
69-
* @var string|string[]
69+
* @var array<string>|string
7070
*/
7171
public $imageSrc = 'self';
7272

@@ -75,36 +75,36 @@ class ContentSecurityPolicy extends BaseConfig
7575
*
7676
* Will default to self if not overridden
7777
*
78-
* @var string|string[]|null
78+
* @var array<string>|string|null
7979
*/
8080
public $baseURI;
8181

8282
/**
8383
* Lists the URLs for workers and embedded frame contents
8484
*
85-
* @var string|string[]
85+
* @var array<string>|string
8686
*/
8787
public $childSrc = 'self';
8888

8989
/**
9090
* Limits the origins that you can connect to (via XHR,
9191
* WebSockets, and EventSource).
9292
*
93-
* @var string|string[]
93+
* @var array<string>|string
9494
*/
9595
public $connectSrc = 'self';
9696

9797
/**
9898
* Specifies the origins that can serve web fonts.
9999
*
100-
* @var string|string[]
100+
* @var array<string>|string
101101
*/
102102
public $fontSrc;
103103

104104
/**
105105
* Lists valid endpoints for submission from `<form>` tags.
106106
*
107-
* @var string|string[]
107+
* @var array<string>|string
108108
*/
109109
public $formAction = 'self';
110110

@@ -114,7 +114,7 @@ class ContentSecurityPolicy extends BaseConfig
114114
* and `<applet>` tags. This directive can't be used in
115115
* `<meta>` tags and applies only to non-HTML resources.
116116
*
117-
* @var string|string[]|null
117+
* @var array<string>|string|null
118118
*/
119119
public $frameAncestors;
120120

@@ -129,33 +129,33 @@ class ContentSecurityPolicy extends BaseConfig
129129
/**
130130
* Restricts the origins allowed to deliver video and audio.
131131
*
132-
* @var string|string[]|null
132+
* @var array<string>|string|null
133133
*/
134134
public $mediaSrc;
135135

136136
/**
137137
* Allows control over Flash and other plugins.
138138
*
139-
* @var string|string[]
139+
* @var array<string>|string
140140
*/
141141
public $objectSrc = 'self';
142142

143143
/**
144-
* @var string|string[]|null
144+
* @var array<string>|string|null
145145
*/
146146
public $manifestSrc;
147147

148148
/**
149149
* Limits the kinds of plugins a page may invoke.
150150
*
151-
* @var string|string[]|null
151+
* @var array<string>|string|null
152152
*/
153153
public $pluginTypes;
154154

155155
/**
156156
* List of actions allowed.
157157
*
158-
* @var string|string[]|null
158+
* @var array<string>|string|null
159159
*/
160160
public $sandbox;
161161

app/Config/Format.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class Format extends BaseConfig
2222
* These formats are only checked when the data passed to the respond()
2323
* method is an array.
2424
*
25-
* @var string[]
25+
* @var array<string>
2626
*/
2727
public array $supportedResponseFormats = [
2828
'application/json',

app/Config/Toolbar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Toolbar extends BaseConfig
3131
* List of toolbar collectors that will be called when Debug Toolbar
3232
* fires up and collects data from.
3333
*
34-
* @var string[]
34+
* @var array<string>
3535
*/
3636
public array $collectors = [
3737
Timers::class,

app/Config/Validation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Validation extends BaseConfig
1818
* Stores the classes that contain the
1919
* rules that are available.
2020
*
21-
* @var string[]
21+
* @var array<string>
2222
*/
2323
public array $ruleSets = [
2424
Rules::class,

app/Config/View.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class View extends BaseView
5656
*
5757
* All classes must implement CodeIgniter\View\ViewDecoratorInterface
5858
*
59-
* @var class-string<ViewDecoratorInterface>[]
59+
* @var array<class-string<ViewDecoratorInterface>>
6060
*/
6161
public array $decorators = [];
6262
}

system/API/ResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ protected function failValidationError(string $description = 'Bad Request', ?str
234234
/**
235235
* Used when the data provided by the client cannot be validated on one or more fields.
236236
*
237-
* @param string|string[] $errors
237+
* @param array<string>|string $errors
238238
*
239239
* @return ResponseInterface
240240
*/

0 commit comments

Comments
 (0)