Skip to content

Commit ce4cf54

Browse files
committed
Readme cleanup
1 parent de4f1fd commit ce4cf54

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

README.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,16 @@ Slevomat Coding Standard for [PHP_CodeSniffer](https://github.com/squizlabs/PHP_
3838
#### SlevomatCodingStandard.TypeHints.TypeHintDeclaration 🔧🚧
3939

4040
* Checks for missing property types in phpDoc `@var`.
41-
* Checks for missing typehints in case they can be declared natively. If the phpDoc contains something that can be written as a native PHP 7.0 or 7.1 typehint, this sniff reports that.
41+
* Checks for missing typehints in case they can be declared natively. If the phpDoc contains something that can be written as a native PHP 7.0, 7.1 or 7.2 typehint, this sniff reports that.
4242
* Checks for missing `@return` and/or native return typehint in case the method body contains `return` with a value.
4343
* Checks for useless doc comments. If the native method declaration contains everything and the phpDoc does not add anything useful, it's reported as useless and can optionally be automatically removed with `phpcbf`.
4444
* Some phpDocs might still be useful even if they do not add any typehint information. They can contain textual descriptions of code elements and also some meaningful annotations like `@expectException` or `@dataProvider`.
4545
* Forces to specify what's in traversable types like `array`, `iterable` and `\Traversable`.
46-
* Distinguishes what's possible in PHP 7.0 (scalar typehints) and PHP 7.1 (nullable types and void return typehint).
4746

4847
Sniff provides the following settings:
4948

50-
* `enableNullableTypeHints`: enforces to transform `Foo|null` in phpDoc into `?Foo` in native typehint. It's on by default if you're on PHP 7.1.
51-
* `enableVoidTypeHint`: enforces to transform `@return void` into native `void` return typehint. It's on by default if you're on PHP 7.1.
49+
* `enableNullableTypeHints`: enforces to transform `Foo|null` in phpDoc into `?Foo` in native typehint.
50+
* `enableVoidTypeHint`: enforces to transform `@return void` into native `void` return typehint.
5251
* `traversableTypeHints`: enforces which typehints must have specified contained type. E. g. if you set this to `\Doctrine\Common\Collections\Collection`, then `\Doctrine\Common\Collections\Collection` must always be supplied with the contained type: `\Doctrine\Common\Collections\Collection|Foo[]`.
5352
* `usefulAnnotations`: prevents reporting and removing useless phpDocs if they contain an additional configured annotation like `@dataProvider`.
5453
* `enableEachParameterAndReturnInspection`: enables inspection and fixing of `@param` and `@return` annotations separately. Useful when you only want to document parameters or return values that could not be expressed natively (i.e. member types of `array` or `Traversable`).
@@ -167,7 +166,7 @@ use LogStandard;
167166

168167
Sniff provides the following settings:
169168

170-
* `caseSensitive` - compare namespaces case sensitively, which makes this order correct:
169+
* `caseSensitive`: compare namespaces case sensitively, which makes this order correct:
171170

172171
```php
173172
use LogAware;
@@ -202,16 +201,16 @@ Sniff provides the following settings:
202201

203202
* `rootNamespaces` property expects configuration similar to PSR-4 - project directories mapped to certain namespaces.
204203
* `skipDirs` are not taken into consideration when comparing a path to a namespace. For example, with the above settings, file at path `app/services/Product/Product.php` is expected to contain `Slevomat\Product\Product`, not `Slevomat\services\Product\Product`.
205-
* `extensions` - allow different file extensions. Default is `php`.
206-
* `ignoredNamespaces` - sniff is not performed on these namespaces
204+
* `extensions`: allow different file extensions. Default is `php`.
205+
* `ignoredNamespaces`: sniff is not performed on these namespaces.
207206

208207
#### SlevomatCodingStandard.Classes.ClassConstantVisibility 🔧
209208

210-
In PHP 7.1 it's possible to declare [visibility of class constants](https://wiki.php.net/rfc/class_const_visibility). In a similar vein to optional declaration of visibility for properties and methods which is actually required in sane coding standards, this sniff also requires declaring visibility for all class constants.
209+
In PHP 7.1+ it's possible to declare [visibility of class constants](https://wiki.php.net/rfc/class_const_visibility). In a similar vein to optional declaration of visibility for properties and methods which is actually required in sane coding standards, this sniff also requires declaring visibility for all class constants.
211210

212211
Sniff provides the following settings:
213212

214-
* `fixable`: the sniff is not fixable by default because we think it's better to decide about each constant one by one however you can enable fixability with this option
213+
* `fixable`: the sniff is not fixable by default because we think it's better to decide about each constant one by one however you can enable fixability with this option.
215214

216215
```php
217216
const FOO = 1; // visibility missing!
@@ -228,7 +227,7 @@ function foo(): ?int
228227

229228
Sniff provides the following settings:
230229

231-
* `spacesCountBeforeColon` - the number of spaces expected between closing brace and colon
230+
* `spacesCountBeforeColon`: the number of spaces expected between closing brace and colon.
232231

233232
#### SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue 🔧
234233

@@ -301,15 +300,15 @@ All references to global constants must be referenced via a fully qualified name
301300

302301
Sniff provides the following settings:
303302

304-
* `exclude` - list of global constants that are allowed not to be referenced via FQN
303+
* `exclude`: list of global constants that are allowed not to be referenced via FQN.
305304

306305
#### SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions 🔧
307306

308307
All references to global functions must be referenced via a fully qualified name.
309308

310309
Sniff provides the following settings:
311310

312-
* `exclude` - list of global functions that are allowed not to be referenced via FQN
311+
* `exclude`: list of global functions that are allowed not to be referenced via FQN.
313312

314313
#### SlevomatCodingStandard.Namespaces.MultipleUsesPerLine
315314

@@ -351,8 +350,8 @@ Disallows uses of other than configured namespaces.
351350

352351
Sniff provides the following settings:
353352

354-
* `namespacesRequiredToUse` - namespaces in this array are the only ones allowed to be used. E. g. root project namespace.
355-
* `allowUseFromRootNamespace` - also allow using top-level namespace:
353+
* `namespacesRequiredToUse`: namespaces in this array are the only ones allowed to be used. E. g. root project namespace.
354+
* `allowUseFromRootNamespace`: also allow using top-level namespace:
356355

357356
```php
358357
use DateTimeImmutable;
@@ -372,8 +371,8 @@ Enforces one configurable number of lines after opening class/interface/trait br
372371

373372
Sniff provides the following settings:
374373

375-
* `linesCountAfterOpeningBrace`: allows to configure the number of lines after opening brace
376-
* `linesCountBeforeClosingBrace`: allows to configure the number of lines before closing brace
374+
* `linesCountAfterOpeningBrace`: allows to configure the number of lines after opening brace.
375+
* `linesCountBeforeClosingBrace`: allows to configure the number of lines before closing brace.
377376

378377
#### SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation 🔧
379378

@@ -383,14 +382,14 @@ Enforces fully qualified names of classes and interfaces in phpDocs - in `@var`,
383382

384383
Reports forbidden annotations. No annotations are forbidden by default, the configuration is completely up to the user. It's recommended to forbid obsolete and inappropriate annotations like:
385384

386-
* `@author`, `@created`, `@version` - we have version control systems
387-
* `@package` - we have namespaces
388-
* `@copyright`, `@license` - it's not necessary to repeat licensing information in each file
389-
* `@throws` - it's not possible to enforce this annotation and the information can become outdated
385+
* `@author`, `@created`, `@version`: we have version control systems.
386+
* `@package`: we have namespaces.
387+
* `@copyright`, `@license`: it's not necessary to repeat licensing information in each file.
388+
* `@throws`: it's not possible to enforce this annotation and the information can become outdated.
390389

391390
Sniff provides the following settings:
392391

393-
* `forbiddenAnnotations`: allows to configure which annotations are forbidden to be used
392+
* `forbiddenAnnotations`: allows to configure which annotations are forbidden to be used.
394393

395394
#### SlevomatCodingStandard.Commenting.InlineDocCommentDeclaration 🔧
396395

0 commit comments

Comments
 (0)