coding-standard icon indicating copy to clipboard operation
coding-standard copied to clipboard

The coding standard of the Doctrine project.

Results 19 coding-standard issues
Sort by recently updated
recently updated
newest added

I need to add more tests and to update the patches, but let's first examine together what happens on existing code and what to do about that.

# Remove CS checks for missing traversable type hints I propose to disable these sniffs as we have and already adopted tools that are more capable to check for such...

Not sure if this was on purpose. This rules is intent to throw a warning and not an error.

# Squiz.WhiteSpace.CastSpacing This is included in PSR-12. ```bash vendor/bin/phpcs --standard=PSR12 -e Squiz (15 sniffs) ----------------- Squiz.Classes.ValidClassName Squiz.ControlStructures.ControlSignature Squiz.ControlStructures.ForEachLoopDeclaration Squiz.ControlStructures.ForLoopDeclaration Squiz.ControlStructures.LowercaseDeclaration Squiz.Functions.FunctionDeclaration Squiz.Functions.FunctionDeclarationArgumentSpacing Squiz.Functions.LowercaseFunctionKeywords Squiz.Functions.MultiLineFunctionDeclaration Squiz.Scope.MethodScope Squiz.WhiteSpace.CastSpacing Squiz.WhiteSpace.ControlStructureSpacing Squiz.WhiteSpace.ScopeClosingBrace Squiz.WhiteSpace.ScopeKeywordSpacing Squiz.WhiteSpace.SuperfluousWhitespace...

I have the following method ``` public function foo(Collection $collection) { $collection->add($this->bar); $collection->add($this->bar); if ($collection instanceof BOOM) { $collection->add($this->some) } } ``` which reports an error because I didn't use...

While working on applying this standard on `doctrine/orm`, we found with @SenseException that the following will not raise any error: ```php // declarations class Foo { /** @var int */...

I've started to create sniffs for exception naming as described in the readme: `Abstract exception class names and exception interface names should be suffixed with Exception`. This PR isn't a...

New sniff

This was changed to zero here: https://github.com/doctrine/coding-standard/pull/163 But this is the default so no need for the override: https://github.com/slevomat/coding-standard/blob/c4e287879af90a2f56b1b516deaba707858c9a24/SlevomatCodingStandard/Sniffs/TypeHints/ReturnTypeHintSpacingSniff.php#L35

Isn't this already checked by slevomat? Does the one cover cases that the other does not? Then if yes.. shouldn't the `PSR12.Properties.ConstantVisibility` be turned to an `error`.. because currently it...