-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
minor [Serializer] Fix CS. Uniformize PHPDoc. #12102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
use Symfony\Component\Serializer\Exception\UnexpectedValueException; | ||
|
||
/** | ||
* Defines the interface of decoders | ||
* Defines the interface of decoders. | ||
* | ||
* @author Jordi Boggiano <[email protected]> | ||
*/ | ||
|
@@ -23,9 +23,9 @@ interface DecoderInterface | |
/** | ||
* Decodes a string into PHP data. | ||
* | ||
* @param scalar $data Data to decode | ||
* @param string $format Format name | ||
* @param array $context options that decoders have access to. | ||
* @param scalar $data Data to decode | ||
* @param string $format Format name | ||
* @param array $context options that decoders have access to. | ||
* | ||
* The format parameter specifies which format the data is in; valid values | ||
* depend on the specific implementation. Authors implementing this interface | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,17 +14,17 @@ | |
use Symfony\Component\Serializer\Exception\UnexpectedValueException; | ||
|
||
/** | ||
* Defines the interface of encoders | ||
* Defines the interface of encoders. | ||
* | ||
* @author Jordi Boggiano <[email protected]> | ||
*/ | ||
interface EncoderInterface | ||
{ | ||
/** | ||
* Encodes data into the given format | ||
* Encodes data into the given format. | ||
* | ||
* @param mixed $data Data to encode | ||
* @param string $format Format name | ||
* @param mixed $data Data to encode | ||
* @param string $format Format name | ||
* @param array $context options that normalizers/encoders have access to. | ||
* | ||
* @return scalar | ||
|
@@ -34,7 +34,7 @@ interface EncoderInterface | |
public function encode($data, $format, array $context = array()); | ||
|
||
/** | ||
* Checks whether the serializer can encode to given format | ||
* Checks whether the serializer can encode to given format. | ||
* | ||
* @param string $format format name | ||
* | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
use Symfony\Component\Serializer\Exception\UnexpectedValueException; | ||
|
||
/** | ||
* Encodes JSON data | ||
* Encodes JSON data. | ||
* | ||
* @author Sander Coolen <[email protected]> | ||
*/ | ||
|
@@ -43,7 +43,7 @@ public function getLastError() | |
} | ||
|
||
/** | ||
* Encodes PHP data to a JSON string | ||
* Encodes PHP data to a JSON string. | ||
* | ||
* {@inheritdoc} | ||
*/ | ||
|
@@ -71,7 +71,8 @@ public function supportsEncoding($format) | |
/** | ||
* Merge default json encode options with context. | ||
* | ||
* @param array $context | ||
* @param array $context | ||
* | ||
* @return array | ||
*/ | ||
private function resolveContext(array $context = array()) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
use Symfony\Component\Serializer\SerializerAwareInterface; | ||
|
||
/** | ||
* SerializerAware Encoder implementation | ||
* SerializerAware Encoder implementation. | ||
* | ||
* @author Jordi Boggiano <[email protected]> | ||
*/ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,7 @@ | |
use Symfony\Component\Serializer\Exception\UnexpectedValueException; | ||
|
||
/** | ||
* Encodes XML data | ||
* Encodes XML data. | ||
* | ||
* @author Jordi Boggiano <[email protected]> | ||
* @author John Wards <[email protected]> | ||
|
@@ -146,7 +146,7 @@ public function supportsDecoding($format) | |
} | ||
|
||
/** | ||
* Sets the root node name | ||
* Sets the root node name. | ||
* | ||
* @param string $name root node name | ||
*/ | ||
|
@@ -156,7 +156,8 @@ public function setRootNodeName($name) | |
} | ||
|
||
/** | ||
* Returns the root node name | ||
* Returns the root node name. | ||
* | ||
* @return string | ||
*/ | ||
public function getRootNodeName() | ||
|
@@ -229,7 +230,7 @@ final protected function appendDocumentFragment(\DOMNode $node, $fragment) | |
} | ||
|
||
/** | ||
* Checks the name is a valid xml element name | ||
* Checks the name is a valid xml element name. | ||
* | ||
* @param string $name | ||
* | ||
|
@@ -279,7 +280,7 @@ private function parseXml(\DOMNode $node) | |
} | ||
|
||
/** | ||
* Parse the input DOMNode attributes into an array | ||
* Parse the input DOMNode attributes into an array. | ||
* | ||
* @param \DOMNode $node xml to parse | ||
* | ||
|
@@ -305,7 +306,7 @@ private function parseXmlAttributes(\DOMNode $node) | |
} | ||
|
||
/** | ||
* Parse the input DOMNode value (content and children) into an array or a string | ||
* Parse the input DOMNode value (content and children) into an array or a string. | ||
* | ||
* @param \DOMNode $node xml to parse | ||
* | ||
|
@@ -347,7 +348,7 @@ private function parseXmlValue(\DOMNode $node) | |
} | ||
|
||
/** | ||
* Parse the data and convert it to DOMElements | ||
* Parse the data and convert it to DOMElements. | ||
* | ||
* @param \DOMNode $parentNode | ||
* @param array|object $data | ||
|
@@ -452,7 +453,7 @@ private function needsCdataWrapping($val) | |
} | ||
|
||
/** | ||
* Tests the value being passed and decide what sort of element to create | ||
* Tests the value being passed and decide what sort of element to create. | ||
* | ||
* @param \DOMNode $node | ||
* @param mixed $val | ||
|
@@ -488,6 +489,10 @@ private function selectNodeType(\DOMNode $node, $val) | |
|
||
/** | ||
* Get real XML root node name, taking serializer options into account. | ||
* | ||
* @param array $context | ||
* | ||
* @return string | ||
*/ | ||
private function resolveXmlRootName(array $context = array()) | ||
{ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,7 @@ class GetSetMethodNormalizer extends SerializerAwareNormalizer implements Normal | |
* | ||
* @throws InvalidArgumentException if a non-callable callback is set | ||
* | ||
* @return GetSetMethodNormalizer | ||
* @return self | ||
*/ | ||
public function setCallbacks(array $callbacks) | ||
{ | ||
|
@@ -62,11 +62,11 @@ public function setCallbacks(array $callbacks) | |
} | ||
|
||
/** | ||
* Set ignored attributes for normalization | ||
* Set ignored attributes for normalization. | ||
* | ||
* @param array $ignoredAttributes | ||
* | ||
* @return GetSetMethodNormalizer | ||
* @return self | ||
*/ | ||
public function setIgnoredAttributes(array $ignoredAttributes) | ||
{ | ||
|
@@ -76,11 +76,11 @@ public function setIgnoredAttributes(array $ignoredAttributes) | |
} | ||
|
||
/** | ||
* Set attributes to be camelized on denormalize | ||
* Set attributes to be camelized on denormalize. | ||
* | ||
* @param array $camelizedAttributes | ||
* | ||
* @return GetSetMethodNormalizer | ||
* @return self | ||
*/ | ||
public function setCamelizedAttributes(array $camelizedAttributes) | ||
{ | ||
|
@@ -185,9 +185,10 @@ public function denormalize($data, $class, $format = null, array $context = arra | |
/** | ||
* Format attribute name to access parameters or methods | ||
* As option, if attribute name is found on camelizedAttributes array | ||
* returns attribute name in camelcase format | ||
* returns attribute name in camelcase format. | ||
* | ||
* @param string $attributeName | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should remove one space before |
||
* | ||
* @param string $attributeName | ||
* @return string | ||
*/ | ||
protected function formatAttribute($attributeName) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,10 +12,10 @@ | |
namespace Symfony\Component\Serializer\Normalizer; | ||
|
||
/** | ||
* Defines the most basic interface a class must implement to be normalizable | ||
* Defines the most basic interface a class must implement to be normalizable. | ||
* | ||
* If a normalizer is registered for the class and it doesn't implement | ||
* the Normalizable interfaces, the normalizer will be used instead | ||
* the Normalizable interfaces, the normalizer will be used instead. | ||
* | ||
* @author Jordi Boggiano <[email protected]> | ||
*/ | ||
|
@@ -28,10 +28,10 @@ interface NormalizableInterface | |
* recursively all child objects of the implementor. | ||
* | ||
* @param NormalizerInterface $normalizer The normalizer is given so that you | ||
* can use it to normalize objects contained within this object. | ||
* @param string|null $format The format is optionally given to be able to normalize differently | ||
* based on different output formats. | ||
* @param array $context Options for normalizing this object | ||
* can use it to normalize objects contained within this object. | ||
* @param string|null $format The format is optionally given to be able to normalize differently | ||
* based on different output formats. | ||
* @param array $context Options for normalizing this object | ||
* | ||
* @return array|scalar | ||
*/ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this change is actually wrong (PHP-CS-Fixer will revert it the next time we run it though)