Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #27389 [Serializer] Fix serializer tries to denormalize null valu…
…es on nullable properties (ogizanagi) This PR was merged into the 3.4 branch. Discussion ---------- [Serializer] Fix serializer tries to denormalize null values on nullable properties | Q | A | ------------- | --- | Branch? | 3.4 <!-- see below --> | Bug fix? | yes | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | #27384 <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | N/A Commits ------- ca31488 [Serializer] Fix serializer tries to denormalize null values on nullable properties
- Loading branch information
Showing
3 changed files
with
50 additions
and
0 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
32 changes: 32 additions & 0 deletions
32
src/Symfony/Component/Serializer/Tests/Fixtures/NullableConstructorArgumentDummy.php
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Serializer\Tests\Fixtures; | ||
|
||
class NullableConstructorArgumentDummy | ||
{ | ||
private $foo; | ||
|
||
public function __construct(?\stdClass $foo) | ||
{ | ||
$this->foo = $foo; | ||
} | ||
|
||
public function setFoo($foo) | ||
{ | ||
$this->foo = 'this setter should not be called when using the constructor argument'; | ||
} | ||
|
||
public function getFoo() | ||
{ | ||
return $this->foo; | ||
} | ||
} |
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