From 8817e700420716cc0f03be0616f19c5c4c95fa1c Mon Sep 17 00:00:00 2001 From: Bernhard Schussek Date: Thu, 25 Apr 2013 18:28:27 +0200 Subject: [PATCH] [PropertyAccess] Made naming consistent with Form and Validator --- UPGRADE-3.0.md | 20 +++++++++++++++++++ .../Component/PropertyAccess/CHANGELOG.md | 2 ++ .../PropertyAccess/PropertyAccess.php | 19 +++++++++++++++--- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/UPGRADE-3.0.md b/UPGRADE-3.0.md index 9871448e0c..e360073a50 100644 --- a/UPGRADE-3.0.md +++ b/UPGRADE-3.0.md @@ -238,6 +238,26 @@ UPGRADE FROM 2.x to 3.0 * The `FormItegrationTestCase` and `FormPerformanceTestCase` classes were moved form the `Symfony\Component\Form\Tests` namespace to the `Symfony\Component\Form\Test` namespace. +### 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. */