Skip to content

Commit 806cd54

Browse files
authored
Add a strict PHPCS rulset which enfores declare( strict_types=1 ) (#209)
* Add a strict PHPCS rulset which enfores declare( strict_types=1 ) * Update changelog
1 parent 65651d9 commit 806cd54

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Changed
1010
* PHP: Remove `minimum_supported_wp_version` and `testVersion`.
11+
* PHP: Introduce `Required-Strict` ruleset for stricter rules.
1112

1213
## [4.0.0] - 2022-12-08
1314

Required-Strict/ruleset.xml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Required-Strict">
3+
<description>required Strict Coding Standards</description>
4+
5+
<!-- Include everything from the default set. -->
6+
<rule ref="Required" />
7+
8+
<!-- Enforce having declare( strict_types=1 ) at the top of each PHP file. -->
9+
<rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes">
10+
<properties>
11+
<property name="declareOnFirstLine" value="false"/>
12+
<property name="linesCountBeforeDeclare" value="1"/>
13+
<property name="linesCountAfterDeclare" value="1"/>
14+
<property name="spacesCountAroundEqualsSign" value="0"/>
15+
</properties>
16+
</rule>
17+
</ruleset>

0 commit comments

Comments
 (0)