| @@ 103-111 (lines=9) @@ | ||
| 100 | * @param Property $property |
|
| 101 | * @param array $parameters |
|
| 102 | */ |
|
| 103 | protected function validateProperty($property, array $parameters): void |
|
| 104 | { |
|
| 105 | if (!array_key_exists($property->getName(), $parameters) |
|
| 106 | && is_null($property->getDefault()) |
|
| 107 | && !$property->isNullable() |
|
| 108 | ) { |
|
| 109 | throw DataTransferObjectError::uninitialized($property); |
|
| 110 | } |
|
| 111 | } |
|
| 112 | ||
| 113 | /** |
|
| 114 | * Set the value if it's present in the array |
|
| @@ 19-27 (lines=9) @@ | ||
| 16 | * @param Property $property |
|
| 17 | * @param array $parameters |
|
| 18 | */ |
|
| 19 | protected function validateProperty($property, array $parameters): void |
|
| 20 | { |
|
| 21 | if (!array_key_exists($property->getName(), $parameters) |
|
| 22 | && is_null($property->getDefault()) |
|
| 23 | && !$property->isNullable() |
|
| 24 | ) { |
|
| 25 | throw DataTransferObjectError::uninitialized($property); |
|
| 26 | } |
|
| 27 | } |
|
| 28 | } |
|
| 29 | ||