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