Passed
Pull Request — master (#357)
by Valentin
06:06 queued 01:39
created
src/Prototype/src/Injector.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -47,7 +47,8 @@  discard block
 block discarded – undo
47 47
      */
48 48
     public function __construct(Lexer $lexer = null, PrettyPrinterAbstract $printer = null)
49 49
     {
50
-        if ($lexer === null) {
50
+        if ($lexer === null)
51
+        {
51 52
             $lexer = new Lexer\Emulative([
52 53
                 'usedAttributes' => [
53 54
                     'comments',
@@ -86,8 +87,10 @@  discard block
 block discarded – undo
86 87
         bool $useTypedProperties = false,
87 88
         bool $noPhpDoc = false
88 89
     ): string {
89
-        if (empty($node->dependencies)) {
90
-            if ($removeTrait) {
90
+        if (empty($node->dependencies))
91
+        {
92
+            if ($removeTrait)
93
+            {
91 94
                 $tr = new NodeTraverser();
92 95
                 $tr->addVisitor(new RemoveUse());
93 96
                 $tr->addVisitor(new RemoveTrait());
@@ -101,7 +104,8 @@  discard block
 block discarded – undo
101 104
         $tr = new NodeTraverser();
102 105
         $tr->addVisitor(new AddUse($node));
103 106
 
104
-        if ($removeTrait) {
107
+        if ($removeTrait)
108
+        {
105 109
             $tr->addVisitor(new RemoveUse());
106 110
             $tr->addVisitor(new RemoveTrait());
107 111
         }
Please login to merge, or discard this patch.
src/Prototype/tests/BackwardCompatibilityTrait.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,7 +19,8 @@  discard block
 block discarded – undo
19 19
      */
20 20
     public static function assertRegExp(string $pattern, string $string, string $message = ''): void
21 21
     {
22
-        if (\method_exists(Assert::class, 'assertMatchesRegularExpression')) {
22
+        if (\method_exists(Assert::class, 'assertMatchesRegularExpression'))
23
+        {
23 24
             Assert::assertMatchesRegularExpression($pattern, $string, $message);
24 25
 
25 26
             return;
@@ -35,7 +36,8 @@  discard block
 block discarded – undo
35 36
      */
36 37
     public static function assertNotRegExp(string $pattern, string $string, string $message = ''): void
37 38
     {
38
-        if (\method_exists(Assert::class, 'assertDoesNotMatchRegularExpression')) {
39
+        if (\method_exists(Assert::class, 'assertDoesNotMatchRegularExpression'))
40
+        {
39 41
             Assert::assertDoesNotMatchRegularExpression($pattern, $string, $message);
40 42
 
41 43
             return;
Please login to merge, or discard this patch.
src/Prototype/tests/InjectorTest.php 1 patch
Braces   +12 added lines, -5 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@  discard block
 block discarded – undo
27 27
 
28 28
     public function setUp(): void
29 29
     {
30
-        if ((string)ini_get('zend.assertions') === 1) {
30
+        if ((string)ini_get('zend.assertions') === 1)
31
+        {
31 32
             ini_set('zend.assertions', 0);
32 33
         }
33 34
     }
@@ -75,15 +76,21 @@  discard block
 block discarded – undo
75 76
             $noPhpDoc
76 77
         );
77 78
 
78
-        if ($expectedTypedProperty) {
79
+        if ($expectedTypedProperty)
80
+        {
79 81
             $this->assertStringContainsString('private TestClass $testClass;', $printed);
80
-        } else {
82
+        }
83
+        else
84
+        {
81 85
             $this->assertStringNotContainsString('private TestClass $testClass;', $printed);
82 86
         }
83 87
 
84
-        if ($expectedPhpDoc) {
88
+        if ($expectedPhpDoc)
89
+        {
85 90
             $this->assertRegExp('/@var TestClass[\s|\r\n]/', $printed);
86
-        } else {
91
+        }
92
+        else
93
+        {
87 94
             $this->assertNotRegExp('/@var TestClass[\s|\r\n]/', $printed);
88 95
         }
89 96
     }
Please login to merge, or discard this patch.
src/Prototype/src/NodeVisitors/AddProperty.php 1 patch
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -46,12 +46,14 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function leaveNode(Node $node)
48 48
     {
49
-        if (!$node instanceof Node\Stmt\Class_) {
49
+        if (!$node instanceof Node\Stmt\Class_)
50
+        {
50 51
             return null;
51 52
         }
52 53
 
53 54
         $nodes = [];
54
-        foreach ($this->definition->dependencies as $dependency) {
55
+        foreach ($this->definition->dependencies as $dependency)
56
+        {
55 57
             $nodes[] = $this->buildProperty($dependency);
56 58
         }
57 59
 
@@ -67,8 +69,10 @@  discard block
 block discarded – undo
67 69
      */
68 70
     private function definePlacementID(Node\Stmt\Class_ $node): int
69 71
     {
70
-        foreach ($node->stmts as $index => $child) {
71
-            if ($child instanceof Node\Stmt\ClassMethod || $child instanceof Node\Stmt\Property) {
72
+        foreach ($node->stmts as $index => $child)
73
+        {
74
+            if ($child instanceof Node\Stmt\ClassMethod || $child instanceof Node\Stmt\Property)
75
+            {
72 76
                 return $index;
73 77
             }
74 78
         }
@@ -85,11 +89,13 @@  discard block
 block discarded – undo
85 89
         $b = new Property($dependency->property);
86 90
         $b->makePrivate();
87 91
 
88
-        if ($this->useTypedProperty()) {
92
+        if ($this->useTypedProperty())
93
+        {
89 94
             $b->setType($this->getPropertyType($dependency));
90 95
         }
91 96
 
92
-        if ($this->renderDoc()) {
97
+        if ($this->renderDoc())
98
+        {
93 99
             $b->setDocComment(new Doc(sprintf('/** @var %s */', $this->getPropertyType($dependency))));
94 100
         }
95 101
 
@@ -112,8 +118,10 @@  discard block
 block discarded – undo
112 118
      */
113 119
     private function getPropertyType(Dependency $dependency): string
114 120
     {
115
-        foreach ($this->definition->getStmts() as $stmt) {
116
-            if (($stmt->name === $dependency->type->fullName) && $stmt->alias) {
121
+        foreach ($this->definition->getStmts() as $stmt)
122
+        {
123
+            if (($stmt->name === $dependency->type->fullName) && $stmt->alias)
124
+            {
117 125
                 return $stmt->alias;
118 126
             }
119 127
         }
Please login to merge, or discard this patch.