From 71497ab319c3de0467655bbc2801a1e03bd0be49 Mon Sep 17 00:00:00 2001 From: TomasVotruba Date: Thu, 3 Aug 2017 19:11:32 +0200 Subject: [PATCH] cs fixes --- composer.json | 10 +++++----- easy-coding-standard.neon | 3 +-- src/Console/Command/ReconstructCommand.php | 2 +- .../InjectAnnotationToConstructorNodeVisitor.php | 1 + .../GetterToPropertyNodeVisitor.php | 7 ++++--- .../Test.php | 1 - 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/composer.json b/composer.json index 45bd0db6e65..c889cbfc46e 100644 --- a/composer.json +++ b/composer.json @@ -17,8 +17,8 @@ "require-dev": { "phpunit/phpunit": "^6.2", "tracy/tracy": "^2.4", - "symplify/easy-coding-standard": "@dev", - "phpstan/phpstan": "^0.7" + "symplify/easy-coding-standard": "^2.2", + "phpstan/phpstan": "^0.8" }, "autoload": { "psr-4": { @@ -32,8 +32,8 @@ }, "scripts": { "all": ["phpunit", "@cs", "@ps"], - "cs": "ecs check src tests", - "fs": "ecs check src tests --fix", - "ps": "phpstan analyse src tests --level 7 --configuration phpstan.neon" + "check-cs": "ecs check bin src tests", + "fix-cs": "ecs check bin src tests --fix", + "phpstan": "phpstan analyse bin src tests --level 7 --configuration phpstan.neon" } } diff --git a/easy-coding-standard.neon b/easy-coding-standard.neon index b90bf2b0190..5e743a7a0ba 100644 --- a/easy-coding-standard.neon +++ b/easy-coding-standard.neon @@ -1,3 +1,2 @@ includes: -# todo: -# - vendor/symplify/easy-coding-standard/config/ \ No newline at end of file + - vendor/symplify/easy-coding-standard/config/psr2-checkers.neon \ No newline at end of file diff --git a/src/Console/Command/ReconstructCommand.php b/src/Console/Command/ReconstructCommand.php index 6284b10bde9..832a7a4b66b 100644 --- a/src/Console/Command/ReconstructCommand.php +++ b/src/Console/Command/ReconstructCommand.php @@ -65,4 +65,4 @@ final class ReconstructCommand extends Command return iterator_to_array($finder->getIterator()); } -} \ No newline at end of file +} diff --git a/src/NodeVisitor/DependencyInjection/InjectAnnotationToConstructorNodeVisitor.php b/src/NodeVisitor/DependencyInjection/InjectAnnotationToConstructorNodeVisitor.php index 710419938b3..ae5d4d5d353 100644 --- a/src/NodeVisitor/DependencyInjection/InjectAnnotationToConstructorNodeVisitor.php +++ b/src/NodeVisitor/DependencyInjection/InjectAnnotationToConstructorNodeVisitor.php @@ -63,6 +63,7 @@ final class InjectAnnotationToConstructorNodeVisitor extends NodeVisitorAbstract if (! $classElementStatement instanceof Property) { continue; } + $propertyNode = $classElementStatement; $propertyDocBlock = $this->createDocBlockFromProperty($propertyNode); diff --git a/src/NodeVisitor/DependencyInjection/NamedServicesToConstructor/GetterToPropertyNodeVisitor.php b/src/NodeVisitor/DependencyInjection/NamedServicesToConstructor/GetterToPropertyNodeVisitor.php index d967af595fd..b499416e974 100644 --- a/src/NodeVisitor/DependencyInjection/NamedServicesToConstructor/GetterToPropertyNodeVisitor.php +++ b/src/NodeVisitor/DependencyInjection/NamedServicesToConstructor/GetterToPropertyNodeVisitor.php @@ -160,7 +160,8 @@ final class GetterToPropertyNodeVisitor extends NodeVisitorAbstract $serviceName = $argument->value; $serviceType = $this->serviceFromKernelResolver->resolveServiceClassByNameFromKernel( - $serviceName, LocalKernel::class + $serviceName, + LocalKernel::class ); if ($serviceType === null) { @@ -173,7 +174,6 @@ final class GetterToPropertyNodeVisitor extends NodeVisitorAbstract $this->classPropertyCollector->addPropertyForClass($this->className, $serviceType, $propertyName); return $this->createPropertyFetch($propertyName); - } /** @@ -184,7 +184,8 @@ final class GetterToPropertyNodeVisitor extends NodeVisitorAbstract return new PropertyFetch( new Variable('this', [ 'name' => $propertyName - ]), $propertyName + ]), + $propertyName ); } } diff --git a/tests/NodeVisitor/DependencyInjection/InjectAnnotationToConstructorReconstructor/Test.php b/tests/NodeVisitor/DependencyInjection/InjectAnnotationToConstructorReconstructor/Test.php index f0749e4f1ed..76095660d82 100644 --- a/tests/NodeVisitor/DependencyInjection/InjectAnnotationToConstructorReconstructor/Test.php +++ b/tests/NodeVisitor/DependencyInjection/InjectAnnotationToConstructorReconstructor/Test.php @@ -14,4 +14,3 @@ final class Test extends AbstractReconstructorTestCase ); } } -