fix the deprecation message

This commit is contained in:
Christian Flothmann 2020-08-30 11:27:09 +02:00
parent e23a06400d
commit a9cbac77eb
2 changed files with 5 additions and 5 deletions

View File

@ -89,7 +89,7 @@ class PropertyAccessor implements PropertyAccessorInterface
public function __construct(/*int */$magicMethods = self::MAGIC_GET | self::MAGIC_SET, bool $throwExceptionOnInvalidIndex = false, CacheItemPoolInterface $cacheItemPool = null, bool $throwExceptionOnInvalidPropertyPath = true, PropertyReadInfoExtractorInterface $readInfoExtractor = null, PropertyWriteInfoExtractorInterface $writeInfoExtractor = null) public function __construct(/*int */$magicMethods = self::MAGIC_GET | self::MAGIC_SET, bool $throwExceptionOnInvalidIndex = false, CacheItemPoolInterface $cacheItemPool = null, bool $throwExceptionOnInvalidPropertyPath = true, PropertyReadInfoExtractorInterface $readInfoExtractor = null, PropertyWriteInfoExtractorInterface $writeInfoExtractor = null)
{ {
if (\is_bool($magicMethods)) { if (\is_bool($magicMethods)) {
trigger_deprecation('symfony/property-info', '5.2', 'Passing a boolean to "%s()" first argument is deprecated since 5.1 and expect a combination of bitwise flags instead (i.e an integer).', __METHOD__); trigger_deprecation('symfony/property-access', '5.2', 'Passing a boolean as the first argument to "%s()" is deprecated. Pass a combination of bitwise flags instead (i.e an integer).', __METHOD__);
$magicMethods = ($magicMethods ? self::MAGIC_CALL : 0) | self::MAGIC_GET | self::MAGIC_SET; $magicMethods = ($magicMethods ? self::MAGIC_CALL : 0) | self::MAGIC_GET | self::MAGIC_SET;
} }

View File

@ -273,7 +273,7 @@ class PropertyAccessorTest extends TestCase
/** /**
* @group legacy * @group legacy
* @expectedDeprecation Since symfony/property-info 5.2: Passing a boolean to "Symfony\Component\PropertyAccess\PropertyAccessor::__construct()" first argument is deprecated since 5.1 and expect a combination of bitwise flags instead (i.e an integer). * @expectedDeprecation Since symfony/property-access 5.2: Passing a boolean as the first argument to "Symfony\Component\PropertyAccess\PropertyAccessor::__construct()" is deprecated. Pass a combination of bitwise flags instead (i.e an integer).
*/ */
public function testLegacyGetValueReadsMagicCallIfEnabled() public function testLegacyGetValueReadsMagicCallIfEnabled()
{ {
@ -392,7 +392,7 @@ class PropertyAccessorTest extends TestCase
/** /**
* @group legacy * @group legacy
* @expectedDeprecation Since symfony/property-info 5.2: Passing a boolean to "Symfony\Component\PropertyAccess\PropertyAccessor::__construct()" first argument is deprecated since 5.1 and expect a combination of bitwise flags instead (i.e an integer). * @expectedDeprecation Since symfony/property-access 5.2: Passing a boolean as the first argument to "Symfony\Component\PropertyAccess\PropertyAccessor::__construct()" is deprecated. Pass a combination of bitwise flags instead (i.e an integer).
*/ */
public function testLegacySetValueUpdatesMagicCallIfEnabled() public function testLegacySetValueUpdatesMagicCallIfEnabled()
{ {
@ -480,7 +480,7 @@ class PropertyAccessorTest extends TestCase
/** /**
* @group legacy * @group legacy
* @expectedDeprecation Since symfony/property-info 5.2: Passing a boolean to "Symfony\Component\PropertyAccess\PropertyAccessor::__construct()" first argument is deprecated since 5.1 and expect a combination of bitwise flags instead (i.e an integer). * @expectedDeprecation Since symfony/property-access 5.2: Passing a boolean as the first argument to "Symfony\Component\PropertyAccess\PropertyAccessor::__construct()" is deprecated. Pass a combination of bitwise flags instead (i.e an integer).
*/ */
public function testLegacyIsReadableRecognizesMagicCallIfEnabled() public function testLegacyIsReadableRecognizesMagicCallIfEnabled()
{ {
@ -552,7 +552,7 @@ class PropertyAccessorTest extends TestCase
/** /**
* @group legacy * @group legacy
* @expectedDeprecation Since symfony/property-info 5.2: Passing a boolean to "Symfony\Component\PropertyAccess\PropertyAccessor::__construct()" first argument is deprecated since 5.1 and expect a combination of bitwise flags instead (i.e an integer). * @expectedDeprecation Since symfony/property-access 5.2: Passing a boolean as the first argument to "Symfony\Component\PropertyAccess\PropertyAccessor::__construct()" is deprecated. Pass a combination of bitwise flags instead (i.e an integer).
*/ */
public function testLegacyIsWritableRecognizesMagicCallIfEnabled() public function testLegacyIsWritableRecognizesMagicCallIfEnabled()
{ {