Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit8817e70

Browse files
committed
[PropertyAccess] Made naming consistent with Form and Validator
1 parent0b08727 commit8817e70

File tree

3 files changed

+38
-3
lines changed

3 files changed

+38
-3
lines changed

‎UPGRADE-3.0.md‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,26 @@ UPGRADE FROM 2.x to 3.0
238238

239239
* The`FormItegrationTestCase` and`FormPerformanceTestCase` classes were moved form the`Symfony\Component\Form\Tests` namespace to the`Symfony\Component\Form\Test` namespace.
240240

241+
###PropertyAccess
242+
243+
* Renamed`PropertyAccess::getPropertyAccessor` to`createPropertyAccessor`.
244+
245+
Before:
246+
247+
```
248+
use Symfony\Component\PropertyAccess\PropertyAccess;
249+
250+
$accessor = PropertyAccess::getPropertyAccessor();
251+
```
252+
253+
After:
254+
255+
```
256+
use Symfony\Component\PropertyAccess\PropertyAccess;
257+
258+
$accessor = PropertyAccess::createPropertyAccessor();
259+
```
260+
241261
###Routing
242262

243263
* Some route settings have been renamed:

‎src/Symfony/Component/PropertyAccess/CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,5 @@ CHANGELOG
1010
method even if a non-public match was found. Before, a PropertyAccessDeniedException
1111
was thrown in this case. Class PropertyAccessDeniedException was removed
1212
now.
13+
* deprecated PropertyAccess::getPropertyAccessor
14+
* added PropertyAccess::createPropertyAccessor and PropertyAccess::createPropertyAccessorBuilder

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

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,34 @@ final class PropertyAccess
2323
*
2424
* @return PropertyAccessor The new property accessor
2525
*/
26-
publicstaticfunctiongetPropertyAccessor()
26+
publicstaticfunctioncreatePropertyAccessor()
2727
{
28-
returnnewPropertyAccessor();
28+
returnself::createPropertyAccessorBuilder()->getPropertyAccessor();
2929
}
3030

3131
/**
3232
* Creates a property accessor builder.
3333
*
3434
* @return PropertyAccessorBuilder The new property accessor builder
3535
*/
36-
publicstaticfunctiongetPropertyAccessorBuilder()
36+
publicstaticfunctioncreatePropertyAccessorBuilder()
3737
{
3838
returnnewPropertyAccessorBuilder();
3939
}
4040

41+
/**
42+
* Alias of {@link getPropertyAccessor}.
43+
*
44+
* @return PropertyAccessor The new property accessor
45+
*
46+
* @deprecated Deprecated since version 2.3, to be removed in 3.0. Use
47+
* {@link createPropertyAccessor()} instead.
48+
*/
49+
publicstaticfunctiongetPropertyAccessor()
50+
{
51+
returnself::createPropertyAccessor();
52+
}
53+
4154
/**
4255
* This class cannot be instantiated.
4356
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp