Symfony-coding-standard
Symfony-coding-standard copied to clipboard
Development repository for the Symfony coding standard
did a quick compare between current sniffs and symfony's current standards and noticed the following new rules (which i'll try to provide a sniff for next weekend): #### Structure: -...
The Symfony coding strandard [documentation](http://symfony.com/doc/current/contributing/code/standards.html#documentation) states: > Add PHPDoc blocks for all classes, methods, and functions (**though you may be asked to remove PHPDoc that do not add value**); For...
After PHPStorm update from 2020.1 to 2020.2 every file now has "Please trim any trailing whitespace" warning: https://i.imgur.com/ZzNOpb9.png If I run Code Beautifier - nothing changes in file but the...
```php switch ($a) { case 'a': switch ($b) { case 'b': return 'c'; } break; } ``` The sniff is triggered on the return, but I think it shouldn't be,...
The `Commenting\AnnotationsSniff` currently doesn't like: ```php /** * @expectedException \Exception * @expectedExceptionMessage Don't do it. */ public function testThing() {} ``` But I don't think this looks right: ```php /**...
The fixed is producing this kind of diff: ```diff diff --git a/src/Config/RepositoryConfiguration.php b/src/Config/RepositoryConfiguration.php index a4c735b..eb7ebce 100644 --- a/src/Config/RepositoryConfiguration.php +++ b/src/Config/RepositoryConfiguration.php @@ -63,7 +63,8 @@ final class RepositoryConfiguration implements ConfigurationInterface }...
`PSR2` imports `Squiz.WhiteSpace.ScopeClosingBrace`. `Zend` imports `PEAR.WhiteSpace.ScopeClosingBrace`. It's hard to tell which one is better. I'm leaning towards keeping the one in PSR over Zend though.
This gives an error: ```php $arr = []; $func = function ($item) { return $item['foo']; }; ``` This works fine: ```php $arr = []; $func = function ($item) { return...
With this header added to PHP files: ```php
PSR-12 sniff, `PSR12.Classes.AnonClassDeclaration.SpaceAfterKeyword` rejects `new class()` with: _Expected 1 space after class keyword; 0 found._ However, `Symfony.Objects.ObjectInstantiation.Invalid` rejects `new class ()` with: _Use parentheses when instantiating classes_. It seems to...