bug #37053 [PropertyAccess] Fix getter call order BC (1ed)

This PR was merged into the 5.1 branch.

Discussion
----------

[PropertyAccess] Fix getter call order BC

| Q             | A
| ------------- | ---
| Branch?       | 5.1
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | #37052
| License       | MIT
| Doc PR        | -

Property Accessor breaks BC due to a change in the order of calling the getters, see #37052

Commits
-------

8cf80688c7 [PropertyAccess] Fix getter call order BC
This commit is contained in:
Nicolas Grekas 2020-06-07 17:47:03 +02:00
commit 5de548b60e
3 changed files with 7 additions and 2 deletions

View File

@ -69,6 +69,11 @@ class TestClass
return $this->publicAccessor;
}
public function isPublicAccessor($param)
{
throw new \LogicException('This method should never have been called.');
}
public function getPublicAccessorWithDefaultValue()
{
return $this->publicAccessorWithDefaultValue;

View File

@ -19,7 +19,7 @@
"php": ">=7.2.5",
"symfony/inflector": "^4.4|^5.0",
"symfony/polyfill-php80": "^1.15",
"symfony/property-info": "^5.1"
"symfony/property-info": "^5.1.1"
},
"require-dev": {
"symfony/cache": "^4.4|^5.0"

View File

@ -40,7 +40,7 @@ class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTyp
/**
* @internal
*/
public static $defaultAccessorPrefixes = ['is', 'can', 'get', 'has'];
public static $defaultAccessorPrefixes = ['get', 'is', 'has', 'can'];
/**
* @internal