Skip to content

Commit 5be84c4

Browse files
committed
[Serializer] Fix CS. Uniformize PHPDoc.
1 parent d318e09 commit 5be84c4

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
{

0 commit comments

Comments
 (0)