@@ -62,8 +62,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 ! |
@@ -97,8 +97,7 @@ |
||
| 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 | |
@@ -2,11 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Majora\Framework\Domain\Action\Dal; |
| 4 | 4 | |
| 5 | -use Majora\Framework\Api\Client\RestApiClient; |
|
| 6 | 5 | use Majora\Framework\Validation\ValidationException; |
| 7 | 6 | use Symfony\Component\EventDispatcher\Event; |
| 8 | 7 | use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
| 9 | -use Symfony\Component\Serializer\SerializerInterface; |
|
| 10 | 8 | use Symfony\Component\Validator\Validator\ValidatorInterface; |
| 11 | 9 | |
| 12 | 10 | /** |
@@ -56,8 +56,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -111,10 +109,10 @@ discard block |
||
| 111 | 109 | $messages = array(); |
| 112 | 110 | $report = $this->getReport(); |
| 113 | 111 | |
| 114 | - switch(true){ |
|
| 112 | + switch (true) { |
|
| 115 | 113 | |
| 116 | 114 | case $report instanceof ConstraintViolationListInterface: |
| 117 | - foreach ($report as $constraintViolation){ |
|
| 115 | + foreach ($report as $constraintViolation) { |
|
| 118 | 116 | $messages[] = $constraintViolation->getMessage(); |
| 119 | 117 | } |
| 120 | 118 | break; |
@@ -29,8 +29,7 @@ discard block |
||
| 29 | 29 | protected function mock($date) |
| 30 | 30 | { |
| 31 | 31 | $this->currentDate = $date instanceof \DateTime ? |
| 32 | - $date : |
|
| 33 | - date_create($date) |
|
| 32 | + $date : date_create($date) |
|
| 34 | 33 | ; |
| 35 | 34 | } |
| 36 | 35 | |
@@ -46,8 +45,7 @@ discard block |
||
| 46 | 45 | $date = clone $this->currentDate; |
| 47 | 46 | |
| 48 | 47 | return empty($format) ? |
| 49 | - $date : |
|
| 50 | - $date->format($format) |
|
| 48 | + $date : $date->format($format) |
|
| 51 | 49 | ; |
| 52 | 50 | } |
| 53 | 51 | } |