Completed
Push — master ( 4c11d7...d8d25b )
by Quentin
03:06
created
src/Majora/Framework/Normalizer/Tests/MajoraNormalizerTest.php 1 patch
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -147,6 +147,8 @@  discard block
 block discarded – undo
147 147
 
148 148
     /**
149 149
      * Construct.
150
+     * @param integer $id
151
+     * @param integer $bladesNumber
150 152
      */
151 153
     public function __construct($id, $bladesNumber = null, $nothing = 'wrong')
152 154
     {
@@ -164,6 +166,9 @@  discard block
 block discarded – undo
164 166
         return $this->id;
165 167
     }
166 168
 
169
+    /**
170
+     * @param string $color
171
+     */
167 172
     public function setColor($color) {
168 173
         $this->color = $color;
169 174
     }
Please login to merge, or discard this patch.
src/Majora/Framework/Normalizer/MajoraNormalizer.php 1 patch
Spacing   +10 added lines, -17 removed lines patch added patch discarded remove patch
@@ -69,8 +69,7 @@  discard block
 block discarded – undo
69 69
     public static function createNormalizer($key = 'default')
70 70
     {
71 71
         return isset(self::$instancePool[$key]) ?
72
-            self::$instancePool[$key] :
73
-            self::$instancePool[$key] = new static(
72
+            self::$instancePool[$key] : self::$instancePool[$key] = new static(
74 73
             PropertyAccess::createPropertyAccessor()
75 74
         );
76 75
     }
@@ -93,7 +92,7 @@  discard block
 block discarded – undo
93 92
      */
94 93
     private function createExtractorDelegate()
95 94
     {
96
-        return $this->extractorDelegate ?: $this->extractorDelegate = function () {
95
+        return $this->extractorDelegate ?: $this->extractorDelegate = function() {
97 96
             return get_object_vars($this);
98 97
         };
99 98
     }
@@ -105,7 +104,7 @@  discard block
 block discarded – undo
105 104
      */
106 105
     private function createReadingDelegate()
107 106
     {
108
-        return $this->readDelegate ?: $this->readDelegate = function ($property, PropertyAccessor $propertyAccessor) {
107
+        return $this->readDelegate ?: $this->readDelegate = function($property, PropertyAccessor $propertyAccessor) {
109 108
             switch (true) {
110 109
 
111 110
                 // Public property / accessor case
@@ -266,7 +265,7 @@  discard block
 block discarded – undo
266 265
      */
267 266
     private function createWrittingDelegate()
268 267
     {
269
-        return $this->writeDelegate ?: $this->writeDelegate = function (PropertyPathInterface $property, $value, PropertyAccessor $propertyAccessor) {
268
+        return $this->writeDelegate ?: $this->writeDelegate = function(PropertyPathInterface $property, $value, PropertyAccessor $propertyAccessor) {
270 269
             switch (true) {
271 270
 
272 271
                 // Public property / accessor case
@@ -300,15 +299,12 @@  discard block
 block discarded – undo
300 299
         $class = is_string($normalizable) ?
301 300
             $normalizable : (
302 301
                 $normalizable instanceof \ReflectionClass ?
303
-                    $normalizable->name :
304
-                    get_class($normalizable)
302
+                    $normalizable->name : get_class($normalizable)
305 303
             )
306 304
         ;
307 305
         $reflection = isset(self::$reflectionPool[$class]) ?
308
-            self::$reflectionPool[$class] :
309
-            self::$reflectionPool[$class] = $normalizable instanceof \ReflectionClass ?
310
-                $normalizable :
311
-                new \ReflectionClass($class)
306
+            self::$reflectionPool[$class] : self::$reflectionPool[$class] = $normalizable instanceof \ReflectionClass ?
307
+                $normalizable : new \ReflectionClass($class)
312 308
         ;
313 309
 
314 310
         $object = $normalizable;
@@ -335,8 +331,7 @@  discard block
 block discarded – undo
335 331
                         $argKey = $this->inflector->snakelize($parameter->getName());
336 332
                         if (isset($data[$argKey])) {
337 333
                             $arguments[] = $parameter->getClass() ?
338
-                                $this->normalize($data[$argKey], $parameter->getClass()) :
339
-                                $data[$argKey]
334
+                                $this->normalize($data[$argKey], $parameter->getClass()) : $data[$argKey]
340 335
                             ;
341 336
                             unset($data[$argKey]);
342 337
 
@@ -344,16 +339,14 @@  discard block
 block discarded – undo
344 339
                         }
345 340
 
346 341
                         $arguments[] = $parameter->isOptional() ?
347
-                            $parameter->getDefaultValue() :
348
-                            null
342
+                            $parameter->getDefaultValue() : null
349 343
                         ;
350 344
                     }
351 345
                 }
352 346
             }
353 347
 
354 348
             $object = empty($arguments) ?
355
-                $reflection->newInstance() :
356
-                $reflection->newInstanceArgs($arguments);
349
+                $reflection->newInstance() : $reflection->newInstanceArgs($arguments);
357 350
         }
358 351
 
359 352
         // BAD !
Please login to merge, or discard this patch.