-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Serializer] Fix object normalizer when properties has the same name …
…as their accessor
- Loading branch information
1 parent
1f386a3
commit 8575199
Showing
6 changed files
with
238 additions
and
5 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
48 changes: 48 additions & 0 deletions
48
src/Symfony/Component/Serializer/Tests/Fixtures/SamePropertyAsMethodDummy.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,48 @@ | ||
<?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 SamePropertyAsMethodDummy | ||
{ | ||
private $freeTrial; | ||
private $hasSubscribe; | ||
private $getReady; | ||
private $isActive; | ||
|
||
public function __construct($freeTrial, $hasSubscribe, $getReady, $isActive) | ||
{ | ||
$this->freeTrial = $freeTrial; | ||
$this->hasSubscribe = $hasSubscribe; | ||
$this->getReady = $getReady; | ||
$this->isActive = $isActive; | ||
} | ||
|
||
public function getFreeTrial() | ||
{ | ||
return $this->freeTrial; | ||
} | ||
|
||
public function hasSubscribe() | ||
{ | ||
return $this->hasSubscribe; | ||
} | ||
|
||
public function getReady() | ||
{ | ||
return $this->getReady; | ||
} | ||
|
||
public function isActive() | ||
{ | ||
return $this->isActive; | ||
} | ||
} |
62 changes: 62 additions & 0 deletions
62
...Component/Serializer/Tests/Fixtures/SamePropertyAsMethodWithMethodSerializedNameDummy.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,62 @@ | ||
<?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; | ||
|
||
use Symfony\Component\Serializer\Annotation\SerializedName; | ||
|
||
class SamePropertyAsMethodWithMethodSerializedNameDummy | ||
{ | ||
private $freeTrial; | ||
private $hasSubscribe; | ||
private $getReady; | ||
private $isActive; | ||
|
||
public function __construct($freeTrial, $hasSubscribe, $getReady, $isActive) | ||
{ | ||
$this->freeTrial = $freeTrial; | ||
$this->hasSubscribe = $hasSubscribe; | ||
$this->getReady = $getReady; | ||
$this->isActive = $isActive; | ||
} | ||
|
||
/** | ||
* @SerializedName("free_trial_method") | ||
*/ | ||
public function getFreeTrial() | ||
{ | ||
return $this->freeTrial; | ||
} | ||
|
||
/** | ||
* @SerializedName("has_subscribe_method") | ||
*/ | ||
public function hasSubscribe() | ||
{ | ||
return $this->hasSubscribe; | ||
} | ||
|
||
/** | ||
* @SerializedName("get_ready_method") | ||
*/ | ||
public function getReady() | ||
{ | ||
return $this->getReady; | ||
} | ||
|
||
/** | ||
* @SerializedName("is_active_method") | ||
*/ | ||
public function isActive() | ||
{ | ||
return $this->isActive; | ||
} | ||
} |
65 changes: 65 additions & 0 deletions
65
...mponent/Serializer/Tests/Fixtures/SamePropertyAsMethodWithPropertySerializedNameDummy.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,65 @@ | ||
<?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; | ||
|
||
use Symfony\Component\Serializer\Annotation\SerializedName; | ||
|
||
class SamePropertyAsMethodWithPropertySerializedNameDummy | ||
{ | ||
/** | ||
* @SerializedName("free_trial_property") | ||
*/ | ||
private $freeTrial; | ||
|
||
/** | ||
* @SerializedName("has_subscribe_property") | ||
*/ | ||
private $hasSubscribe; | ||
|
||
/** | ||
* @SerializedName("get_ready_property") | ||
*/ | ||
private $getReady; | ||
|
||
/** | ||
* @SerializedName("is_active_property") | ||
*/ | ||
private $isActive; | ||
|
||
public function __construct($freeTrial, $hasSubscribe, $getReady, $isActive) | ||
{ | ||
$this->freeTrial = $freeTrial; | ||
$this->hasSubscribe = $hasSubscribe; | ||
$this->getReady = $getReady; | ||
$this->isActive = $isActive; | ||
} | ||
|
||
public function getFreeTrial() | ||
{ | ||
return $this->freeTrial; | ||
} | ||
|
||
public function hasSubscribe() | ||
{ | ||
return $this->hasSubscribe; | ||
} | ||
|
||
public function getReady() | ||
{ | ||
return $this->getReady; | ||
} | ||
|
||
public function isActive() | ||
{ | ||
return $this->isActive; | ||
} | ||
} |
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