diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index f212a203cc..a2c1d74a1f 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -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: diff --git a/src/Symfony/Component/PropertyAccess/CHANGELOG.md b/src/Symfony/Component/PropertyAccess/CHANGELOG.md index e8d11f95b6..071ef3b520 100644 --- a/src/Symfony/Component/PropertyAccess/CHANGELOG.md +++ b/src/Symfony/Component/PropertyAccess/CHANGELOG.md @@ -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 diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccess.php b/src/Symfony/Component/PropertyAccess/PropertyAccess.php index a01c9923b4..3b234df9d2 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccess.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccess.php @@ -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. */