Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3bc87b5

Browse filesBrowse files
committed
[PropertyAccess] remove deprecations
1 parent b05fce2 commit 3bc87b5
Copy full SHA for 3bc87b5

File tree

2 files changed

+8
-33
lines changed
Filter options

2 files changed

+8
-33
lines changed

‎src/Symfony/Component/PropertyAccess/Exception/UnexpectedTypeException.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyAccess/Exception/UnexpectedTypeException.php
+8-18Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,15 @@ class UnexpectedTypeException extends RuntimeException
2525
* @param PropertyPathInterface $path The property path
2626
* @param int $pathIndex The property path index when the unexpected value was found
2727
*/
28-
public function __construct($value, $path, $pathIndex = null)
28+
public function __construct($value, PropertyPathInterface $path, $pathIndex)
2929
{
30-
if (func_num_args() === 3 && $path instanceof PropertyPathInterface) {
31-
$message = sprintf(
32-
'PropertyAccessor requires a graph of objects or arrays to operate on, '.
33-
'but it found type "%s" while trying to traverse path "%s" at property "%s".',
34-
gettype($value),
35-
(string) $path,
36-
$path->getElement($pathIndex)
37-
);
38-
} else {
39-
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);
40-
41-
$message = sprintf(
42-
'Expected argument of type "%s", "%s" given',
43-
$path,
44-
is_object($value) ? get_class($value) : gettype($value)
45-
);
46-
}
30+
$message = sprintf(
31+
'PropertyAccessor requires a graph of objects or arrays to operate on, '.
32+
'but it found type "%s" while trying to traverse path "%s" at property "%s".',
33+
gettype($value),
34+
(string) $path,
35+
$path->getElement($pathIndex)
36+
);
4737

4838
parent::__construct($message);
4939
}

‎src/Symfony/Component/PropertyAccess/PropertyAccess.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyAccess/PropertyAccess.php
-15Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,6 @@ public static function createPropertyAccessorBuilder()
3838
return new PropertyAccessorBuilder();
3939
}
4040

41-
/**
42-
* Alias of {@link createPropertyAccessor}.
43-
*
44-
* @return PropertyAccessor The new property accessor
45-
*
46-
* @deprecated since version 2.3, to be removed in 3.0.
47-
* Use {@link createPropertyAccessor()} instead.
48-
*/
49-
public static function getPropertyAccessor()
50-
{
51-
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);
52-
53-
return self::createPropertyAccessor();
54-
}
55-
5641
/**
5742
* This class cannot be instantiated.
5843
*/

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.