Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased](https://github.com/orisai/coding-standard-php/compare/3.11.0...v3.x)

### Added

- Support for PHP 8.5 and 8.6

## [3.11.0](https://github.com/orisai/coding-standard-php/compare/3.10.3...3.11.0) - 2025-04-07

### Added
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}
],
"require": {
"php": "7.4 - 8.4",
"php": "7.4 - 8.6",
"dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0",
"slevomat/coding-standard": "^8.16.0",
"squizlabs/php_codesniffer": "^3.12.0"
Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ and [Slevomat Coding Standard](https://github.com/slevomat/coding-standard) rule
</ruleset>
```
4. Replace `<VERSION>` with minimal php version you want to support
- supported are `7.4`, `8.0`, `8.1`, `8.2`, `8.3`, `8.4`
- supported are `7.4`, `8.0`, `8.1`, `8.2`, `8.3`, `8.4`, `8.5`, `8.6`
5. Replace `<NAMESPACE>` with your root namespace
- by default expected code directory is `src` and tests directory is `tests` with `Tests` namespace prefix
6. Create directory for temp files
Expand Down
60 changes: 60 additions & 0 deletions src/ruleset-8.5.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
<ruleset
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./../vendor/squizlabs/php_codesniffer/phpcs.xsd">
<!-- Configure ruleset -->
<config name="php_version" value="80500"/>

<!-- Import base -->
<rule ref="./ruleset-base.xml"/>

<!-- Version-specific rules -->
<!-- - since 7.3 -->
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/>
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall">
<properties>
<property name="onlySingleLine" value="true"/>
</properties>
</rule>
<!-- - since 7.4 -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator"/>
<rule ref="SlevomatCodingStandard.Functions.RequireArrowFunction"/>
<rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration">
<properties>
<property name="allowMultiLine" value="true"/>
<property name="spacesCountAfterKeyword" value="1"/>
<property name="spacesCountBeforeArrow" value="1"/>
<property name="spacesCountAfterArrow" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator"/>
<!-- - since 8.0 -->
<rule ref="SlevomatCodingStandard.Attributes.AttributeAndTargetSpacing"/>
<rule ref="SlevomatCodingStandard.Attributes.DisallowAttributesJoining"/>
<rule ref="SlevomatCodingStandard.Attributes.DisallowMultipleAttributesPerLine"/>
<rule ref="SlevomatCodingStandard.Attributes.RequireAttributeAfterDocComment"/>
<rule ref="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion"/>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator"/>
<rule ref="SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch"/>
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration">
<properties>
<property name="onlySingleLine" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse"/>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration"/>
<rule ref="SlevomatCodingStandard.TypeHints.DNFTypeHintFormat">
<properties>
<property name="withSpacesAroundOperators" value="no"/>
<property name="withSpacesInsideParentheses" value="no"/>
<property name="shortNullable" value="no"/>
<property name="nullPosition" value="last"/>
</properties>
</rule>
<!-- - since 8.1 -->
<!-- - since 8.2 -->
<!-- - since 8.3 -->
<rule ref="SlevomatCodingStandard.TypeHints.ClassConstantTypeHint"/>
<!-- - since 8.4 -->
<!-- - since 8.5 -->

</ruleset>
61 changes: 61 additions & 0 deletions src/ruleset-8.6.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<ruleset
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./../vendor/squizlabs/php_codesniffer/phpcs.xsd">
<!-- Configure ruleset -->
<config name="php_version" value="80600"/>

<!-- Import base -->
<rule ref="./ruleset-base.xml"/>

<!-- Version-specific rules -->
<!-- - since 7.3 -->
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInCall"/>
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall">
<properties>
<property name="onlySingleLine" value="true"/>
</properties>
</rule>
<!-- - since 7.4 -->
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator"/>
<rule ref="SlevomatCodingStandard.Functions.RequireArrowFunction"/>
<rule ref="SlevomatCodingStandard.Functions.ArrowFunctionDeclaration">
<properties>
<property name="allowMultiLine" value="true"/>
<property name="spacesCountAfterKeyword" value="1"/>
<property name="spacesCountBeforeArrow" value="1"/>
<property name="spacesCountAfterArrow" value="1"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator"/>
<!-- - since 8.0 -->
<rule ref="SlevomatCodingStandard.Attributes.AttributeAndTargetSpacing"/>
<rule ref="SlevomatCodingStandard.Attributes.DisallowAttributesJoining"/>
<rule ref="SlevomatCodingStandard.Attributes.DisallowMultipleAttributesPerLine"/>
<rule ref="SlevomatCodingStandard.Attributes.RequireAttributeAfterDocComment"/>
<rule ref="SlevomatCodingStandard.Classes.RequireConstructorPropertyPromotion"/>
<rule ref="SlevomatCodingStandard.ControlStructures.RequireNullSafeObjectOperator"/>
<rule ref="SlevomatCodingStandard.Exceptions.RequireNonCapturingCatch"/>
<rule ref="SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration">
<properties>
<property name="onlySingleLine" value="true"/>
</properties>
</rule>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInClosureUse"/>
<rule ref="SlevomatCodingStandard.Functions.RequireTrailingCommaInDeclaration"/>
<rule ref="SlevomatCodingStandard.TypeHints.DNFTypeHintFormat">
<properties>
<property name="withSpacesAroundOperators" value="no"/>
<property name="withSpacesInsideParentheses" value="no"/>
<property name="shortNullable" value="no"/>
<property name="nullPosition" value="last"/>
</properties>
</rule>
<!-- - since 8.1 -->
<!-- - since 8.2 -->
<!-- - since 8.3 -->
<rule ref="SlevomatCodingStandard.TypeHints.ClassConstantTypeHint"/>
<!-- - since 8.4 -->
<!-- - since 8.5 -->
<!-- - since 8.6 -->

</ruleset>
Loading