8000 minor #12102 minor [Serializer] Fix CS. Uniformize PHPDoc. (dunglas) · symfony/symfony@b5c4d54 · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b5c4d54

Browse files
committed
minor #12102 minor [Serializer] Fix CS. Uniformize PHPDoc. (dunglas)
This PR was merged into the 2.6-dev branch. Discussion ---------- minor [Serializer] Fix CS. Uniformize PHPDoc. | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | License | MIT Commits ------- 5be84c4 [Serializer] Fix CS. Uniformize PHPDoc.
2 parents 8a5f824 + 5be84c4 commit b5c4d54

20 files changed

+99
-75
lines changed

src/Symfony/Component/Serializer/Encoder/ChainDecoder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function supportsDecoding($format)
5858
* @param string $format
5959
*
6060
* @return DecoderInterface
61+
*
6162
* @throws RuntimeException if no decoder is found
6263
*/
6364
private function getDecoder($format)

src/Symfony/Component/Serializer/Encoder/ChainEncoder.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public function needsNormalization($format)
8080
* @param string $format
8181
*
8282
* @return EncoderInterface
83+
*
8384
* @throws RuntimeException if no encoder is found
8485
*/
8586
private function getEncoder($format)

src/Symfony/Component/Serializer/Encoder/DecoderInterface.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
1515

1616
/**
17-
* Defines the interface of decoders
17+
* Defines the interface of decoders.
1818
*
1919
* @author Jordi Boggiano <j.boggiano@seld.be>
2020
*/
@@ -23,9 +23,9 @@ interface DecoderInterface
2323
/**
2424
* Decodes a string into PHP data.
2525
*
26-
* @param scalar $data Data to decode
27-
* @param string $format Format name
28-
* @param array $context options that decoders have access to.
26+
* @param scalar $data Data to decode
27+
* @param string $format Format name
28+
* @param array $context options that decoders have access to.
2929
*
3030
* The format parameter specifies which format the data is in; valid values
3131
* depend on the specific implementation. Authors implementing this interface

src/Symfony/Component/Serializer/Encoder/EncoderInterface.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
1515

1616
/**
17-
* Defines the interface of encoders
17+
* Defines the interface of encoders.
1818
*
1919
* @author Jordi Boggiano <j.boggiano@seld.be>
2020
*/
2121
interface EncoderInterface
2222
{
2323
/**
24-
* Encodes data into the given format
24+
* Encodes data into the given format.
2525
*
26-
* @param mixed $data Data to encode
27-
* @param string $format Format name
26+
* @param mixed $data Data to encode
27+
* @param string $format Format name
2828
* @param array $context options that normalizers/encoders have access to.
2929
*
3030
* @return scalar
@@ -34,7 +34,7 @@ interface EncoderInterface
3434
public function encode($data, $format, array $context = array());
3535

3636
/**
37-
* Checks whether the serializer can encode to given format
37+
* Checks whether the serializer can encode to given format.
3838
*
3939
* @param string $format format name
4040
*

src/Symfony/Component/Serializer/Encoder/JsonDecode.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ class JsonDecode implements DecoderInterface
4141
/**
4242
* Constructs a new JsonDecode instance.
4343
*
44-
* @param bool $associative True to return the result associative array, false for a nested stdClass hierarchy
45-
* @param int $depth Specifies the recursion depth
44+
* @param bool $associative True to return the result associative array, false for a nested stdClass hierarchy
45+
* @param int $depth Specifies the recursion depth
4646
*/
4747
public function __construct($associative = false, $depth = 512)
4848
{

src/Symfony/Component/Serializer/Encoder/JsonEncode.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
1515

1616
/**
17-
* Encodes JSON data
17+
* Encodes JSON data.
1818
*
1919
* @author Sander Coolen <sander@jibber.nl>
2020
*/
@@ -43,7 +43,7 @@ public function getLastError()
4343
}
4444

4545
/**
46-
* Encodes PHP data to a JSON string
46+
* Encodes PHP data to a JSON string.
4747
*
4848
* {@inheritdoc}
4949
*/
@@ -71,7 +71,8 @@ public function supportsEncoding($format)
7171
/**
7272
* Merge default json encode options with context.
7373
*
74-
* @param array $context
74+
* @param array $context
75+
*
7576
* @return array
7677
*/
7778
private function resolveContext(array $context = array())

src/Symfony/Component/Serializer/Encoder/JsonEncoder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function __construct(JsonEncode $encodingImpl = null, JsonDecode $decodin
3737
}
3838

3939
/**
40-
* Returns the last encoding error (if any)
40+
* Returns the last encoding error (if any).
4141
*
4242
* @return int
4343
*
@@ -49,7 +49,7 @@ public function getLastEncodingError()
4949
}
5050

5151
/**
52-
* Returns the last decoding error (if any)
52+
* Returns the last decoding error (if any).
5353
*
5454
* @return int
5555
*

src/Symfony/Component/Serializer/Encoder/NormalizationAwareInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\Serializer\Encoder;
1313

1414
/**
15-
* Defines the interface of encoders that will normalize data themselves
15+
* Defines the interface of encoders that will normalize data themselves.
1616
*
1717
* Implementing this interface essentially just tells the Serializer that the
1818
* data should not be pre-normalized before being passed to this Encoder.

src/Symfony/Component/Serializer/Encoder/SerializerAwareEncoder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\Serializer\SerializerAwareInterface;
1616

1717
/**
18-
* SerializerAware Encoder implementation
18+
* SerializerAware Encoder implementation.
1919
*
2020
* @author Jordi Boggiano <j.boggiano@seld.be>
2121
*/

src/Symfony/Component/Serializer/Encoder/XmlEncoder.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\Serializer\Exception\UnexpectedValueException;
1515

1616
/**
17-
* Encodes XML data
17+
* Encodes XML data.
1818
*
1919
* @author Jordi Boggiano <j.boggiano@seld.be>
2020
* @author John Wards <jwards@whiteoctober.co.uk>
@@ -146,7 +146,7 @@ public function supportsDecoding($format)
146146
}
147147

148148
/**
149-
* Sets the root node name
149+
* Sets the root node name.
150150
*
151151
* @param string $name root node name
152152
*/
@@ -156,7 +156,8 @@ public function setRootNodeName($name)
156156
}
157157

158158
/**
159-
* Returns the root node name
159+
* Returns the root node name.
160+
*
160161
* @return string
161162
*/
162163
public function getRootNodeName()
@@ -229,7 +230,7 @@ final protected function appendDocumentFragment(\DOMNode $node, $fragment)
229230
}
230231

231232
/**
232-
* Checks the name is a valid xml element name
233+
* Checks the name is a valid xml element name.
233234
*
234235
* @param string $name
235236
*
@@ -279,7 +280,7 @@ private function parseXml(\DOMNode $node)
279280
}
280281

281282
/**
282-
* Parse the input DOMNode attributes into an array
283+
* Parse the input DOMNode attributes into an array.
283284
*
284285
* @param \DOMNode $node xml to parse
285286
*
@@ -305,7 +306,7 @@ private function parseXmlAttributes(\DOMNode $node)
305306
}
306307

307308
/**
308-
* Parse the input DOMNode value (content and children) into an array or a string
309+
* Parse the input DOMNode value (content and children) into an array or a string.
309310
*
310311
* @param \DOMNode $node xml to parse
311312
*
@@ -347,7 +348,7 @@ private function parseXmlValue(\DOMNode $node)
347348
}
348349

349350
/**
350-
* Parse the data and convert it to DOMElements
351+
* Parse the data and convert it to DOMElements.
351352
*
352353
* @param \DOMNode $parentNode
353354
* @param array|object $data
@@ -452,7 +453,7 @@ private function needsCdataWrapping($val)
452453
}
453454

454455
/**
455-
* Tests the value being passed and decide what sort of element to create
456+
* Tests the value being passed and decide what sort of element to create.
456457
*
457458
* @param \DOMNode $node
458459
* @param mixed $val
@@ -488,6 +489,10 @@ private function selectNodeType(\DOMNode $node, $val)
488489

489490
/**
490491
* Get real XML root node name, taking serializer options into account.
492+
*
493+
* @param array $context
494+
*
495+
* @return string
491496
*/
492497
private function resolveXmlRootName(array $context = array())
493498
{

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
namespace Symfony\Component\Serializer\Normalizer;
1313

1414
/**
15-
* Defines the most basic interface a class must implement to be denormalizable
15+
* Defines the most basic interface a class must implement to be denormalizable.
1616
*
1717
* If a denormalizer is registered for the class and it doesn't implement
1818
* the Denormalizable interfaces, the normalizer will be used instead
@@ -28,11 +28,11 @@ interface DenormalizableInterface
2828
* recursively all child objects of the implementor.
2929
*
3030
* @param DenormalizerInterface $denormalizer The denormalizer is given so that you
31-
* can use it to denormalize objects contained within this object.
32-
* @param array|scalar $data The data from which to re-create the object.
33-
* @param string|null $format The format is optionally given to be able to denormalize differently
34-
* based on different input formats.
35-
* @param array $context options for denormalizing
31+
* can use it to denormalize objects contained within this object.
32+
* @param array|scalar $data The data from which to re-create the object.
33+
* @param string|null $format The format is optionally given to be able to denormalize differently
34+
* based on different input formats.
35+
* @param array $context options for denormalizing.
3636
*/
3737
public function denormalize(DenormalizerInterface $denormalizer, $data, $format = null, array $context = array());
3838
}

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,19 @@
1919
interface DenormalizerInterface
2020
{
2121
/**
22-
* Denormalizes data back into an object of the given class
22+
* Denormalizes data back into an object of the given class.
2323
*
24-
* @param mixed $data data to restore
25-
* @param string $class the expected class to instantiate
26-
* @param string $format format the given data was extracted from
24+
* @param mixed $data data to restore
25+
* @param string $class the expected class to instantiate
26+
* @param string $format format the given data was extracted from
2727
* @param array $context options available to the denormalizer
2828
*
2929
* @return object
3030
*/
3131
public function denormalize($data, $class, $format = null, array $context = array());
3232

3333
/**
34-
* Checks whether the given class is supported for denormalization by this normalizer
34+
* Checks whether the given class is supported for denormalization by this normalizer.
3535
*
3636
* @param mixed $data Data to denormalize from.
3737
* @param string $type The class to which the data should be denormalized.

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer implements Normal
4747
*
4848
* @throws InvalidArgumentException if a non-callable callback is set
4949
*
50-
* @return GetSetMethodNormalizer
50+
* @return self
5151
*/
5252
public function setCallbacks(array $callbacks)
5353
{
@@ -62,11 +62,11 @@ public function setCallbacks(array $callbacks)
6262
}
6363

6464
/**
65-
* Set ignored attributes for normalization
65+
* Set ignored attributes for normalization.
6666
*
6767
* @param array $ignoredAttributes
6868
*
69-
* @return GetSetMethodNormalizer
69+
* @return self
7070
*/
7171
public function setIgnoredAttributes(array $ignoredAttributes)
7272
{
@@ -76,11 +76,11 @@ public function setIgnoredAttributes(array $ignoredAttributes)
7676
}
7777

7878
/**
79-
* Set attributes to be camelized on denormalize
79+
* Set attributes to be camelized on denormalize.
8080
*
8181
* @param array $camelizedAttributes
8282
*
83-
* @return GetSetMethodNormalizer
83+
* @return self
8484
*/
8585
public function setCamelizedAttributes(array $camelizedAttributes)
8686
{
@@ -185,9 +185,10 @@ public function denormalize($data, $class, $format = null, array $context = arra
185185
/**
186186
* Format attribute name to access parameters or methods
187187
* As option, if attribute name is found on camelizedAttributes array
188-
* returns attribute name in camelcase format
188+
* returns attribute name in camelcase format.
189+
*
190+
* @param string $attributeName
189191
*
190-
* @param string $attributeName
191192
* @return string
192193
*/
193194
protected function formatAttribute($attributeName)

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
namespace Symfony\Component\Serializer\Normalizer;
1313

1414
/**
15-
* Defines the most basic interface a class must implement to be normalizable
15+
* Defines the most basic interface a class must implement to be normalizable.
1616
*
1717
* If a normalizer is registered for the class and it doesn't implement
18-
* the Normalizable interfaces, the normalizer will be used instead
18+
* the Normalizable interfaces, the normalizer will be used instead.
1919
*
2020
* @author Jordi Boggiano <j.boggiano@seld.be>
2121
*/
@@ -28,10 +28,10 @@ interface NormalizableInterface
2828
* recursively all child objects of the implementor.
2929
*
3030
* @param NormalizerInterface $normalizer The normalizer is given so that you
31-
* can use it to normalize objects contained within this object.
32-
* @param string|null $format The format is optionally given to be able to normalize differently
33-
* based on different output formats.
34-
* @param array $context Options for normalizing this object
31+
* can use it to normalize objects contained within this object.
32+
* @param string|null $format The format is optionally given to be able to normalize differently
33+
* based on different output formats.
34+
* @param array $context Options for normalizing this object
3535
*
3636
* @return array|scalar
3737
*/

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
interface NormalizerInterface
2020
{
2121
/**
22-
* Normalizes an object into a set of arrays/scalars
22+
* Normalizes an object into a set of arrays/scalars.
2323
*
24-
* @param object $object object to normalize
25-
* @param string $format format the normalization result will be encoded as
26-
* @param array $context Context options for the normalizer
24+
* @param object $object object to normalize
25+
* @param string $format format the normalization result will be encoded as
26+
* @param array $context Context options for the normalizer
2727
*
2828
* @return array|scalar
2929
*/
3030
public function normalize($object, $format = null, array $context = array());
3131

3232
/**
33-
* Checks whether the given class is supported for normalization by this normalizer
33+
* Checks whether the given class is supported for normalization by this normalizer.
3434
*
3535
* @param mixed $data Data to normalize.
3636
* @param string $format The format being (de-)serialized from or into.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function setCallbacks(array $callbacks)
5757
}
5858

5959
/**
60-
* Set ignored attributes for normalization
60+
* Set ignored attributes for normalization.
6161
*
6262
* @param array $ignoredAttributes
6363
*/
@@ -180,7 +180,7 @@ public function supportsDenormalization($data, $type, $format = null)
180180
/**
181181
* Format an attribute name, for example to convert a snake_case name to camelCase.
182182
*
183-
* @param string $attributeName
183+
* @param string $attributeName
184184
* @return string
185185
*/
186186
protected function formatAttribute($attributeName)

0 commit comments

Comments
 (0)
0