coding-standard
coding-standard copied to clipboard
Slevomat Coding Standard for PHP_CodeSniffer provides many useful sniffs
SlevomatCodingStandard.TypeHints.ClassConstantTypeHint SlevomatCodingStandard.TypeHints.PropertyTypeHint SlevomatCodingStandard.TypeHints.ParameterTypeHint >This sniff can cause an error if you're overriding parent property which does not have typehints. In such cases add @phpcsSuppress SlevomatCodingStandard.TypeHints.PropertyTypeHint.MissingNativeTypeHint annotation to the property to...
I see `SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition` for requiring `array|null` over `null|array`. I see `SlevomatCodingStandard.TypeHints.DNFTypeHintFormat` for requiring `?array` over `array|null` in PHP code (not docs).
`SlevomatCodingStandard.Functions.StaticClosure` does not provide a setting to toggle this sniff for only arrow functions or traditional `function` closure syntax. While declaring traditional closures static *might* be a best practice, the...