From 3bc87b58dee796bba24e8430dc81f3bc63219bec Mon Sep 17 00:00:00 2001 From: Tobias Schultze Date: Sat, 21 Feb 2015 15:31:23 +0100 Subject: [PATCH] [PropertyAccess] remove deprecations --- .../Exception/UnexpectedTypeException.php | 26 ++++++------------- .../PropertyAccess/PropertyAccess.php | 15 ----------- 2 files changed, 8 insertions(+), 33 deletions(-) diff --git a/src/Symfony/Component/PropertyAccess/Exception/UnexpectedTypeException.php b/src/Symfony/Component/PropertyAccess/Exception/UnexpectedTypeException.php index 5b87244f9d28..d238d3276d17 100644 --- a/src/Symfony/Component/PropertyAccess/Exception/UnexpectedTypeException.php +++ b/src/Symfony/Component/PropertyAccess/Exception/UnexpectedTypeException.php @@ -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); } diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccess.php b/src/Symfony/Component/PropertyAccess/PropertyAccess.php index 91f2ec371e0e..6c9bb423d021 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccess.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccess.php @@ -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. */