-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Turns out NullableTransformer is needed when creating from constructor if we have argument what expects nullable object
- Loading branch information
Showing
4 changed files
with
5 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
use PhpParser\Node\Stmt; | ||
|
||
/** | ||
* Tansformer decorator to handle null values. | ||
* Transformer decorator to handle null values. | ||
* | ||
* @author Joel Wurtz <[email protected]> | ||
* | ||
|
@@ -51,9 +51,9 @@ public function transform(Expr $input, Expr $target, PropertyMetadata $propertyM | |
$itemStatements[] = new Stmt\Expression(new $assignClass($newOutput, $output)); | ||
} | ||
|
||
if ($input instanceof Expr\ArrayDimFetch) { | ||
if ($propertyMapping->source->checkExists) { | ||
/* | ||
* if `$input` is an array access, let's validate if the array key exists and is not null: | ||
* if `$input` is an array access or stdClass, let's validate if the key exists and is not null: | ||
* | ||
* if (isset($value['key'])) { | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters