Skip to content

Commit e73d062

Browse files
authored
Merge pull request #37 from localheinz/feature/rules
Enhancement: Extract rules.neon
2 parents 9b20da1 + 677a345 commit e73d062

File tree

4 files changed

+26
-11
lines changed

4 files changed

+26
-11
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
For a full diff see [`0.2.0...master`](https://github.com/localheinz/phpstan-rules/compare/0.2.0...master).
1111

12+
## [`0.3.0`](https://github.com/localheinz/phpstan-rules/releases/tag/0.3.0)
13+
14+
For a full diff see [`0.2.0...0.3.0`](https://github.com/localheinz/phpstan-rules/compare/0.2.0...0.3.0).
15+
1216
### Added
1317

1418
* added `Functions\NoNullableReturnTypeDeclarationRule`, which reports an
@@ -32,6 +36,8 @@ For a full diff see [`0.2.0...master`](https://github.com/localheinz/phpstan-rul
3236
* added `Methods\NoParameterWithNullableTypeDeclarationRule`, which reports an
3337
error when a method declared in an anonymous class, a class, or an interface
3438
has a parameter with a nullable type declaration ([#35](https://github.com/localheinz/phpstan-rules/pull/35)), by [@localheinz](https://github.com/localheinz)
39+
* extracted `rules.neon`, so you can easily enable all rules by including it
40+
in your `phpstan.neon` ([#37](https://github.com/localheinz/phpstan-rules/pull/37)), by [@localheinz](https://github.com/localheinz)
3541

3642
## [`0.2.0`](https://github.com/localheinz/phpstan-rules/releases/tag/0.2.0)
3743

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ This package provides the following rules for use with [`phpstan/phpstan`](https
3131
* [`Localheinz\PHPStan\Rules\Methods\NoParameterWithNullableTypeDeclarationRule`](https://github.com/localheinz/phpstan-rules#methodsnoparameterwithnullabletypedeclarationrule)
3232
* [`Localheinz\PHPStan\Rules\Methods\NoParameterWithNullDefaultValueRule`](https://github.com/localheinz/phpstan-rules#methodsnoparameterwithnulldefaultvaluerule)
3333

34+
:bulb: If you want to use all of these rules, include [`rules.neon`](rules.neon) in your `phpstan.neon`:
35+
36+
```neon
37+
includes:
38+
- vendor/localheinz/phpstan-rules/rules.neon
39+
```
40+
41+
You probably want to use these rules on top of [`phpstan/phpstan-strict-rules`](https://github.com/phpstan/phpstan-strict-rules).
42+
3443
### `Classes\AbstractOrFinalRule`
3544

3645
This rule reports an error when a non-anonymous class is neither `abstract` nor `final`.

phpstan.neon

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
11
includes:
22
- vendor/phpstan/phpstan-strict-rules/rules.neon
3-
4-
rules:
5-
- Localheinz\PHPStan\Rules\Classes\AbstractOrFinalRule
6-
- Localheinz\PHPStan\Rules\Closures\NoNullableReturnTypeDeclarationRule
7-
- Localheinz\PHPStan\Rules\Closures\NoParameterWithNullableTypeDeclarationRule
8-
- Localheinz\PHPStan\Rules\Functions\NoNullableReturnTypeDeclarationRule
9-
- Localheinz\PHPStan\Rules\Functions\NoParameterWithNullDefaultValueRule
10-
- Localheinz\PHPStan\Rules\Functions\NoParameterWithNullableTypeDeclarationRule
11-
- Localheinz\PHPStan\Rules\Methods\NoNullableReturnTypeDeclarationRule
12-
- Localheinz\PHPStan\Rules\Methods\NoParameterWithNullDefaultValueRule
13-
- Localheinz\PHPStan\Rules\Methods\NoParameterWithNullableTypeDeclarationRule
3+
- rules.neon

rules.neon

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
rules:
2+
- Localheinz\PHPStan\Rules\Classes\AbstractOrFinalRule
3+
- Localheinz\PHPStan\Rules\Closures\NoNullableReturnTypeDeclarationRule
4+
- Localheinz\PHPStan\Rules\Closures\NoParameterWithNullableTypeDeclarationRule
5+
- Localheinz\PHPStan\Rules\Functions\NoNullableReturnTypeDeclarationRule
6+
- Localheinz\PHPStan\Rules\Functions\NoParameterWithNullDefaultValueRule
7+
- Localheinz\PHPStan\Rules\Functions\NoParameterWithNullableTypeDeclarationRule
8+
- Localheinz\PHPStan\Rules\Methods\NoNullableReturnTypeDeclarationRule
9+
- Localheinz\PHPStan\Rules\Methods\NoParameterWithNullDefaultValueRule
10+
- Localheinz\PHPStan\Rules\Methods\NoParameterWithNullableTypeDeclarationRule

0 commit comments

Comments
 (0)