Skip to content

Commit f9bc5f5

Browse files
authored
Merge pull request #56 from localheinz/feature/readme
Enhancement: Further improve README.md
2 parents 1c45c48 + 9fbfadd commit f9bc5f5

File tree

2 files changed

+54
-19
lines changed

2 files changed

+54
-19
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## Unreleased
88

9-
For a full diff see [`0.4.0...master`](https://github.com/localheinz/phpstan-rules/compare/0.4.0...master).
9+
For a full diff see [`0.4.0...master`](https://github.com/localheinz/phpstan-rules/compare/0.5.0...master).
10+
11+
## [`0.5.0`](https://github.com/localheinz/phpstan-rules/releases/tag/0.5.0)
12+
13+
For a full diff see [`0.4.0...0.5.0`](https://github.com/localheinz/phpstan-rules/compare/0.4.0...0.5.0).
1014

1115
### Added
1216

README.md

Lines changed: 49 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,22 @@ This package provides the following rules for use with [`phpstan/phpstan`](https
4646
* [`Localheinz\PHPStan\Rules\Methods\NoParameterWithNullableTypeDeclarationRule`](https://github.com/localheinz/phpstan-rules#methodsnoparameterwithnullabletypedeclarationrule)
4747
* [`Localheinz\PHPStan\Rules\Methods\NoParameterWithNullDefaultValueRule`](https://github.com/localheinz/phpstan-rules#methodsnoparameterwithnulldefaultvaluerule)
4848

49-
### `Classes\FinalRule`
49+
### Classes
50+
51+
#### `Classes\FinalRule`
5052

5153
This rule reports an error when a non-anonymous class is not `final`.
5254

53-
#### Allowing `abstract` classes
55+
##### Disallowing `abstract` classes
5456

55-
If you also want to disallow `abstract` classes, you can set the `allowAbstractClasses` parameter to `false`:
57+
This rule allows to declare `abstract` classes. If you want to disallow `abstract` classes, you can set the `allowAbstractClasses` parameter to `false`:
5658

5759
```neon
5860
parameters:
5961
allowAbstractClasses: false
6062
```
6163

62-
#### Excluding classes from inspection
64+
##### Excluding classes from inspection
6365

6466
If you want to exclude classes from being inspected by this rule, you can set the `classesNotRequiredToBeAbstractOrFinal` to a list of class names:
6567

@@ -70,45 +72,74 @@ parameters:
7072
- Bar\Baz\NeitherAbstractNorFinal
7173
```
7274

73-
### `Closures\NoNullableReturnTypeDeclarationRule`
75+
### Closures
76+
77+
#### `Closures\NoNullableReturnTypeDeclarationRule`
7478

7579
This rule reports an error when a closure uses a nullable return type declaration.
7680

77-
### `Closures\NoParameterWithNullableTypeDeclarationRule`
81+
#### `Closures\NoParameterWithNullableTypeDeclarationRule`
7882

7983
This rule reports an error when a closure has a parameter with a nullable type declaration.
8084

81-
### `Closures\NoParameterWithNullDefaultValueRule`
85+
#### `Closures\NoParameterWithNullDefaultValueRule`
8286

8387
This rule reports an error when a closure has a parameter with `null` as default value.
8488

85-
### `Functions\NoNullableReturnTypeDeclarationRule`
89+
### Functions
90+
91+
#### `Functions\NoNullableReturnTypeDeclarationRule`
8692

8793
This rule reports an error when a function uses a nullable return type declaration.
8894

89-
### `Functions\NoParameterWithNullableTypeDeclarationRule`
95+
#### `Functions\NoParameterWithNullableTypeDeclarationRule`
9096

9197
This rule reports an error when a function has a parameter with a nullable type declaration.
9298

93-
### `Functions\NoParameterWithNullDefaultValueRule`
99+
#### `Functions\NoParameterWithNullDefaultValueRule`
94100

95101
This rule reports an error when a function has a parameter with `null` as default value.
96102

97-
### `Methods\NoConstructorParameterWithDefaultValueRule`
103+
### Methods
104+
105+
#### `Methods\NoConstructorParameterWithDefaultValueRule`
106+
107+
This rule reports an error when a constructor declared in
108+
109+
* an anonymous class
110+
* a class
111+
112+
has a default value.
113+
114+
#### `Methods\NoNullableReturnTypeDeclarationRule`
115+
116+
This rule reports an error when a method declared in
117+
118+
* an anonymous class
119+
* a class
120+
* an interface
121+
122+
uses a nullable return type declaration.
123+
124+
#### `Methods\NoParameterWithNullableTypeDeclarationRule`
98125

99-
This rule reports an error when a constructor declared in an anonymous class or a class has a default value.
126+
This rule reports an error when a method declared in
100127

101-
### `Methods\NoNullableReturnTypeDeclarationRule`
128+
* an anonymous class
129+
* a class
130+
* an interface
102131

103-
This rule reports an error when a method declared in an anonymous class, a class, or an interface uses a nullable return type declaration.
132+
has a parameter with a nullable type declaration.
104133

105-
### `Methods\NoParameterWithNullableTypeDeclarationRule`
134+
#### `Methods\NoParameterWithNullDefaultValueRule`
106135

107-
This rule reports an error when a method declared in an anonymous class, a class, or an interface has a parameter with a nullable type declaration.
136+
This rule reports an error when a method declared in
108137

109-
### `Methods\NoParameterWithNullDefaultValueRule`
138+
* an anonymous class
139+
* a class
140+
* an interface
110141

111-
This rule reports an error when a method declared in an anonymous class, a class, or an interface has a parameter with `null` as default value.
142+
has a parameter with `null` as default value.
112143

113144
## Changelog
114145

0 commit comments

Comments
 (0)