@@ -68,8 +68,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -36,8 +36,7 @@ |
||
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 | ; |
@@ -28,8 +28,7 @@ |
||
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 |
@@ -52,8 +52,7 @@ |
||
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 | } |
@@ -62,7 +62,7 @@ discard block |
||
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 |
||
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(); |
@@ -18,8 +18,7 @@ discard block |
||
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 |
||
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 | } |
@@ -17,8 +17,7 @@ |
||
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 |
@@ -35,8 +35,7 @@ discard block |
||
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 |
||
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 |
||
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( |
@@ -54,8 +54,7 @@ |
||
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; |