Skip to content

Commit 07bcbda

Browse files
committed
[TASK] Make extensions compatible to TYPO3 v14.1
1 parent 844672b commit 07bcbda

14 files changed

Lines changed: 399 additions & 206 deletions

.github/workflows/ci.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
run: composer install --prefer-dist --no-progress --no-suggest
5050

5151
- name: Coding Guideline
52-
run: vendor/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php -v --dry-run --using-cache=no --path-mode=intersection ./
52+
run: ./.build/bin/php-cs-fixer fix --config=Build/.php-cs-fixer.dist.php -v --dry-run --using-cache=no --path-mode=intersection ./
5353

5454
code-quality:
5555
runs-on: ubuntu-latest
@@ -74,12 +74,14 @@ jobs:
7474
- name: Install dependencies with expected TYPO3 version
7575
run: |-
7676
composer remove --dev ssch/typo3-rector \
77-
&& composer require typo3/cms-install "*" \
7877
&& composer install --no-progress --no-ansi --no-interaction
7978
80-
- name: Code Quality (by PHPStan)
81-
run: vendor/bin/phpstan analyse -c Build/phpstan.neon
79+
- name: Build codeception tester
80+
run: .build/bin/codecept build
8281

82+
- name: Code Quality (by PHPStan)
83+
run: ./.build/bin/phpstan analyse -c Build/phpstan.neon
84+
8385
test-unit-and-functional:
8486
runs-on: ubuntu-latest
8587
needs:

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,5 @@ Documentation/_make
1010
.DS_Store
1111
.idea
1212

13-
var/
14-
vendor/
15-
1613
phpunit.coverage.xml
1714
phpunit.report.xml

Build/UnitTests.xml

Lines changed: 0 additions & 30 deletions
This file was deleted.

Build/phpmd-ruleset.xml

Lines changed: 0 additions & 40 deletions
This file was deleted.

Build/phpstan-baseline.neon

Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Cannot call method getFrontendUserGroup\(\) on object\|null\.$#'
5+
identifier: method.nonObject
6+
count: 2
7+
path: ../Classes/Domain/Model/Book.php
8+
9+
-
10+
message: '#^Cannot call method getPrice\(\) on object\|null\.$#'
11+
identifier: method.nonObject
12+
count: 2
13+
path: ../Classes/Domain/Model/Book.php
14+
15+
-
16+
message: '#^Cannot call method getUid\(\) on mixed\.$#'
17+
identifier: method.nonObject
18+
count: 1
19+
path: ../Classes/Domain/Model/Book.php
20+
21+
-
22+
message: '#^Method Extcode\\CartBooks\\Domain\\Model\\Book\:\:getBestSpecialPrice\(\) has parameter \$frontendUserGroupIds with no value type specified in iterable type array\.$#'
23+
identifier: missingType.iterableValue
24+
count: 1
25+
path: ../Classes/Domain/Model/Book.php
26+
27+
-
28+
message: '#^Method Extcode\\CartBooks\\Domain\\Model\\Book\:\:getBestSpecialPrice\(\) should return float but returns mixed\.$#'
29+
identifier: return.type
30+
count: 1
31+
path: ../Classes/Domain/Model/Book.php
32+
33+
-
34+
message: '#^Method Extcode\\CartBooks\\Domain\\Model\\Book\:\:getSpecialPrices\(\) return type with generic class TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage does not specify its types\: TEntity$#'
35+
identifier: missingType.generics
36+
count: 1
37+
path: ../Classes/Domain/Model/Book.php
38+
39+
-
40+
message: '#^Method Extcode\\CartBooks\\Domain\\Model\\Book\:\:setSpecialPrices\(\) has parameter \$specialPrices with generic class TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage but does not specify its types\: TEntity$#'
41+
identifier: missingType.generics
42+
count: 1
43+
path: ../Classes/Domain/Model/Book.php
44+
45+
-
46+
message: '#^Binary operation "\+\=" between mixed and int results in an error\.$#'
47+
identifier: assignOp.invalid
48+
count: 1
49+
path: ../Classes/EventListener/CheckProductAvailability.php
50+
51+
-
52+
message: '#^Cannot cast mixed to int\.$#'
53+
identifier: cast.int
54+
count: 4
55+
path: ../Classes/EventListener/RetrieveProductsFromRequest.php
56+
57+
-
58+
message: '#^Method Extcode\\CartBooks\\EventListener\\RetrieveProductsFromRequest\:\:checkRequestArguments\(\) has parameter \$requestArguments with no value type specified in iterable type array\.$#'
59+
identifier: missingType.iterableValue
60+
count: 1
61+
path: ../Classes/EventListener/RetrieveProductsFromRequest.php
62+
63+
-
64+
message: '#^Method Extcode\\CartBooks\\EventListener\\RetrieveProductsFromRequest\:\:checkRequestArguments\(\) return type has no value type specified in iterable type array\.$#'
65+
identifier: missingType.iterableValue
66+
count: 1
67+
path: ../Classes/EventListener/RetrieveProductsFromRequest.php
68+
69+
-
70+
message: '#^Method Extcode\\CartBooks\\EventListener\\RetrieveProductsFromRequest\:\:getCartProductFromBook\(\) has parameter \$taxClasses with no value type specified in iterable type array\.$#'
71+
identifier: missingType.iterableValue
72+
count: 1
73+
path: ../Classes/EventListener/RetrieveProductsFromRequest.php
74+
75+
-
76+
message: '#^Parameter \#1 \$book of method Extcode\\CartBooks\\EventListener\\RetrieveProductsFromRequest\:\:getCartProductFromBook\(\) expects Extcode\\CartBooks\\Domain\\Model\\Book, TYPO3\\CMS\\Extbase\\DomainObject\\DomainObjectInterface\|null given\.$#'
77+
identifier: argument.type
78+
count: 1
79+
path: ../Classes/EventListener/RetrieveProductsFromRequest.php
80+
81+
-
82+
message: '#^Parameter \#2 \$productId of class Extcode\\Cart\\Domain\\Model\\Cart\\Product constructor expects int, int\<1, max\>\|null given\.$#'
83+
identifier: argument.type
84+
count: 1
85+
path: ../Classes/EventListener/RetrieveProductsFromRequest.php
86+
87+
-
88+
message: '#^Parameter \#6 \$taxClass of class Extcode\\Cart\\Domain\\Model\\Cart\\Product constructor expects Extcode\\Cart\\Domain\\Model\\Cart\\TaxClass, mixed given\.$#'
89+
identifier: argument.type
90+
count: 1
91+
path: ../Classes/EventListener/RetrieveProductsFromRequest.php
92+
93+
-
94+
message: '#^Cannot access offset ''cart'' on mixed\.$#'
95+
identifier: offsetAccess.nonOffsetAccessible
96+
count: 2
97+
path: ../Classes/EventListener/View/ModifyView.php
98+
99+
-
100+
message: '#^Cannot access offset ''pid'' on mixed\.$#'
101+
identifier: offsetAccess.nonOffsetAccessible
102+
count: 2
103+
path: ../Classes/EventListener/View/ModifyView.php
104+
105+
-
106+
message: '#^Parameter \#1 \$key of method Extcode\\Cart\\Service\\SessionHandler\:\:restoreCart\(\) expects string, mixed given\.$#'
107+
identifier: argument.type
108+
count: 1
109+
path: ../Classes/EventListener/View/ModifyView.php
110+
111+
-
112+
message: '#^Parameter \#1 \$key of method Extcode\\Cart\\Service\\SessionHandler\:\:writeCart\(\) expects string, mixed given\.$#'
113+
identifier: argument.type
114+
count: 1
115+
path: ../Classes/EventListener/View/ModifyView.php
116+
117+
-
118+
message: '#^Property Extcode\\CartBooks\\EventListener\\View\\ModifyView\:\:\$cartConfiguration type has no value type specified in iterable type array\.$#'
119+
identifier: missingType.iterableValue
120+
count: 1
121+
path: ../Classes/EventListener/View/ModifyView.php
122+
123+
-
124+
message: '#^Cannot call method getAuthor\(\) on mixed\.$#'
125+
identifier: method.nonObject
126+
count: 1
127+
path: ../Classes/ViewHelpers/SchemaViewHelper.php
128+
129+
-
130+
message: '#^Cannot call method getPrice\(\) on mixed\.$#'
131+
identifier: method.nonObject
132+
count: 1
133+
path: ../Classes/ViewHelpers/SchemaViewHelper.php
134+
135+
-
136+
message: '#^Cannot call method getTitle\(\) on mixed\.$#'
137+
identifier: method.nonObject
138+
count: 1
139+
path: ../Classes/ViewHelpers/SchemaViewHelper.php
140+
141+
-
142+
message: '#^Method Extcode\\CartBooks\\ViewHelpers\\SchemaViewHelper\:\:render\(\) should return string but returns string\|false\.$#'
143+
identifier: return.type
144+
count: 1
145+
path: ../Classes/ViewHelpers/SchemaViewHelper.php
146+
147+
-
148+
message: '#^Cannot access an offset on mixed\.$#'
149+
identifier: offsetAccess.nonOffsetAccessible
150+
count: 1
151+
path: ../Configuration/TCA/Overrides/tx_cart_domain_model_order_product.php
152+
153+
-
154+
message: '#^Cannot access offset ''columns'' on mixed\.$#'
155+
identifier: offsetAccess.nonOffsetAccessible
156+
count: 1
157+
path: ../Configuration/TCA/Overrides/tx_cart_domain_model_order_product.php
158+
159+
-
160+
message: '#^Cannot access offset ''config'' on mixed\.$#'
161+
identifier: offsetAccess.nonOffsetAccessible
162+
count: 1
163+
path: ../Configuration/TCA/Overrides/tx_cart_domain_model_order_product.php
164+
165+
-
166+
message: '#^Cannot access offset ''items'' on mixed\.$#'
167+
identifier: offsetAccess.nonOffsetAccessible
168+
count: 1
169+
path: ../Configuration/TCA/Overrides/tx_cart_domain_model_order_product.php
170+
171+
-
172+
message: '#^Cannot access offset ''product_type'' on mixed\.$#'
173+
identifier: offsetAccess.nonOffsetAccessible
174+
count: 1
175+
path: ../Configuration/TCA/Overrides/tx_cart_domain_model_order_product.php
176+
177+
-
178+
message: '#^Cannot access offset ''tx_cart_domain_model_order_product'' on mixed\.$#'
179+
identifier: offsetAccess.nonOffsetAccessible
180+
count: 1
181+
path: ../Configuration/TCA/Overrides/tx_cart_domain_model_order_product.php
182+
183+
-
184+
message: '#^Parameter \#1 \$dataSet of method Codappix\\Typo3PhpDatasets\\PhpDataSet\:\:import\(\) expects array\<string, array\<array\<string, string\>\>\>, mixed given\.$#'
185+
identifier: argument.type
186+
count: 1
187+
path: ../Tests/Acceptance/Support/Environment.php
188+
189+
-
190+
message: '#^Property Extcode\\CartBooks\\Tests\\Acceptance\\Support\\Environment\:\:\$localConfig type has no value type specified in iterable type array\.$#'
191+
identifier: missingType.iterableValue
192+
count: 1
193+
path: ../Tests/Acceptance/Support/Environment.php
194+
195+
-
196+
message: '#^Cannot access offset ''cart_books'' on mixed\.$#'
197+
identifier: offsetAccess.nonOffsetAccessible
198+
count: 1
199+
path: ../ext_emconf.php
200+
201+
-
202+
message: '#^Cannot access an offset on mixed\.$#'
203+
identifier: offsetAccess.nonOffsetAccessible
204+
count: 1
205+
path: ../ext_localconf.php
206+
207+
-
208+
message: '#^Cannot access offset ''SYS'' on mixed\.$#'
209+
identifier: offsetAccess.nonOffsetAccessible
210+
count: 1
211+
path: ../ext_localconf.php
212+
213+
-
214+
message: '#^Cannot access offset ''cartbooks'' on mixed\.$#'
215+
identifier: offsetAccess.nonOffsetAccessible
216+
count: 1
217+
path: ../ext_localconf.php
218+
219+
-
220+
message: '#^Cannot access offset ''fluid'' on mixed\.$#'
221+
identifier: offsetAccess.nonOffsetAccessible
222+
count: 1
223+
path: ../ext_localconf.php
224+
225+
-
226+
message: '#^Cannot access offset ''namespaces'' on mixed\.$#'
227+
identifier: offsetAccess.nonOffsetAccessible
228+
count: 1
229+
path: ../ext_localconf.php

Build/phpstan.neon

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,38 @@
1+
includes:
2+
- 'phpstan-baseline.neon'
3+
14
parameters:
2-
level: 4
5+
level: 'max'
6+
37
paths:
48
- ../Classes
59
- ../Configuration
610
- ../Tests
711
- ../ext_emconf.php
812
- ../ext_localconf.php
913
excludePaths:
10-
- ../Tests/Acceptance
14+
- '../Tests/Acceptance/Support/_generated/TesterActions.php'
15+
16+
disallowedFunctionCalls:
17+
-
18+
function:
19+
- 'var_dump()'
20+
- 'xdebug_break()'
21+
message: 'Do not add debugging'
22+
-
23+
function: 'header()'
24+
message: 'Use API instead'
25+
26+
disallowedStaticCalls:
27+
-
28+
method: 'TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump()'
29+
message: 'Do not add debugging'
30+
31+
disallowedSuperglobals:
32+
-
33+
superglobal:
34+
- '$_GET'
35+
- '$_POST'
36+
- '$_FILES'
37+
- '$_SERVER'
38+
message: 'Use API instead'

0 commit comments

Comments
 (0)