Skip to content

Commit f8b310d

Browse files
committed
bumped phpstan to 2.0
1 parent f70f7b3 commit f8b310d

File tree

3 files changed

+91
-36
lines changed

3 files changed

+91
-36
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
"ibexa/code-style": "^1.0",
5151
"friendsofphp/php-cs-fixer": "^3.0",
5252
"phpunit/phpunit": "^9.5",
53-
"phpstan/phpstan": "^1.10",
54-
"phpstan/phpstan-phpunit": "^1.3",
55-
"phpstan/phpstan-symfony": "^1.3"
53+
"phpstan/phpstan": "^2.0",
54+
"phpstan/phpstan-phpunit": "^2.0",
55+
"phpstan/phpstan-symfony": "^2.0"
5656
},
5757
"scripts": {
5858
"fix-cs": "php-cs-fixer fix --config=.php-cs-fixer.php -v --show-progress=dots",

phpstan-baseline.neon

Lines changed: 86 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,156 +1,211 @@
11
parameters:
22
ignoreErrors:
33
-
4-
message: "#^Cannot access offset 'entries' on array\\|bool\\|float\\|int\\|string\\|null\\.$#"
4+
message: '#^Cannot access offset ''entries'' on array\|bool\|float\|int\|string\|null\.$#'
5+
identifier: offsetAccess.nonOffsetAccessible
56
count: 1
67
path: src/bundle/Command/MigrateLegacyMatrixCommand.php
78

89
-
9-
message: "#^Cannot call method fetchAll\\(\\) on Doctrine\\\\DBAL\\\\ForwardCompatibility\\\\Result\\|int\\|string\\.$#"
10+
message: '#^Cannot call method fetchAll\(\) on Doctrine\\DBAL\\ForwardCompatibility\\Result\|int\|string\.$#'
11+
identifier: method.nonObject
1012
count: 2
1113
path: src/bundle/Command/MigrateLegacyMatrixCommand.php
1214

1315
-
14-
message: "#^Cannot call method fetchColumn\\(\\) on Doctrine\\\\DBAL\\\\ForwardCompatibility\\\\Result\\|int\\|string\\.$#"
16+
message: '#^Cannot call method fetchColumn\(\) on Doctrine\\DBAL\\ForwardCompatibility\\Result\|int\|string\.$#'
17+
identifier: method.nonObject
1518
count: 1
1619
path: src/bundle/Command/MigrateLegacyMatrixCommand.php
1720

1821
-
19-
message: "#^Method Ibexa\\\\Bundle\\\\FieldTypeMatrix\\\\Command\\\\MigrateLegacyMatrixCommand\\:\\:configure\\(\\) has no return type specified\\.$#"
22+
message: '#^Method Ibexa\\Bundle\\FieldTypeMatrix\\Command\\MigrateLegacyMatrixCommand\:\:configure\(\) has no return type specified\.$#'
23+
identifier: missingType.return
2024
count: 1
2125
path: src/bundle/Command/MigrateLegacyMatrixCommand.php
2226

2327
-
24-
message: "#^Method Ibexa\\\\Bundle\\\\FieldTypeMatrix\\\\Command\\\\MigrateLegacyMatrixCommand\\:\\:convertCellsToRows\\(\\) has parameter \\$cells with no value type specified in iterable type array\\.$#"
28+
message: '#^Method Ibexa\\Bundle\\FieldTypeMatrix\\Command\\MigrateLegacyMatrixCommand\:\:convertCellsToRows\(\) has parameter \$cells with no value type specified in iterable type array\.$#'
29+
identifier: missingType.iterableValue
2530
count: 1
2631
path: src/bundle/Command/MigrateLegacyMatrixCommand.php
2732

2833
-
29-
message: "#^Method Ibexa\\\\Bundle\\\\FieldTypeMatrix\\\\Command\\\\MigrateLegacyMatrixCommand\\:\\:convertCellsToRows\\(\\) has parameter \\$columns with no value type specified in iterable type array\\.$#"
34+
message: '#^Method Ibexa\\Bundle\\FieldTypeMatrix\\Command\\MigrateLegacyMatrixCommand\:\:convertCellsToRows\(\) has parameter \$columns with no value type specified in iterable type array\.$#'
35+
identifier: missingType.iterableValue
3036
count: 1
3137
path: src/bundle/Command/MigrateLegacyMatrixCommand.php
3238

3339
-
34-
message: "#^Method Ibexa\\\\Bundle\\\\FieldTypeMatrix\\\\Command\\\\MigrateLegacyMatrixCommand\\:\\:convertCellsToRows\\(\\) return type has no value type specified in iterable type array\\.$#"
40+
message: '#^Method Ibexa\\Bundle\\FieldTypeMatrix\\Command\\MigrateLegacyMatrixCommand\:\:convertCellsToRows\(\) return type has no value type specified in iterable type array\.$#'
41+
identifier: missingType.iterableValue
3542
count: 1
3643
path: src/bundle/Command/MigrateLegacyMatrixCommand.php
3744

3845
-
39-
message: "#^Method Ibexa\\\\Bundle\\\\FieldTypeMatrix\\\\Command\\\\MigrateLegacyMatrixCommand\\:\\:getContentClassAttributes\\(\\) return type has no value type specified in iterable type array\\.$#"
46+
message: '#^Method Ibexa\\Bundle\\FieldTypeMatrix\\Command\\MigrateLegacyMatrixCommand\:\:getContentClassAttributes\(\) return type has no value type specified in iterable type array\.$#'
47+
identifier: missingType.iterableValue
4048
count: 1
4149
path: src/bundle/Command/MigrateLegacyMatrixCommand.php
4250

4351
-
44-
message: "#^Method Ibexa\\\\Bundle\\\\FieldTypeMatrix\\\\Command\\\\MigrateLegacyMatrixCommand\\:\\:getContentObjectAttributes\\(\\) return type has no value type specified in iterable type array\\.$#"
52+
message: '#^Method Ibexa\\Bundle\\FieldTypeMatrix\\Command\\MigrateLegacyMatrixCommand\:\:getContentObjectAttributes\(\) return type has no value type specified in iterable type array\.$#'
53+
identifier: missingType.iterableValue
4554
count: 1
4655
path: src/bundle/Command/MigrateLegacyMatrixCommand.php
4756

4857
-
49-
message: "#^Variable \\$xml might not be defined\\.$#"
58+
message: '#^Variable \$xml might not be defined\.$#'
59+
identifier: variable.undefined
5060
count: 1
5161
path: src/bundle/Command/MigrateLegacyMatrixCommand.php
5262

5363
-
54-
message: "#^Parameter \\#1 \\$input of static method Symfony\\\\Component\\\\Yaml\\\\Yaml\\:\\:parse\\(\\) expects string, string\\|false given\\.$#"
64+
message: '#^Parameter \#1 \$input of static method Symfony\\Component\\Yaml\\Yaml\:\:parse\(\) expects string, string\|false given\.$#'
65+
identifier: argument.type
5566
count: 1
5667
path: src/bundle/DependencyInjection/IbexaFieldTypeMatrixExtension.php
5768

5869
-
59-
message: "#^Property Ibexa\\\\Core\\\\Persistence\\\\Legacy\\\\Content\\\\StorageFieldDefinition\\:\\:\\$dataText5 \\(string\\) on left side of \\?\\? is not nullable\\.$#"
70+
message: '#^Property Ibexa\\Core\\Persistence\\Legacy\\Content\\StorageFieldDefinition\:\:\$dataText5 \(string\) on left side of \?\? is not nullable\.$#'
71+
identifier: nullCoalesce.property
6072
count: 1
6173
path: src/lib/FieldType/Converter/MatrixConverter.php
6274

6375
-
64-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\FieldType\\\\Value\\\\Row\\:\\:__construct\\(\\) has parameter \\$cells with no value type specified in iterable type array\\.$#"
76+
message: '#^Method Ibexa\\FieldTypeMatrix\\FieldType\\Value\\Row\:\:__construct\(\) has parameter \$cells with no value type specified in iterable type array\.$#'
77+
identifier: missingType.iterableValue
6578
count: 1
6679
path: src/lib/FieldType/Value/Row.php
6780

6881
-
69-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\FieldType\\\\Value\\\\Row\\:\\:__get\\(\\) has no return type specified\\.$#"
82+
message: '#^Method Ibexa\\FieldTypeMatrix\\FieldType\\Value\\Row\:\:__get\(\) has no return type specified\.$#'
83+
identifier: missingType.return
7084
count: 1
7185
path: src/lib/FieldType/Value/Row.php
7286

7387
-
74-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\FieldType\\\\Value\\\\Row\\:\\:__get\\(\\) has parameter \\$name with no type specified\\.$#"
88+
message: '#^Method Ibexa\\FieldTypeMatrix\\FieldType\\Value\\Row\:\:__get\(\) has parameter \$name with no type specified\.$#'
89+
identifier: missingType.parameter
7590
count: 1
7691
path: src/lib/FieldType/Value/Row.php
7792

7893
-
79-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\FieldType\\\\Value\\\\Row\\:\\:__isset\\(\\) has parameter \\$name with no type specified\\.$#"
94+
message: '#^Method Ibexa\\FieldTypeMatrix\\FieldType\\Value\\Row\:\:__isset\(\) has parameter \$name with no type specified\.$#'
95+
identifier: missingType.parameter
8096
count: 1
8197
path: src/lib/FieldType/Value/Row.php
8298

8399
-
84-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\FieldType\\\\Value\\\\Row\\:\\:getCells\\(\\) return type has no value type specified in iterable type array\\.$#"
100+
message: '#^Method Ibexa\\FieldTypeMatrix\\FieldType\\Value\\Row\:\:getCells\(\) return type has no value type specified in iterable type array\.$#'
101+
identifier: missingType.iterableValue
85102
count: 1
86103
path: src/lib/FieldType/Value/Row.php
87104

88105
-
89-
message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(string\\)\\: bool\\)\\|null, 'strlen' given\\.$#"
106+
message: '#^Parameter \#2 \$callback of function array_filter expects \(callable\(string\)\: bool\)\|null, ''strlen'' given\.$#'
107+
identifier: argument.type
90108
count: 1
91109
path: src/lib/FieldType/Value/Row.php
92110

93111
-
94-
message: "#^Property Ibexa\\\\FieldTypeMatrix\\\\FieldType\\\\Value\\\\Row\\:\\:\\$cells type has no value type specified in iterable type array\\.$#"
112+
message: '#^Property Ibexa\\FieldTypeMatrix\\FieldType\\Value\\Row\:\:\$cells type has no value type specified in iterable type array\.$#'
113+
identifier: missingType.iterableValue
95114
count: 1
96115
path: src/lib/FieldType/Value/Row.php
97116

98117
-
99-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\GraphQL\\\\InputHandler\\:\\:toFieldValue\\(\\) has parameter \\$input with no type specified\\.$#"
118+
message: '#^Class Ibexa\\FieldTypeMatrix\\Form\\Type\\ColumnType extends generic class Symfony\\Component\\Form\\AbstractType but does not specify its types\: TData$#'
119+
identifier: missingType.generics
120+
count: 1
121+
path: src/lib/Form/Type/ColumnType.php
122+
123+
-
124+
message: '#^Class Ibexa\\FieldTypeMatrix\\Form\\Type\\FieldType\\MatrixCollectionType extends generic class Symfony\\Component\\Form\\AbstractType but does not specify its types\: TData$#'
125+
identifier: missingType.generics
126+
count: 1
127+
path: src/lib/Form/Type/FieldType/MatrixCollectionType.php
128+
129+
-
130+
message: '#^Class Ibexa\\FieldTypeMatrix\\Form\\Type\\FieldType\\MatrixEntryType extends generic class Symfony\\Component\\Form\\AbstractType but does not specify its types\: TData$#'
131+
identifier: missingType.generics
132+
count: 1
133+
path: src/lib/Form/Type/FieldType/MatrixEntryType.php
134+
135+
-
136+
message: '#^Class Ibexa\\FieldTypeMatrix\\Form\\Type\\FieldType\\MatrixFieldType extends generic class Symfony\\Component\\Form\\AbstractType but does not specify its types\: TData$#'
137+
identifier: missingType.generics
138+
count: 1
139+
path: src/lib/Form/Type/FieldType/MatrixFieldType.php
140+
141+
-
142+
message: '#^Method Ibexa\\FieldTypeMatrix\\GraphQL\\InputHandler\:\:toFieldValue\(\) has parameter \$input with no type specified\.$#'
143+
identifier: missingType.parameter
100144
count: 1
101145
path: src/lib/GraphQL/InputHandler.php
102146

103147
-
104-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\GraphQL\\\\InputHandler\\:\\:toFieldValue\\(\\) has parameter \\$inputFormat with no type specified\\.$#"
148+
message: '#^Method Ibexa\\FieldTypeMatrix\\GraphQL\\InputHandler\:\:toFieldValue\(\) has parameter \$inputFormat with no type specified\.$#'
149+
identifier: missingType.parameter
105150
count: 1
106151
path: src/lib/GraphQL/InputHandler.php
107152

108153
-
109-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\GraphQL\\\\Schema\\\\MatrixFieldDefinitionInputSchemaWorker\\:\\:canWork\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
154+
message: '#^Method Ibexa\\FieldTypeMatrix\\GraphQL\\Schema\\MatrixFieldDefinitionInputSchemaWorker\:\:canWork\(\) has parameter \$args with no value type specified in iterable type array\.$#'
155+
identifier: missingType.iterableValue
110156
count: 1
111157
path: src/lib/GraphQL/Schema/MatrixFieldDefinitionInputSchemaWorker.php
112158

113159
-
114-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\GraphQL\\\\Schema\\\\MatrixFieldDefinitionInputSchemaWorker\\:\\:typeName\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
160+
message: '#^Method Ibexa\\FieldTypeMatrix\\GraphQL\\Schema\\MatrixFieldDefinitionInputSchemaWorker\:\:typeName\(\) has parameter \$args with no value type specified in iterable type array\.$#'
161+
identifier: missingType.iterableValue
115162
count: 1
116163
path: src/lib/GraphQL/Schema/MatrixFieldDefinitionInputSchemaWorker.php
117164

118165
-
119-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\GraphQL\\\\Schema\\\\MatrixFieldDefinitionInputSchemaWorker\\:\\:work\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
166+
message: '#^Method Ibexa\\FieldTypeMatrix\\GraphQL\\Schema\\MatrixFieldDefinitionInputSchemaWorker\:\:work\(\) has parameter \$args with no value type specified in iterable type array\.$#'
167+
identifier: missingType.iterableValue
120168
count: 1
121169
path: src/lib/GraphQL/Schema/MatrixFieldDefinitionInputSchemaWorker.php
122170

123171
-
124-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\GraphQL\\\\Schema\\\\MatrixFieldDefinitionSchemaWorker\\:\\:canWork\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
172+
message: '#^Method Ibexa\\FieldTypeMatrix\\GraphQL\\Schema\\MatrixFieldDefinitionSchemaWorker\:\:canWork\(\) has parameter \$args with no value type specified in iterable type array\.$#'
173+
identifier: missingType.iterableValue
125174
count: 1
126175
path: src/lib/GraphQL/Schema/MatrixFieldDefinitionSchemaWorker.php
127176

128177
-
129-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\GraphQL\\\\Schema\\\\MatrixFieldDefinitionSchemaWorker\\:\\:typeName\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
178+
message: '#^Method Ibexa\\FieldTypeMatrix\\GraphQL\\Schema\\MatrixFieldDefinitionSchemaWorker\:\:typeName\(\) has parameter \$args with no value type specified in iterable type array\.$#'
179+
identifier: missingType.iterableValue
130180
count: 1
131181
path: src/lib/GraphQL/Schema/MatrixFieldDefinitionSchemaWorker.php
132182

133183
-
134-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\GraphQL\\\\Schema\\\\MatrixFieldDefinitionSchemaWorker\\:\\:work\\(\\) has parameter \\$args with no value type specified in iterable type array\\.$#"
184+
message: '#^Method Ibexa\\FieldTypeMatrix\\GraphQL\\Schema\\MatrixFieldDefinitionSchemaWorker\:\:work\(\) has parameter \$args with no value type specified in iterable type array\.$#'
185+
identifier: missingType.iterableValue
135186
count: 1
136187
path: src/lib/GraphQL/Schema/MatrixFieldDefinitionSchemaWorker.php
137188

138189
-
139-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\GraphQL\\\\SilentRow\\:\\:__get\\(\\) has no return type specified\\.$#"
190+
message: '#^Method Ibexa\\FieldTypeMatrix\\GraphQL\\SilentRow\:\:__get\(\) has no return type specified\.$#'
191+
identifier: missingType.return
140192
count: 1
141193
path: src/lib/GraphQL/SilentRow.php
142194

143195
-
144-
message: "#^Method Ibexa\\\\FieldTypeMatrix\\\\GraphQL\\\\SilentRow\\:\\:__get\\(\\) has parameter \\$name with no type specified\\.$#"
196+
message: '#^Method Ibexa\\FieldTypeMatrix\\GraphQL\\SilentRow\:\:__get\(\) has parameter \$name with no type specified\.$#'
197+
identifier: missingType.parameter
145198
count: 1
146199
path: src/lib/GraphQL/SilentRow.php
147200

148201
-
149-
message: "#^Static property Ibexa\\\\Contracts\\\\Core\\\\Test\\\\Repository\\\\SetupFactory\\\\Legacy\\:\\:\\$serviceContainer \\(Ibexa\\\\Core\\\\Base\\\\ServiceContainer\\) in isset\\(\\) is not nullable\\.$#"
202+
message: '#^Static property Ibexa\\Contracts\\Core\\Test\\Repository\\SetupFactory\\Legacy\:\:\$serviceContainer \(Ibexa\\Core\\Base\\ServiceContainer\) in isset\(\) is not nullable\.$#'
203+
identifier: isset.property
150204
count: 1
151205
path: tests/lib/LegacySetupFactory.php
152206

153207
-
154-
message: "#^Access to an undefined property Ibexa\\\\Contracts\\\\Core\\\\Repository\\\\Values\\\\ValueObject\\:\\:\\$id\\.$#"
208+
message: '#^Access to an undefined property Ibexa\\Contracts\\Core\\Repository\\Values\\ValueObject\:\:\$id\.$#'
209+
identifier: property.notFound
155210
count: 1
156211
path: tests/lib/Repository/SearchServiceTest.php

src/lib/FieldType/Mapper/MatrixFormMapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class MatrixFormMapper implements FieldDefinitionFormMapperInterface, FieldValue
2727
* - field settings
2828
* - default value.
2929
*
30-
* @param \Symfony\Component\Form\FormInterface $fieldDefinitionForm form for current FieldDefinition
30+
* @param \Symfony\Component\Form\FormInterface<\Ibexa\AdminUi\Form\Data\FieldDefinitionData> $fieldDefinitionForm form for current FieldDefinition
3131
* @param \Ibexa\AdminUi\Form\Data\FieldDefinitionData $data underlying data for current FieldDefinition form
3232
*/
3333
public function mapFieldDefinitionForm(FormInterface $fieldDefinitionForm, FieldDefinitionData $data): void
@@ -61,7 +61,7 @@ public function mapFieldDefinitionForm(FormInterface $fieldDefinitionForm, Field
6161
* Maps Field form to current FieldType.
6262
* Allows to add form fields for content edition.
6363
*
64-
* @param \Symfony\Component\Form\FormInterface $fieldForm form for the current Field
64+
* @param \Symfony\Component\Form\FormInterface<\Ibexa\Contracts\ContentForms\Data\Content\FieldData> $fieldForm form for the current Field
6565
* @param \Ibexa\Contracts\ContentForms\Data\Content\FieldData $data underlying data for current Field form
6666
*/
6767
public function mapFieldValueForm(FormInterface $fieldForm, FieldData $data): void

0 commit comments

Comments
 (0)