Completed
Pull Request — master (#4)
by Emily
02:10
created
src/Factory/Reflection/ReflectorFactory.php 1 patch
Spacing   +3 added lines, -5 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
63 63
      */
64 64
     protected function parseDocComment(array $acceptedParams)
65 65
     {
66
-        preg_match_all
67
-        (
66
+        preg_match_all(
68 67
               '/^'
69 68
             .     '[ \t]*\*[ \t]*'
70 69
             .     '@([a-zA-Z]+)'
@@ -81,8 +80,7 @@  discard block
 block discarded – undo
81 80
 
82 81
             if (isset($acceptedParams[$name]))
83 82
             {
84
-                call_user_func
85
-                (
83
+                call_user_func(
86 84
                     array($this, $acceptedParams[$name]),
87 85
                     $name, $value
88 86
                 );
@@ -98,7 +96,7 @@  discard block
 block discarded – undo
98 96
      */
99 97
     protected function setBool($name, $value)
100 98
     {
101
-        switch(strtolower($value))
99
+        switch (strtolower($value))
102 100
         {
103 101
             case '':
104 102
             case 'true':
Please login to merge, or discard this patch.
src/Factory/Reflection/TypeParser.php 1 patch
Spacing   +12 added lines, -17 removed lines patch added patch discarded remove patch
@@ -63,8 +63,7 @@  discard block
 block discarded – undo
63 63
                     $nullable = true;
64 64
                     break;
65 65
                 case '<':
66
-                    $stack->push($this->resolveGenericName
67
-                    (
66
+                    $stack->push($this->resolveGenericName(
68 67
                         $current,
69 68
                         $nullable,
70 69
                         $collection
@@ -72,8 +71,7 @@  discard block
 block discarded – undo
72 71
                     break;
73 72
                 case ',':
74 73
                     $stack->top()->generics[] =
75
-                        $this->resolveName
76
-                        (
74
+                        $this->resolveName(
77 75
                             $current,
78 76
                             $nullable,
79 77
                             $collection
@@ -89,8 +87,7 @@  discard block
 block discarded – undo
89 87
                 case '>':
90 88
                     $item = $stack->pop();
91 89
                     $item->generics[] =
92
-                        $this->resolveName
93
-                        (
90
+                        $this->resolveName(
94 91
                             $current,
95 92
                             $nullable,
96 93
                             $collection
@@ -132,18 +129,17 @@  discard block
 block discarded – undo
132 129
         }
133 130
         elseif ($i + 2 !== strlen($value))
134 131
         {
135
-            if (!in_array($value{$i + 2}, ['>',',']))
132
+            if (!in_array($value{$i + 2}, ['>', ',']))
136 133
             {
137 134
                 throw new \Exception('Unexpected char after collection');
138 135
             }
139 136
         }
140 137
     }
141 138
 
142
-    protected function resolveGenericName
143
-    (
144
-        string &$value,
145
-        bool &$nullable,
146
-        bool &$collection
139
+    protected function resolveGenericName(
140
+        string & $value,
141
+        bool & $nullable,
142
+        bool & $collection
147 143
     )
148 144
     {
149 145
         $type = $this->resolveName($value, $nullable, $collection);
@@ -156,11 +152,10 @@  discard block
 block discarded – undo
156 152
         return $type;
157 153
     }
158 154
 
159
-    protected function resolveName
160
-    (
161
-        string &$value,
162
-        bool &$nullable,
163
-        bool &$collection
155
+    protected function resolveName(
156
+        string & $value,
157
+        bool & $nullable,
158
+        bool & $collection
164 159
     )
165 160
     {
166 161
         switch ($value)
Please login to merge, or discard this patch.
src/Factory/Reflection/ReflectionPropertyFactory.php 1 patch
Spacing   +12 added lines, -24 removed lines patch added patch discarded remove patch
@@ -53,8 +53,7 @@  discard block
 block discarded – undo
53 53
      */
54 54
     public static function fromName($class, $property)
55 55
     {
56
-        return new static(new PHPNativeReflectionProperty
57
-        (
56
+        return new static(new PHPNativeReflectionProperty(
58 57
             $class, $property
59 58
         ));
60 59
     }
@@ -72,14 +71,12 @@  discard block
 block discarded – undo
72 71
     {
73 72
         $this->accessor->setRawValue('owner', $parent);
74 73
         $this->accessor->setRawValue('defaultValue', $default);
75
-        $this->accessor->setRawValue
76
-        (
74
+        $this->accessor->setRawValue(
77 75
             'name',
78 76
             $this->reflector->getName()
79 77
         );
80 78
 
81
-        $this->parseDocComment
82
-        ([
79
+        $this->parseDocComment([
83 80
             'readable' => 'setBool',
84 81
             'writable' => 'setBool',
85 82
             'var' => 'setType',
@@ -97,8 +94,7 @@  discard block
 block discarded – undo
97 94
      */
98 95
     protected function setType($name, $value)
99 96
     {
100
-        $this->accessor->setRawValue
101
-        (
97
+        $this->accessor->setRawValue(
102 98
             'type',
103 99
             (new TypeParser($this->object->owner))->parse($value)
104 100
         );
@@ -120,50 +116,42 @@  discard block
 block discarded – undo
120 116
         switch ($value[0])
121 117
         {
122 118
             case 'required':
123
-                $this->accessor->setRawValue
124
-                (
119
+                $this->accessor->setRawValue(
125 120
                     'passedToConstructor',
126 121
                     true
127 122
                 );
128
-                $this->accessor->setRawValue
129
-                (
123
+                $this->accessor->setRawValue(
130 124
                     'requiredInConstructor',
131 125
                     true
132 126
                 );
133
-                $compositeAccessor->rawAddToValue
134
-                (
127
+                $compositeAccessor->rawAddToValue(
135 128
                     'requiredProperties',
136 129
                     $this->object
137 130
                 );
138 131
                 break;
139 132
             case 'new':
140
-                $this->accessor->setRawValue
141
-                (
133
+                $this->accessor->setRawValue(
142 134
                     'builtInConstructor',
143 135
                     true
144 136
                 );
145
-                $compositeAccessor->rawAddToValue
146
-                (
137
+                $compositeAccessor->rawAddToValue(
147 138
                     'builtProperties',
148 139
                     $this->object
149 140
                 );
150 141
                 break;
151 142
             case 'optional':
152
-                $this->accessor->setRawValue
153
-                (
143
+                $this->accessor->setRawValue(
154 144
                     'passedToConstructor',
155 145
                     true
156 146
                 );
157
-                $compositeAccessor->rawAddToValue
158
-                (
147
+                $compositeAccessor->rawAddToValue(
159 148
                     'optionalProperties',
160 149
                     $this->object
161 150
                 );
162 151
 
163 152
                 if (isset($value[1]) && $value[1] === 'new')
164 153
                 {
165
-                    $this->accessor->setRawValue
166
-                    (
154
+                    $this->accessor->setRawValue(
167 155
                         'builtInConstructor',
168 156
                         true
169 157
                     );
Please login to merge, or discard this patch.