Completed
Push — master ( d8d25b...3f99c9 )
by Quentin
59s
created
src/Majora/Framework/Validation/Listener/ValidationExceptionListener.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         $statusCode = $exception instanceof HttpException ? $exception->getStatusCode() : 500;
63 63
         $errors     = array();
64 64
 
65
-        switch(true) {
65
+        switch (true) {
66 66
 
67 67
             // validation exception
68 68
             case $exception instanceof ValidationException :
@@ -99,8 +99,7 @@  discard block
 block discarded – undo
99 99
             }
100 100
 
101 101
             $violation = $violation instanceof FormError ?
102
-                $violation->getCause() :
103
-                $violation
102
+                $violation->getCause() : $violation
104 103
             ;
105 104
 
106 105
             $errors[(string) $violation->getPropertyPath()] = $violation->getMessage();
Please login to merge, or discard this patch.
src/Majora/Framework/Serializer/Handler/Collection/CollectionHandler.php 1 patch
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@  discard block
 block discarded – undo
18 18
     public function serialize($data, $scope)
19 19
     {
20 20
         return $data instanceof SerializableInterface ?
21
-            $data->serialize($scope) :
22
-            (array) $data
21
+            $data->serialize($scope) : (array) $data
23 22
         ;
24 23
     }
25 24
 
@@ -35,8 +34,7 @@  discard block
 block discarded – undo
35 34
         $object = new $output();
36 35
 
37 36
         return $object instanceof SerializableInterface ?
38
-            $object->deserialize($data) :
39
-            $object
37
+            $object->deserialize($data) : $object
40 38
         ;
41 39
     }
42 40
 }
Please login to merge, or discard this patch.
src/Majora/Framework/Serializer/Handler/Json/JsonHandler.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@
 block discarded – undo
17 17
     public function serialize($data, $scope)
18 18
     {
19 19
         return json_encode($data instanceof NormalizableInterface ?
20
-            $this->normalizer->normalize($data, $scope) :
21
-            $data
20
+            $this->normalizer->normalize($data, $scope) : $data
22 21
         );
23 22
     }
24 23
 
Please login to merge, or discard this patch.
Majora/Bundle/FrameworkExtraBundle/Controller/RestApiControllerTrait.php 1 patch
Spacing   +4 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
35 35
     {
36 36
         if ($data !== null) {
37 37
             $data = is_string($data) ?
38
-                $data :
39
-                $this->container->get('serializer')->serialize(
38
+                $data : $this->container->get('serializer')->serialize(
40 39
                     $data, 'json', empty($scope) ? array() : array('scope' => $scope)
41 40
                 )
42 41
             ;
@@ -127,9 +126,8 @@  discard block
 block discarded – undo
127 126
         }
128 127
 
129 128
         // data camel case normalization
130
-        return $inflection && $this->container->has('majora.inflector')?
131
-            $this->container->get('majora.inflector')->normalize($data, $inflection) :
132
-            $data
129
+        return $inflection && $this->container->has('majora.inflector') ?
130
+            $this->container->get('majora.inflector')->normalize($data, $inflection) : $data
133 131
         ;
134 132
     }
135 133
 
@@ -210,8 +208,7 @@  discard block
 block discarded – undo
210 208
         $subRequest = $request->duplicate();
211 209
         $subRequest->attributes->set('_controller', $forwardOptions['controller']);
212 210
         $subRequest->setMethod(isset($forwardOptions['method']) ?
213
-            $forwardOptions['method'] :
214
-            'GET'
211
+            $forwardOptions['method'] : 'GET'
215 212
         );
216 213
 
217 214
         return $this->container->get('http_kernel')->handle(
Please login to merge, or discard this patch.
src/Majora/Bundle/FrameworkExtraBundle/Form/Type/TranslatableTextType.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@
 block discarded – undo
54 54
     public function buildForm(FormBuilderInterface $builder, array $options)
55 55
     {
56 56
         $handledLocales = empty($options['locales']) ?
57
-            $this->locales :
58
-            array_intersect($this->locales, $options['locales'])
57
+            $this->locales : array_intersect($this->locales, $options['locales'])
59 58
         ;
60 59
         if (empty($handledLocales)) {
61 60
             return;
Please login to merge, or discard this patch.
src/Majora/Bundle/FrameworkExtraBundle/Controller/ControllerTrait.php 1 patch
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,8 +46,7 @@  discard block
 block discarded – undo
46 46
 
47 47
         return $this->container->get('security.authorization_checker')->isGranted(
48 48
             (array) (empty($securityMapping[$intention]) ?
49
-                $intention :
50
-                $securityMapping[$intention]
49
+                $intention : $securityMapping[$intention]
51 50
             ),
52 51
             $resource
53 52
         );
@@ -110,8 +109,7 @@  discard block
 block discarded – undo
110 109
         return new NotFoundHttpException(sprintf('Entity with id "%s" not found%s.',
111 110
             $entityId,
112 111
             $this->container->getParameter('kernel.debug') ?
113
-                sprintf(' : (looked into "%s")', $loaderId) :
114
-                ''
112
+                sprintf(' : (looked into "%s")', $loaderId) : ''
115 113
         ));
116 114
     }
117 115
 }
Please login to merge, or discard this patch.
src/Majora/Framework/Api/Request/RestApiRequestFactory.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,8 +43,7 @@
 block discarded – undo
43 43
         array $defaultOptions = array(),
44 44
         array $defaultBodyData = array(),
45 45
         array $routeMapping = array()
46
-    )
47
-    {
46
+    ) {
48 47
         $this->urlGenerator = $urlGenerator;
49 48
         $this->defaultOptions = $defaultOptions;
50 49
         $this->defaultBodyData = $defaultBodyData;
Please login to merge, or discard this patch.
src/Majora/Framework/Normalizer/MajoraNormalizer.php 1 patch
Spacing   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@  discard block
 block discarded – undo
62 62
     public static function createNormalizer($key = 'default')
63 63
     {
64 64
         return isset(self::$instancePool[$key]) ?
65
-            self::$instancePool[$key] :
66
-            self::$instancePool[$key] = new static(
65
+            self::$instancePool[$key] : self::$instancePool[$key] = new static(
67 66
             PropertyAccess::createPropertyAccessor()
68 67
         );
69 68
     }
@@ -293,15 +292,12 @@  discard block
 block discarded – undo
293 292
         $class = is_string($normalizable) ?
294 293
             $normalizable : (
295 294
                 $normalizable instanceof \ReflectionClass ?
296
-                    $normalizable->name :
297
-                    get_class($normalizable)
295
+                    $normalizable->name : get_class($normalizable)
298 296
             )
299 297
         ;
300 298
         $reflection = isset(self::$reflectionPool[$class]) ?
301
-            self::$reflectionPool[$class] :
302
-            self::$reflectionPool[$class] = $normalizable instanceof \ReflectionClass ?
303
-                $normalizable :
304
-                new \ReflectionClass($class)
299
+            self::$reflectionPool[$class] : self::$reflectionPool[$class] = $normalizable instanceof \ReflectionClass ?
300
+                $normalizable : new \ReflectionClass($class)
305 301
         ;
306 302
 
307 303
         $object = $normalizable;
@@ -328,8 +324,7 @@  discard block
 block discarded – undo
328 324
                         $argKey = $this->inflector->snakelize($parameter->getName());
329 325
                         if (isset($data[$argKey])) {
330 326
                             $arguments[] = $parameter->getClass() ?
331
-                                $this->normalize($data[$argKey], $parameter->getClass()) :
332
-                                $data[$argKey]
327
+                                $this->normalize($data[$argKey], $parameter->getClass()) : $data[$argKey]
333 328
                             ;
334 329
                             unset($data[$argKey]);
335 330
 
@@ -337,16 +332,14 @@  discard block
 block discarded – undo
337 332
                         }
338 333
 
339 334
                         $arguments[] = $parameter->isOptional() ?
340
-                            $parameter->getDefaultValue() :
341
-                            null
335
+                            $parameter->getDefaultValue() : null
342 336
                         ;
343 337
                     }
344 338
                 }
345 339
             }
346 340
 
347 341
             $object = empty($arguments) ?
348
-                $reflection->newInstance() :
349
-                $reflection->newInstanceArgs($arguments);
342
+                $reflection->newInstance() : $reflection->newInstanceArgs($arguments);
350 343
         }
351 344
 
352 345
         // BAD !
Please login to merge, or discard this patch.
src/Majora/Framework/Model/EntityCollection.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -97,8 +97,7 @@
 block discarded – undo
97 97
             foreach ($filters as $key => $value) {
98 98
                 $current = $propertyAccessor->getValue($entity, $key);
99 99
                 $res = $res && (is_array($value) ?
100
-                    in_array($current, $value) :
101
-                    $current == $value
100
+                    in_array($current, $value) : $current == $value
102 101
                 );
103 102
             }
104 103
 
Please login to merge, or discard this patch.