8000 Fix param docs for PropertyAccessor read method by jmikola · Pull Request #7498 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Fix param docs for PropertyAccessor read method #7498

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

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Symfony/Component/PropertyAccess/PropertyAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ final class PropertyAccess
/**
* Creates a property accessor with the default configuration.
*
* @return PropertyAccessor The new property accessor.
* @return PropertyAccessor The new property accessor
*/
public static function getPropertyAccessor()
{
Expand Down
54 changes: 27 additions & 27 deletions src/Symfony/Component/PropertyAccess/PropertyAccessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ public function setValue(&$objectOrArray, $propertyPath, $value)
/**
* Reads the path from an object up to a given path index.
*
* @param object|array $objectOrArray The object or array to read from.
* @param PropertyPathInterface $propertyPath The property path to read.
* @param integer $lastIndex The integer up to which should be read.
* @param object|array $objectOrArray The object or array to read from
* @param PropertyPathInterface $propertyPath The property path to read
* @param integer $lastIndex The index up to which should be read
*
* @return array The values read in the path.
*
Expand Down Expand Up @@ -139,12 +139,12 @@ private function &readPropertiesUntil(&$objectOrArray, PropertyPathInterface $pr
/**
* Reads a key from an array-like structure.
*
* @param \ArrayAccess|array $array The array or \ArrayAccess object to read from.
* @param string|integer $index The key to read.
* @param \ArrayAccess|array $array The array or \ArrayAccess object to read from
* @param string|integer $index The key to read
*
* @return mixed The value of the key
*
* @throws NoSuchPropertyException If the array does not implement \ArrayAccess or it is not an array.
* @throws NoSuchPropertyException If the array does not implement \ArrayAccess or it is not an array
*/
private function &readIndex(&$array, $index)
{
Expand Down Expand Up @@ -180,9 +180,9 @@ private function &readIndex(&$array, $index)
*
* @return mixed The value of the read property
*
* @throws NoSuchPropertyException If the property does not exist.
* @throws NoSuchPropertyException If the property does not exist
* @throws PropertyAccessDeniedException If the property cannot be accessed due to
* access restrictions (private or protected).
* access restrictions (private or protected)
*/
private function &readProperty(&$object, $property)
{
Expand Down Expand Up @@ -250,11 +250,11 @@ private function &readProperty(&$object, $property)
/**
* Sets the value of the property at the given index in the path
*
* @param \ArrayAccess|array $array An array or \ArrayAccess object to write to.
* @param string|integer $index The index to write at.
* @param mixed $value The value to write.
* @param \ArrayAccess|array $array An array or \ArrayAccess object to write to
* @param string|integer $index The index to write at
* @param mixed $value The value to write
*
* @throws NoSuchPropertyException If the array does not implement \ArrayAccess or it is not an array.
* @throws NoSuchPropertyException If the array does not implement \ArrayAccess or it is not an array
*/
private function writeIndex(&$array, $index, $value)
{
Expand All @@ -268,14 +268,14 @@ private function writeIndex(&$array, $index, $value)
/**
* Sets the value of the property at the given index in the path
*
* @param object|array $object The object or array to write to.
* @param string $property The property to write.
* @param string|null $singular The singular form of the property name or null.
* @param mixed $value The value to write.
* @param object|array $object The object or array to write to
* @param string $property The property to write
* @param string|null $singular The singular form of the property name or null
* @param mixed $value The value to write
*
* @throws NoSuchPropertyException If the property does not exist.
* @throws NoSuchPropertyException If the property does not exist
* @throws PropertyAccessDeniedException If the property cannot be accessed due to
* access restrictions (private or protected).
* access restrictions (private or protected)
*/
private function writeProperty(&$object, $property, $singular, $value)
{
Expand Down Expand Up @@ -368,9 +368,9 @@ private function writeProperty(&$object, $property, $singular, $value)
/**
* Camelizes a given string.
*
* @param string $string Some string.
* @param string $string Some string
*
* @return string The camelized version of the string.
* @return string The camelized version of the string
*/
private function camelize($string)
{
Expand All @@ -381,11 +381,11 @@ private function camelize($string)
* Searches for add and remove methods.
*
* @param \ReflectionClass $reflClass The reflection class for the given object
* @param array $singulars The singular form of the property name or null.
* @param array $singulars The singular form of the property name or null
*
* @return array|null An array containing the adder and remover when found, null otherwise.
* @return array|null An array containing the adder and remover when found, null otherwise
*
* @throws NoSuchPropertyException If the property does not exist.
* @throws NoSuchPropertyException If the property does not exist
*/
private function findAdderAndRemover(\ReflectionClass $reflClass, array $singulars)
{
Expand Down Expand Up @@ -416,12 +416,12 @@ private function findAdderAndRemover(\ReflectionClass $reflClass, array $singula
10000 /**
* Returns whether a method is public and has a specific number of required parameters.
*
* @param \ReflectionClass $class The class of the method.
* @param string $methodName The method name.
* @param integer $parameters The number of parameters.
* @param \ReflectionClass $class The class of the method
* @param string $methodName The method name
* @param integer $parameters The number of parameters
*
* @return Boolean Whether the method is public and has $parameters
* required parameters.
* required parameters
*/
private function isAccessible(\ReflectionClass $class, $methodName, $parameters)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ interface PropertyAccessorInterface
*
* If neither is found, an exception is thrown.
*
* @param object|array $objectOrArray The object or array to modify.
* @param string|PropertyPathInterface $propertyPath The property path to modify.
* @param mixed $value The value to set at the end of the property path.
* @param object|array $objectOrArray The object or array to modify
* @param string|PropertyPathInterface $propertyPath The property path to modify
* @param mixed $value The value to set at the end of the property path
*
* @throws Exception\NoSuchPropertyException If a property does not exist.
* @throws Exception\NoSuchPropertyException If a property does not exist
* @throws Exception\PropertyAccessDeniedException If a property cannot be accessed due to
* access restrictions (private or protected).
* access restrictions (private or protected)
* @throws Exception\UnexpectedTypeException If a value within the path is neither object
* nor array.
* nor array
*/
public function setValue(&$objectOrArray, $propertyPath, $value);

Expand All @@ -73,7 +73,7 @@ public function setValue(&$objectOrArray, $propertyPath, $value);
* If none of them are found, an exception is thrown.
*
* @param object|array $objectOrArray The object or array to traverse
* @param string|PropertyPathInterface $propertyPath The property path to modify.
* @param string|PropertyPathInterface $propertyPath The property path to read
*
* @return mixed The value at the end of the property path
*
Expand Down
6 changes: 3 additions & 3 deletions src/Symfony/Component/PropertyAccess/PropertyPath.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
/**
* Constructs a property path from a string.
*
* @param PropertyPath|string $propertyPath The property path as string or instance.
* @param PropertyPath|string $propertyPath The property path as string or instance
*
* @throws UnexpectedTypeException If the given path is not a string.
* @throws InvalidPropertyPathException If the syntax of the property path is not valid.
* @throws UnexpectedTypeException If the given path is not a string
* @throws InvalidPropertyPathException If the syntax of the property path is not valid
*/
public function __construct($propertyPath)
{
Expand Down
42 changes: 21 additions & 21 deletions src/Symfony/Component/PropertyAccess/PropertyPathBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ public function __construct(PropertyPathInterface $path = null)
/**
* Appends a (sub-) path to the current path.
*
* @param PropertyPathInterface $path The path to append.
* @param PropertyPathInterface $path The path to append
* @param integer $offset The offset where the appended piece
* starts in $path.
* starts in $path
* @param integer $length The length of the appended piece.
* If 0, the full path is appended.
*/
Expand All @@ -67,7 +67,7 @@ public function append(PropertyPathInterface $path, $offset = 0, $length = 0)
/**
* Appends an index element to the current path.
*
* @param string $name The name of the appended index.
* @param string $name The name of the appended index
*/
public function appendIndex($name)
{
Expand All @@ -78,7 +78,7 @@ public function appendIndex($name)
/**
* Appends a property element to the current path.
*
* @param string $name The name of the appended property.
* @param string $name The name of the appended property
*/
public function appendProperty($name)
{
Expand All @@ -89,8 +89,8 @@ public function appendProperty($name)
/**
* Removes elements from the current path.
*
* @param integer $offset The offset at which to remove.
* @param integer $length The length of the removed piece.
* @param integer $offset The offset at which to remove
* @param integer $length The length of the removed piece
*
* @throws OutOfBoundsException if offset is invalid
*/
Expand All @@ -106,15 +106,15 @@ public function remove($offset, $length = 1)
/**
* Replaces a sub-path by a different (sub-) path.
*
* @param integer $offset The offset at which to replace.
* @param integer $length The length of the piece to replace.
* @param PropertyPathInterface $path The path to insert.
* @param integer $offset The offset at which to replace
* @param integer $length The length of the piece to replace
* @param PropertyPathInterface $path The path to insert
* @param integer $pathOffset The offset where the inserted piece
* starts in $path.
* starts in $path
* @param integer $pathLength The length of the inserted piece.
* If 0, the full path is inserted.
*
* @throws OutOfBoundsException If the offset is invalid.
* @throws OutOfBoundsException If the offset is invalid
*/
public function replace($offset, $length, PropertyPathInterface $path, $pathOffset = 0, $pathLength = 0)
{
Expand All @@ -137,10 +137,10 @@ public function replace($offset, $length, PropertyPathInterface $path, $pathOffs
/**
* Replaces a property element by an index element.
*
* @param integer $offset The offset at which to replace.
* @param integer $offset The offset at which to replace
* @param string $name The new name of the element. Optional.
*
* @throws OutOfBoundsException If the offset is invalid.
* @throws OutOfBoundsException If the offset is invalid
*/
public function replaceByIndex($offset, $name = null)
{
Expand All @@ -158,10 +158,10 @@ public function replaceByIndex($offset, $name = null)
/**
* Replaces an index element by a property element.
*
* @param integer $offset The offset at which to replace.
* @param integer $offset The offset at which to replace
* @param string $name The new name of the element. Optional.
*
* @throws OutOfBoundsException If the offset is invalid.
* @throws OutOfBoundsException If the offset is invalid
*/
public function replaceByProperty($offset, $name = null)
{
Expand All @@ -179,7 +179,7 @@ public function replaceByProperty($offset, $name = null)
/**
* Returns the length of the current path.
*
* @return integer The path length.
* @return integer The path length
*/
public function getLength()
{
Expand All @@ -189,7 +189,7 @@ public function getLength()
/**
* Returns the current property path.
*
* @return PropertyPathInterface The constructed property path.
* @return PropertyPathInterface The constructed property path
*/
public function getPropertyPath()
{
Expand All @@ -201,7 +201,7 @@ public function getPropertyPath()
/**
* Returns the current property path as string.
*
* @return string The property path as string.
* @return string The property path as string
*/
public function __toString()
{
Expand All @@ -225,9 +225,9 @@ public function __toString()
* removed at $offset and another chunk of length $insertionLength
* can be inserted.
*
* @param integer $offset The offset where the removed chunk starts.
* @param integer $cutLength The length of the removed chunk.
* @param integer $insertionLength The length of the inserted chunk.
* @param integer $offset The offset where the removed chunk starts
* @param integer $cutLength The length of the removed chunk
* @param integer $insertionLength The length of the inserted chunk
*/
private function resize($offset, $cutLength, $insertionLength)
{
Expand Down
12 changes: 6 additions & 6 deletions src/Symfony/Component/PropertyAccess/PropertyPathInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ interface PropertyPathInterface extends \Traversable
/**
* Returns the string representation of the property path
*
* @return string The path as string.
* @return string The path as string
*/
public function __toString();

/**
* Returns the length of the property path, i.e. the number of elements.
*
* @return integer The path length.
* @return integer The path length
*/
public function getLength();

Expand All @@ -40,7 +40,7 @@ public function getLength();
*
* If this property path only contains one item, null is returned.
*
* @return PropertyPath The parent path or null.
* @return PropertyPath The parent path or null
*/
public function getParent();

Expand All @@ -58,7 +58,7 @@ public function getElements();
*
* @return string A property or index name
*
* @throws Exception\OutOfBoundsException If the offset is invalid.
* @throws Exception\OutOfBoundsException If the offset is invalid
*/
public function getElement($index);

Expand All @@ -69,7 +69,7 @@ public function getElement($index);
*
* @return Boolean Whether the element at this index is a property
*
* @throws Exception\OutOfBoundsException If the offset is invalid.
* @throws Exception\OutOfBoundsException If the offset is invalid
*/
public function isProperty($index);

Expand All @@ -80,7 +80,7 @@ public function isProperty($index);
*
* @return Boolean Whether the element at this index is an array index
*
* @throws Exception\OutOfBoundsException If the offset is invalid.
* @throws Exception\OutOfBoundsException If the offset is invalid
*/
public function isIndex($index);
}
0