Skip to content

Commit e62cf84

Browse files
authored
Relax php constraint to allow PHP 8 (#137)
* Relax php constraint to allow PHP 8 * Run tests against PHP 8.0 * Allow installing PHPUnit 9 PHPUnit has very narrow range of supported php version. PHPUnit 7 is still needed and used for php <7.3. * Update slevomat/coding-standard
1 parent d051f2a commit e62cf84

File tree

3 files changed

+34
-10
lines changed

3 files changed

+34
-10
lines changed

.github/workflows/tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ jobs:
1212
- "7.2"
1313
- "7.3"
1414
- "7.4"
15+
- "8.0"
1516

1617
steps:
1718
- name: "Checkout"

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
}
1818
},
1919
"require": {
20-
"php": "^7.1",
20+
"php": ">=7.1",
2121
"nikic/php-parser": "^4.4",
2222
"phpstan/phpstan": "^0.12.26"
2323
},
@@ -28,8 +28,8 @@
2828
"phpstan/phpstan-nette": "^0.12.0",
2929
"phpstan/phpstan-phpunit": "^0.12.0",
3030
"phpstan/phpstan-strict-rules": "^0.12.0",
31-
"phpunit/phpunit": "^7.5.6",
32-
"slevomat/coding-standard": "^5.0.4",
31+
"phpunit/phpunit": "^7.5.6 || ^9.4.2",
32+
"slevomat/coding-standard": "^6.4.1",
3333
"squizlabs/php_codesniffer": "~3.5.2"
3434
},
3535
"autoload": {

phpcs.xml

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,14 @@
199199
value="@author,@created,@version,@package,@copyright,@license,@see,@since,@link"/>
200200
</properties>
201201
</rule>
202+
<rule ref="SlevomatCodingStandard.Commenting.UselessFunctionDocComment">
203+
<properties>
204+
<property name="traversableTypeHints" type="array">
205+
<element value="Generator"/>
206+
<element value="Traversable"/>
207+
</property>
208+
</properties>
209+
</rule>
202210
<rule ref="SlevomatCodingStandard.ControlStructures.AssignmentInCondition"/>
203211
<rule ref="SlevomatCodingStandard.ControlStructures.LanguageConstructWithParentheses"/>
204212
<rule ref="SlevomatCodingStandard.ControlStructures.DisallowYodaComparison"/>
@@ -253,14 +261,29 @@
253261
</properties>
254262
</rule>
255263
<rule ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue" />
256-
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration">
264+
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint">
265+
<properties>
266+
<property name="traversableTypeHints" type="array">
267+
<element value="Generator"/>
268+
<element value="Traversable"/>
269+
</property>
270+
</properties>
271+
</rule>
272+
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
273+
<properties>
274+
<property name="traversableTypeHints" type="array">
275+
<element value="Generator"/>
276+
<element value="Traversable"/>
277+
</property>
278+
<property name="enableNativeTypeHint" value="false"/>
279+
</properties>
280+
</rule>
281+
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint">
257282
<properties>
258-
<property name="traversableTypeHints" type="array" value="
259-
Generator,
260-
Traversable,
261-
"/>
262-
<property name="enableEachParameterAndReturnInspection" value="1" />
263-
<property name="allAnnotationsAreUseful" value="1" />
283+
<property name="traversableTypeHints" type="array">
284+
<element value="Generator"/>
285+
<element value="Traversable"/>
286+
</property>
264287
</properties>
265288
</rule>
266289
<rule ref="SlevomatCodingStandard.TypeHints.LongTypeHints"/>

0 commit comments

Comments
 (0)