From c5101c7d2b0ec56444bd35dd76c3019ab674fc5d Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 9 Mar 2021 11:09:09 +0100 Subject: [PATCH 1/2] [PropertyAccess] use bitwise instead of boolean flags --- components/property_access.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/property_access.rst b/components/property_access.rst index a1ae83ab406..fdb678c1c3e 100644 --- a/components/property_access.rst +++ b/components/property_access.rst @@ -435,7 +435,7 @@ Sometimes, adder and remover methods don't use the standard ``add`` or ``remove` $list = new PeopleList(); $reflectionExtractor = new ReflectionExtractor(null, null, ['join', 'leave']); - $propertyAccessor = new PropertyAccessor(false, false, null, true, $reflectionExtractor, $reflectionExtractor); + $propertyAccessor = new PropertyAccessor(PropertyAccessor::DISALLOW_MAGIC_METHODS, false, null, true, $reflectionExtractor, $reflectionExtractor); $propertyAccessor->setValue($person, 'peoples', ['kevin', 'wouter']); var_dump($person->getPeoples()); // ['kevin', 'wouter'] From a9cb63d242d7047c226cf2431ed1a407fbf84d0a Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Tue, 9 Mar 2021 11:03:50 +0100 Subject: [PATCH 2/2] =?UTF-8?q?[PropertyAccess]=C2=A0do=20not=20pass=20boo?= =?UTF-8?q?lean=20constructor=20flags?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/property_access.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/property_access.rst b/components/property_access.rst index fdb678c1c3e..9d3f4e355fc 100644 --- a/components/property_access.rst +++ b/components/property_access.rst @@ -435,7 +435,7 @@ Sometimes, adder and remover methods don't use the standard ``add`` or ``remove` $list = new PeopleList(); $reflectionExtractor = new ReflectionExtractor(null, null, ['join', 'leave']); - $propertyAccessor = new PropertyAccessor(PropertyAccessor::DISALLOW_MAGIC_METHODS, false, null, true, $reflectionExtractor, $reflectionExtractor); + $propertyAccessor = new PropertyAccessor(PropertyAccessor::DISALLOW_MAGIC_METHODS, PropertyAccessor::THROW_ON_INVALID_PROPERTY_PATH, null, $reflectionExtractor, $reflectionExtractor); $propertyAccessor->setValue($person, 'peoples', ['kevin', 'wouter']); var_dump($person->getPeoples()); // ['kevin', 'wouter']