Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BlankLineBeforeReturn should not sniff one-line returns #131

Open
soullivaneuh opened this issue Feb 17, 2018 · 1 comment
Open

BlankLineBeforeReturn should not sniff one-line returns #131

soullivaneuh opened this issue Feb 17, 2018 · 1 comment

Comments

@soullivaneuh
Copy link
Contributor

The fixed is producing this kind of 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
         }
 
         $node->validate()
-            ->ifTrue(static function (array $services) { return 0 === \count($services); })
+            ->ifTrue(static function (array $services) {
+                return 0 === \count($services); })
             ->thenInvalid('You must enable at least one service.')
         ;
 
@@ -87,7 +88,8 @@ final class RepositoryConfiguration implements ConfigurationInterface
                     ->beforeNormalization()->castToArray()->end()
                     ->scalarPrototype()
                         ->validate()
-                        ->ifTrue(static function ($path) { return !\is_string($path); })
+                        ->ifTrue(static function ($path) {
+                            return !\is_string($path); })
                             ->thenInvalid("Invalid path '%s'. It must be a string.")
                         ->end()
                     ->end()
@@ -100,7 +102,8 @@ final class RepositoryConfiguration implements ConfigurationInterface
                 ->scalarNode('path')
                     ->defaultValue('.')
                     ->validate()
-                    ->ifTrue(static function ($path) { return !\is_string($path); })
+                    ->ifTrue(static function ($path) {
+                        return !\is_string($path); })
                         ->thenInvalid("Invalid path '%s'. It must be a string.")
                     ->end()
                 ->end()

Single line closure should not be fixed like that, it's out Symfony coding standard AFAIK. BTW, php-cs-fixer ignores this part.

@soullivaneuh
Copy link
Contributor Author

Maybe related to #122. Is the name of the rule changed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant