@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /* |
| 3 | 3 | * This file is part of the KleijnWeb\PhpApi\Hydrator package. |
| 4 | 4 | * |
@@ -47,12 +47,12 @@ discard block |
||
| 47 | 47 | public function hydrate($value) |
| 48 | 48 | { |
| 49 | 49 | if ($value === null) { |
| 50 | - if(null == ($value = $this->schema->getDefault())){ |
|
| 50 | + if (null == ($value = $this->schema->getDefault())) { |
|
| 51 | 51 | return null; |
| 52 | 52 | } |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - return array_map(function ($value) { |
|
| 55 | + return array_map(function($value) { |
|
| 56 | 56 | return $this->itemsProcessor->hydrate($value); |
| 57 | 57 | }, $value); |
| 58 | 58 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function dehydrate($value) |
| 65 | 65 | { |
| 66 | - return array_map(function ($value) { |
|
| 66 | + return array_map(function($value) { |
|
| 67 | 67 | return $this->itemsProcessor->dehydrate($value); |
| 68 | 68 | }, $value); |
| 69 | 69 | } |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /* |
| 3 | 3 | * This file is part of the KleijnWeb\PhpApi\Hydrator package. |
| 4 | 4 | * |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $this->dateTimeSerializer = $dateTimeSerializer; |
| 43 | 43 | |
| 44 | 44 | $this->dateSchema = new ScalarSchema( |
| 45 | - (object)['type' => Schema::TYPE_STRING, 'format' => Schema::FORMAT_DATE] |
|
| 45 | + (object)[ 'type' => Schema::TYPE_STRING, 'format' => Schema::FORMAT_DATE ] |
|
| 46 | 46 | ); |
| 47 | 47 | } |
| 48 | 48 | |
@@ -66,14 +66,14 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | if (is_array($value)) { |
| 69 | - return array_map(function ($itemValue) { |
|
| 69 | + return array_map(function($itemValue) { |
|
| 70 | 70 | return $this->hydrate($itemValue); |
| 71 | 71 | }, $value); |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | if (is_string($value)) { |
| 75 | 75 | if (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}(.*)$/', $value, $matches)) { |
| 76 | - if (strlen($matches[1]) === 0) { |
|
| 76 | + if (strlen($matches[ 1 ]) === 0) { |
|
| 77 | 77 | return $this->dateTimeSerializer->deserialize($value, $this->dateSchema); |
| 78 | 78 | } |
| 79 | 79 | |
@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare(strict_types=1); |
|
| 1 | +<?php declare(strict_types = 1); |
|
| 2 | 2 | /* |
| 3 | 3 | * This file is part of the KleijnWeb\PhpApi\Hydrator package. |
| 4 | 4 | * |
@@ -71,6 +71,6 @@ discard block |
||
| 71 | 71 | return $processor; |
| 72 | 72 | } |
| 73 | 73 | } |
| 74 | - throw new UnsupportedException("Unsupported schema type " . get_class($schema)); |
|
| 74 | + throw new UnsupportedException("Unsupported schema type ".get_class($schema)); |
|
| 75 | 75 | } |
| 76 | 76 | } |