merged branch bschussek/fix-property-access-naming (PR #7854)
This PR was merged into the master branch.
Discussion
----------
[PropertyAccess] Made naming consistent with Form and Validator
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | yes
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
8817e70
[PropertyAccess] Made naming consistent with Form and Validator
This commit is contained in:
commit
e4b580ea62
|
@ -250,6 +250,26 @@ UPGRADE FROM 2.x to 3.0
|
|||
* `Locale::getDisplayLocales()` -> `Intl::getLocaleBundle()->getLocaleNames()`
|
||||
* `Locale::getLocales()` -> `array_keys(Intl::getLocaleBundle()->getLocaleNames())`
|
||||
|
||||
### PropertyAccess
|
||||
|
||||
* Renamed `PropertyAccess::getPropertyAccessor` to `createPropertyAccessor`.
|
||||
|
||||
Before:
|
||||
|
||||
```
|
||||
use Symfony\Component\PropertyAccess\PropertyAccess;
|
||||
|
||||
$accessor = PropertyAccess::getPropertyAccessor();
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```
|
||||
use Symfony\Component\PropertyAccess\PropertyAccess;
|
||||
|
||||
$accessor = PropertyAccess::createPropertyAccessor();
|
||||
```
|
||||
|
||||
### Routing
|
||||
|
||||
* Some route settings have been renamed:
|
||||
|
|
|
@ -10,3 +10,5 @@ CHANGELOG
|
|||
method even if a non-public match was found. Before, a PropertyAccessDeniedException
|
||||
was thrown in this case. Class PropertyAccessDeniedException was removed
|
||||
now.
|
||||
* deprecated PropertyAccess::getPropertyAccessor
|
||||
* added PropertyAccess::createPropertyAccessor and PropertyAccess::createPropertyAccessorBuilder
|
||||
|
|
|
@ -23,9 +23,9 @@ final class PropertyAccess
|
|||
*
|
||||
* @return PropertyAccessor The new property accessor
|
||||
*/
|
||||
public static function getPropertyAccessor()
|
||||
public static function createPropertyAccessor()
|
||||
{
|
||||
return new PropertyAccessor();
|
||||
return self::createPropertyAccessorBuilder()->getPropertyAccessor();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -33,11 +33,24 @@ final class PropertyAccess
|
|||
*
|
||||
* @return PropertyAccessorBuilder The new property accessor builder
|
||||
*/
|
||||
public static function getPropertyAccessorBuilder()
|
||||
public static function createPropertyAccessorBuilder()
|
||||
{
|
||||
return new PropertyAccessorBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Alias of {@link getPropertyAccessor}.
|
||||
*
|
||||
* @return PropertyAccessor The new property accessor
|
||||
*
|
||||
* @deprecated Deprecated since version 2.3, to be removed in 3.0. Use
|
||||
* {@link createPropertyAccessor()} instead.
|
||||
*/
|
||||
public static function getPropertyAccessor()
|
||||
{
|
||||
return self::createPropertyAccessor();
|
||||
}
|
||||
|
||||
/**
|
||||
* This class cannot be instantiated.
|
||||
*/
|
||||
|
|
Reference in New Issue