8000 [PropertyAccess] remove deprecations for 3.0 by Tobion · Pull Request #13752 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[PropertyAccess] remove deprecations for 3.0 #13752

New is 8000 sue

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 1 commit into from
Feb 23, 2015
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,15 @@ class UnexpectedTypeException extends RuntimeException
* @param PropertyPathInterface $path The property path
* @param int $pathIndex The property path index when the unexpected value was found
*/
public function __construct($value, $path, $pathIndex = null)
public function __construct($value, PropertyPathInterface $path, $pathIndex)
{
if (func_num_args() === 3 && $path instanceof PropertyPathInterface) {
$message = sprintf(
'PropertyAccessor requires a graph of objects or arrays to operate on, '.
'but it found type "%s" while trying to traverse path "%s" at property "%s".',
gettype($value),
(string) $path,
$path->getElement($pathIndex)
);
} else {
trigger_error('The '.__CLASS__.' constructor now expects 3 arguments: the invalid property value, the '.__NAMESPACE__.'\PropertyPathInterface object and the current index of the property path.', E_USER_DEPRECATED);

$message = sprintf(
'Expected argument of type "%s", "%s" given',
$path,
is_object($value) ? get_class($value) : gettype($value)
);
}
$message = sprintf(
'PropertyAccessor requires a graph of objects or arrays to operate on, '.
'but it found type "%s" while trying to traverse path "%s" at property "%s".',
gettype($value),
(string) $path,
$path->getElement($pathIndex)
);

parent::__construct($message);
}
Expand Down
15 changes: 0 additions & 15 deletions src/Symfony/Component/PropertyAccess/PropertyAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,6 @@ public static function createPropertyAccessorBuilder()
return new PropertyAccessorBuilder();
}

/**
* Alias of {@link createPropertyAccessor}.
*
* @return PropertyAccessor The new property accessor
*
* @deprecated since version 2.3, to be removed in 3.0.
* Use {@link createPropertyAccessor()} instead.
*/
public static function getPropertyAccessor()
{
trigger_error('The '.__METHOD__.' method is deprecated since version 2.3 and will be removed in 3.0. Use the createPropertyAccessor() method instead.', E_USER_DEPRECATED);

return self::createPropertyAccessor();
}

/**
* This class cannot be instantiated.
*/
Expand Down
0