Skip to content

Commit

Permalink
[Serializer] Fix merge
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Mar 19, 2024
1 parent 7058c7a commit 8b83945
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,25 @@ public function __construct($freeTrial, $hasSubscribe, $getReady, $isActive)
$this->isActive = $isActive;
}

/**
* @SerializedName("free_trial_method")
*/
#[SerializedName('free_trial_method')]
public function getFreeTrial()
{
return $this->freeTrial;
}

/**
* @SerializedName("has_subscribe_method")
*/
#[SerializedName('has_subscribe_method')]
public function hasSubscribe()
{
return $this->hasSubscribe;
}

/**
* @SerializedName("get_ready_method")
*/
#[SerializedName('get_ready_method')]
public function getReady()
{
return $this->getReady;
}

/**
* @SerializedName("is_active_method")
*/
#[SerializedName('is_active_method')]
public function isActive()
{
return $this->isActive;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,16 @@

class SamePropertyAsMethodWithPropertySerializedNameDummy
{
/**
* @SerializedName("free_trial_property")
*/
#[SerializedName('free_trial_property')]
private $freeTrial;

/**
* @SerializedName("has_subscribe_property")
*/
#[SerializedName('has_subscribe_property')]
private $hasSubscribe;

/**
* @SerializedName("get_ready_property")
*/
#[SerializedName('get_ready_property')]
private $getReady;

/**
* @SerializedName("is_active_property")
*/
#[SerializedName('is_active_property')]
private $isActive;

public function __construct($freeTrial, $hasSubscribe, $getReady, $isActive)
Expand Down
4 changes: 2 additions & 2 deletions Tests/Normalizer/ObjectNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,7 @@ public function testSamePropertyAsMethod()

public function testSamePropertyAsMethodWithPropertySerializedName()
{
$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
$this->normalizer = new ObjectNormalizer($classMetadataFactory, new MetadataAwareNameConverter($classMetadataFactory));
$this->normalizer->setSerializer($this->serializer);

Expand All @@ -886,7 +886,7 @@ public function testSamePropertyAsMethodWithPropertySerializedName()

public function testSamePropertyAsMethodWithMethodSerializedName()
{
$classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader()));
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
$this->normalizer = new ObjectNormalizer($classMetadataFactory, new MetadataAwareNameConverter($classMetadataFactory));
$this->normalizer->setSerializer($this->serializer);

Expand Down

0 comments on commit 8b83945

Please sign in to comment.