Skip to content

Commit b3cccd1

Browse files
authored
Refactor rawValue assignment logic in ScalarValue
1 parent c6f2cf3 commit b3cccd1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/Value/ScalarValue.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ public function __construct(
2222
bool $inputed,
2323
)
2424
{
25-
$this->rawValue = $type->validateAndCoerceInput($rawValue)
26-
?? throw new InvalidValue($type, $rawValue, $inputed);
25+
$this->rawValue = $inputed
26+
? $type->validateAndCoerceInput($rawValue)
27+
?? throw new InvalidValue($type, $rawValue, true)
28+
: $rawValue;
2729
}
2830

2931
#[\Override]

0 commit comments

Comments
 (0)