Completed
Pull Request — master (#24)
by Quentin
03:30
created
src/Majora/Framework/Domain/Action/DynamicActionTrait.php 1 patch
Spacing   +5 added lines, -9 removed lines patch added patch discarded remove patch
@@ -68,8 +68,7 @@  discard block
 block discarded – undo
68 68
      */
69 69
     private function getPropertyAccessor()
70 70
     {
71
-        $this->propertyAccessor = $this->propertyAccessor ?:
72
-            PropertyAccess::createPropertyAccessor()
71
+        $this->propertyAccessor = $this->propertyAccessor ?: PropertyAccess::createPropertyAccessor()
73 72
         ;
74 73
 
75 74
         return $this->propertyAccessor;
@@ -127,8 +126,7 @@  discard block
 block discarded – undo
127 126
         $propertyAccessor = $this->getPropertyAccessor();
128 127
         if (!$this->_has($field)) {
129 128
             return $propertyAccessor->isReadable($object, $field) ?
130
-                $propertyAccessor->getValue($object, $field) :
131
-                null
129
+                $propertyAccessor->getValue($object, $field) : null
132 130
             ;
133 131
         }
134 132
 
@@ -157,7 +155,7 @@  discard block
 block discarded – undo
157 155
         $data = $this->getAttributes()->toArray();
158 156
 
159 157
         $scopes = $this->getScopes();
160
-        if(empty($scopes[$scope])) {
158
+        if (empty($scopes[$scope])) {
161 159
             return $data;
162 160
         }
163 161
 
@@ -167,11 +165,9 @@  discard block
 block discarded – undo
167 165
             $normalizedData[$field] = $propertyAccessor->isReadable(
168 166
                     $data,
169 167
                     $propertyPath = strpos($field, '[') === 0 ?
170
-                        $field :
171
-                        sprintf('[%s]', $field)
168
+                        $field : sprintf('[%s]', $field)
172 169
                 ) ?
173
-                $propertyAccessor->getValue($data, $propertyPath) :
174
-                null
170
+                $propertyAccessor->getValue($data, $propertyPath) : null
175 171
             ;
176 172
         }
177 173
 
Please login to merge, or discard this patch.
src/Majora/Framework/Domain/ActionDispatcherDomain.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@
 block discarded – undo
36 36
         return $this->actionFactory
37 37
             ->createAction($name)
38 38
             ->denormalize(isset($arguments[0]) && is_array($arguments[0]) ?
39
-                $arguments[0] :
40
-                array()
39
+                $arguments[0] : array()
41 40
             )
42 41
             ->init($relatedEntity, ...$arguments)
43 42
         ;
Please login to merge, or discard this patch.
src/Majora/Framework/Model/TimedTrait.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@
 block discarded – undo
28 28
     protected function formatDateTime(\DateTime $date = null, $format = null)
29 29
     {
30 30
         return $date && $format ?
31
-            $date->format($format) :
32
-            $date
31
+            $date->format($format) : $date
33 32
         ;
34 33
     }
35 34
 
Please login to merge, or discard this patch.
src/Majora/Framework/Model/TranslatableTrait.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -52,8 +52,7 @@
 block discarded – undo
52 52
 
53 53
         // default locale matched
54 54
         return $this->defaultLocale && isset($translationData[$this->defaultLocale]) ?
55
-            $translationData[$this->defaultLocale] :
56
-            $default
55
+            $translationData[$this->defaultLocale] : $default
57 56
         ;
58 57
     }
59 58
 }
Please login to merge, or discard this patch.
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/Validation/ValidationException.php 1 patch
Spacing   +5 added lines, -7 removed lines patch added patch discarded remove patch
@@ -56,8 +56,7 @@  discard block
 block discarded – undo
56 56
                 'Validation failed on %s%s',
57 57
                 $this->entity ? get_class($this->entity) : '',
58 58
                 $this->entity instanceof CollectionableInterface ?
59
-                    sprintf('#%s', $this->entity->getId()) :
60
-                    ''
59
+                    sprintf('#%s', $this->entity->getId()) : ''
61 60
                 ,
62 61
                 empty($this->groups) ? '' : sprintf(' for ["%s"] groups',
63 62
                     implode('", "', $this->groups)
@@ -96,8 +95,7 @@  discard block
 block discarded – undo
96 95
     public function getReport()
97 96
     {
98 97
         return $this->report ?
99
-            $this->report :
100
-            new EntityCollection()
98
+            $this->report : new EntityCollection()
101 99
         ;
102 100
     }
103 101
 
@@ -106,14 +104,14 @@  discard block
 block discarded – undo
106 104
      *
107 105
      * @return array
108 106
      */
109
-    public function formatReport(){
107
+    public function formatReport() {
110 108
         $messages = array();
111 109
         $report = $this->getReport();
112 110
 
113
-        switch(true){
111
+        switch (true) {
114 112
 
115 113
             case $report instanceof ConstraintViolationListInterface:
116
-                foreach ($report as $constraintViolation){
114
+                foreach ($report as $constraintViolation) {
117 115
                     $messages[] = $constraintViolation->getMessage();
118 116
                 }
119 117
                 break;
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.
src/Majora/Framework/Date/Clock.php 1 patch
Spacing   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -21,8 +21,7 @@  discard block
 block discarded – undo
21 21
     protected function mock($date)
22 22
     {
23 23
         $this->mockedDate = $date instanceof \DateTime ?
24
-            $date :
25
-            date_create($date)
24
+            $date : date_create($date)
26 25
         ;
27 26
     }
28 27
 
@@ -36,13 +35,11 @@  discard block
 block discarded – undo
36 35
     public function now($format = null)
37 36
     {
38 37
         $date = $this->mockedDate instanceof \DateTime ?
39
-            $this->mockedDate :
40
-            new \DateTime()
38
+            $this->mockedDate : new \DateTime()
41 39
         ;
42 40
 
43 41
         return empty($format) ?
44
-            $date :
45
-            $date->format($format)
42
+            $date : $date->format($format)
46 43
         ;
47 44
     }
48 45
 }
Please login to merge, or discard this patch.