Skip to content

Commit 64f1222

Browse files
Majkl578kukulich
authored andcommitted
README: Document recently added sniff configuration options
1 parent 09f6a88 commit 64f1222

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ const FOO = 1; // visibility missing!
192192
public const BAR = 2; // correct
193193
```
194194

195-
On PHP 7.0, this sniff must be manually excluded.
196-
197195
#### SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing 🔧
198196

199197
Enforces consistent formatting of return typehints, like this:
@@ -202,6 +200,10 @@ Enforces consistent formatting of return typehints, like this:
202200
function foo(): ?int
203201
```
204202

203+
Sniff provides the following settings:
204+
205+
* `spacesCountBeforeColon` - the number of spaces expected between closing brace and colon
206+
205207
#### SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue 🔧
206208

207209
Checks whether the nullablity `?` symbol is present before each nullable and optional parameter (which are marked as `= null`):
@@ -215,8 +217,6 @@ function foo(
215217
}
216218
```
217219

218-
On PHP 7.0, this sniff must be manually excluded.
219-
220220
#### SlevomatCodingStandard.TypeHints.ParameterTypeHintSpacing 🔧
221221

222222
* Checks that there's a single space between a typehint and a parameter name: `Foo $foo`
@@ -297,6 +297,8 @@ new Foo\Bar();
297297

298298
`allowFullyQualifiedNameForCollidingClasses` - allow fully qualified name for a class with a colliding use statement
299299

300+
`allowFullyQualifiedGlobalClasses` - allows using fully qualified names from global space (i.e. \DateTimeImmutable)
301+
300302
#### SlevomatCodingStandard.Namespaces.UseOnlyWhitelistedNamespaces
301303

302304
Disallows uses of other than configured namespaces.
@@ -338,6 +340,8 @@ Reports forbidden annotations. No annotations are forbidden by default, the conf
338340
Sniff provides the following settings:
339341

340342
* `forbiddenAnnotations`: allows to configure which annotations are forbidden to be used
343+
* `linesCountAfterOpeningBrace`: allows to configure the number of lines after opening brace
344+
* `linesCountBeforeClosingBrace`: allows to configure the number of lines before closing brace
341345

342346
## Installation
343347

0 commit comments

Comments
 (0)