We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should we return NULL if the value is empty?
laminas-hydrator/src/Strategy/HydratorStrategy.php
Line 53 in b0edb14
The text was updated successfully, but these errors were encountered:
This would be a BC break because the behaviour is changed.
But you are welcome to create a pull request.
See also #37
Sorry, something went wrong.
I do not want something break ))) I decorated strategy with null check
use Laminas\Hydrator\Strategy\StrategyInterface; class NullableStrategy implements StrategyInterface { /** @var StrategyInterface */ private $strategy; public function __construct(StrategyInterface $strategy) { $this->strategy = $strategy; } public function extract($value, ?object $object = null) { if ($value === null) { return null; } return $this->strategy->extract($value, $object); } public function hydrate($value, ?array $data = null) { if ($value === '' || $value === null) { return null; } return $this->strategy->hydrate($value, $data); } }
Successfully merging a pull request may close this issue.
Should we return NULL if the value is empty?
laminas-hydrator/src/Strategy/HydratorStrategy.php
Line 53 in b0edb14
The text was updated successfully, but these errors were encountered: