Skip to content

Commit 816cb1e

Browse files
committed
Add raw data to ConstructorParameterMissingException
1 parent 36a64f2 commit 816cb1e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Exceptions/ConstructorParameterMissingException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class ConstructorParameterMissingException extends Exception
88
{
9-
public function __construct(string $class, string $parameter)
9+
public function __construct(string $class, string $parameter, public readonly array $data)
1010
{
1111
parent::__construct("No value found for parameter `{$parameter}` for {$class}'s constructor.");
1212
}

src/ObjectMapper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private function createObjectUsingConstructor(ClassBluePrint $bluePrint, array $
9898
} else if (! $constructorProperty->isRequired()) {
9999
$constructorValues[] = $constructorProperty->getDefaultValue();
100100
} else {
101-
throw new ConstructorParameterMissingException($bluePrint->getClassName(), $constructorProperty->getName());
101+
throw new ConstructorParameterMissingException($bluePrint->getClassName(), $constructorProperty->getName(), $data);
102102
}
103103
}
104104

0 commit comments

Comments
 (0)