diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index dcc5b536..a77f1b04 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -23,6 +23,7 @@ jobs: - "7.4" - "8.0" - "8.1" + - "8.2" dependencies: - "highest" steps: @@ -60,6 +61,7 @@ jobs: - "7.4" - "8.0" - "8.1" + - "8.2" dependencies: - "highest" steps: @@ -95,6 +97,7 @@ jobs: - "7.4" - "8.0" - "8.1" + - "8.2" dependencies: - "highest" steps: @@ -132,6 +135,7 @@ jobs: - "7.4" - "8.0" - "8.1" + - "8.2" dependencies: - "highest" steps: diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4d0d1d29..6c4ce424 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,6 +1,9 @@ # Changelog All notable changes to this project will be documented in this file. +## 0.10.15 +* Add `shouldNotBeReadonly` assertion. + ## 0.10.14 * Add `shouldInclude()` and `shouldNotInclude` assertions. * Detect catch blocks in dependency assertions. diff --git a/src/Rule/Assertion/Declaration/ShouldNotBeReadonly/IsReadonlyRule.php b/src/Rule/Assertion/Declaration/ShouldNotBeReadonly/IsReadonlyRule.php new file mode 100644 index 00000000..a20fd796 --- /dev/null +++ b/src/Rule/Assertion/Declaration/ShouldNotBeReadonly/IsReadonlyRule.php @@ -0,0 +1,15 @@ + + */ +final class IsReadonlyRule extends ShouldNotBeReadonly implements Rule +{ + use ReadonlyExtractor; +} diff --git a/src/Rule/Assertion/Declaration/ShouldNotBeReadonly/ShouldNotBeReadonly.php b/src/Rule/Assertion/Declaration/ShouldNotBeReadonly/ShouldNotBeReadonly.php new file mode 100644 index 00000000..5507d177 --- /dev/null +++ b/src/Rule/Assertion/Declaration/ShouldNotBeReadonly/ShouldNotBeReadonly.php @@ -0,0 +1,49 @@ + $tips + * @return array + */ + protected function applyValidation(string $ruleName, ClassReflection $subject, bool $meetsDeclaration, array $tips, array $params = []): array + { + return $this->applyShouldNot($ruleName, $subject, $meetsDeclaration, $tips, $params); + } + + protected function getMessage(string $ruleName, string $subject, array $params = []): string + { + return $this->prepareMessage( + $ruleName, + sprintf('%s should not be readonly', $subject) + ); + } +}