Skip to content

Commit f15ea50

Browse files
committed
minor #10376 [Component][Serializer] Add fluent interface to GetSetMethodNormalizer (alexsegura)
This PR was merged into the 2.5-dev branch. Discussion ---------- [Component][Serializer] Add fluent interface to GetSetMethodNormalizer | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | N/A | License | MIT | Doc PR | N/A Commits ------- 2d42533 [Component][Serializer] Add fluent interface to GetSetMethodNormalizer
2 parents bc38d76 + 2d42533 commit f15ea50

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Symfony/Component/Serializer/Normalizer/GetSetMethodNormalizer.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer implements Normal
4646
* @param callable[] $callbacks help normalize the result
4747
*
4848
* @throws InvalidArgumentException if a non-callable callback is set
49+
*
50+
* @return GetSetMethodNormalizer
4951
*/
5052
public function setCallbacks(array $callbacks)
5153
{
@@ -55,26 +57,36 @@ public function setCallbacks(array $callbacks)
5557
}
5658
}
5759
$this->callbacks = $callbacks;
60+
61+
return $this;
5862
}
5963

6064
/**
6165
* Set ignored attributes for normalization
6266
*
6367
* @param array $ignoredAttributes
68+
*
69+
* @return GetSetMethodNormalizer
6470
*/
6571
public function setIgnoredAttributes(array $ignoredAttributes)
6672
{
6773
$this->ignoredAttributes = $ignoredAttributes;
74+
75+
return $this;
6876
}
6977

7078
/**
7179
* Set attributes to be camelized on denormalize
7280
*
7381
* @param array $camelizedAttributes
82+
*
83+
* @return GetSetMethodNormalizer
7484
*/
7585
public function setCamelizedAttributes(array $camelizedAttributes)
7686
{
7787
$this->camelizedAttributes = $camelizedAttributes;
88+
89+
return $this;
7890
}
7991

8092
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy