|
@@ 99-104 (lines=6) @@
|
| 96 |
|
*/ |
| 97 |
|
private function validateArrayDefaultValue(ArgumentDefinition $type, array $defaults): void |
| 98 |
|
{ |
| 99 |
|
if (! $type->isList()) { |
| 100 |
|
$error = \sprintf('%s can not be initialized by List %s', |
| 101 |
|
$type, $this->valueToString($defaults) |
| 102 |
|
); |
| 103 |
|
throw new TypeConflictException($error, $this->getCallStack()); |
| 104 |
|
} |
| 105 |
|
|
| 106 |
|
|
| 107 |
|
if ($type->isList() && $type->isListOfNonNulls()) { |
|
@@ 109-115 (lines=7) @@
|
| 106 |
|
|
| 107 |
|
if ($type->isList() && $type->isListOfNonNulls()) { |
| 108 |
|
foreach ($defaults as $value) { |
| 109 |
|
if ($value === null) { |
| 110 |
|
$error = \sprintf('%s can not be initialized by list %s with NULL value', |
| 111 |
|
$type, $this->valueToString($defaults) |
| 112 |
|
); |
| 113 |
|
|
| 114 |
|
throw new TypeConflictException($error, $this->getCallStack()); |
| 115 |
|
} |
| 116 |
|
} |
| 117 |
|
} |
| 118 |
|
} |