Skip to content

Commit 7648be8

Browse files
committed
Add fluent interface to AbstractNormalizer
1 parent cdd0009 commit 7648be8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ public function __construct(ClassMetadataFactory $classMetadataFactory = null)
4141
*
4242
* @param array $callbacks help normalize the result
4343
*
44+
* @return self
45+
*
4446
* @throws InvalidArgumentException if a non-callable callback is set
4547
*/
4648
public function setCallbacks(array $callbacks)
@@ -54,26 +56,36 @@ public function setCallbacks(array $callbacks)
5456
}
5557
}
5658
$this->callbacks = $callbacks;
59+
60+
return $this;
5761
}
5862

5963
/**
6064
* Set ignored attributes for normalization and denormalization.
6165
*
6266
* @param array $ignoredAttributes
67+
*
68+
* @return self
6369
*/
6470
public function setIgnoredAttributes(array $ignoredAttributes)
6571
{
6672
$this->ignoredAttributes = $ignoredAttributes;
73+
74+
return $this;
6775
}
6876

6977
/**
7078
* Set attributes to be camelized on denormalize.
7179
*
7280
* @param array $camelizedAttributes
81+
*
82+
* @return self
7383
*/
7484
public function setCamelizedAttributes(array $camelizedAttributes)
7585
{
7686
$this->camelizedAttributes = $camelizedAttributes;
87+
88+
return $this;
7789
}
7890

7991
/**

0 commit comments

Comments
 (0)