@@ -373,22 +373,22 @@ public function getReadInfo(string $class, string $property, array $context = []
373
373
if ($ reflClass ->hasMethod ($ methodName ) && $ reflClass ->getMethod ($ methodName )->getModifiers () & $ this ->methodReflectionFlags && !$ reflClass ->getMethod ($ methodName )->getNumberOfRequiredParameters ()) {
374
374
$ method = $ reflClass ->getMethod ($ methodName );
375
375
376
- return new PropertyReadInfo (PropertyReadInfo::TYPE_METHOD , $ methodName , $ this ->getReadVisiblityForMethod ($ method ), $ method ->isStatic (), false );
376
+ return new PropertyReadInfo (PropertyReadInfo::TYPE_METHOD , $ methodName , $ this ->getReadVisibilityForMethod ($ method ), $ method ->isStatic (), false );
377
377
}
378
378
}
379
379
380
380
if ($ allowGetterSetter && $ reflClass ->hasMethod ($ getsetter ) && ($ reflClass ->getMethod ($ getsetter )->getModifiers () & $ this ->methodReflectionFlags )) {
381
381
$ method = $ reflClass ->getMethod ($ getsetter );
382
382
383
- return new PropertyReadInfo (PropertyReadInfo::TYPE_METHOD , $ getsetter , $ this ->getReadVisiblityForMethod ($ method ), $ method ->isStatic (), false );
383
+ return new PropertyReadInfo (PropertyReadInfo::TYPE_METHOD , $ getsetter , $ this ->getReadVisibilityForMethod ($ method ), $ method ->isStatic (), false );
384
384
}
385
385
386
386
if ($ allowMagicGet && $ reflClass ->hasMethod ('__get ' ) && (($ r = $ reflClass ->getMethod ('__get ' ))->getModifiers () & $ this ->methodReflectionFlags )) {
387
387
return new PropertyReadInfo (PropertyReadInfo::TYPE_PROPERTY , $ property , PropertyReadInfo::VISIBILITY_PUBLIC , false , $ r ->returnsReference ());
388
388
}
389
389
390
390
if ($ hasProperty && (($ r = $ reflClass ->getProperty ($ property ))->getModifiers () & $ this ->propertyReflectionFlags )) {
391
- return new PropertyReadInfo (PropertyReadInfo::TYPE_PROPERTY , $ property , $ this ->getReadVisiblityForProperty ($ r ), $ r ->isStatic (), true );
391
+ return new PropertyReadInfo (PropertyReadInfo::TYPE_PROPERTY , $ property , $ this ->getReadVisibilityForProperty ($ r ), $ r ->isStatic (), true );
392
392
}
393
393
394
394
if ($ allowMagicCall && $ reflClass ->hasMethod ('__call ' ) && ($ reflClass ->getMethod ('__call ' )->getModifiers () & $ this ->methodReflectionFlags )) {
@@ -432,8 +432,8 @@ public function getWriteInfo(string $class, string $property, array $context = [
432
432
$ removerMethod = $ reflClass ->getMethod ($ removerAccessName );
433
433
434
434
$ mutator = new PropertyWriteInfo (PropertyWriteInfo::TYPE_ADDER_AND_REMOVER );
435
- $ mutator ->setAdderInfo (new PropertyWriteInfo (PropertyWriteInfo::TYPE_METHOD , $ adderAccessName , $ this ->getWriteVisiblityForMethod ($ adderMethod ), $ adderMethod ->isStatic ()));
436
- $ mutator ->setRemoverInfo (new PropertyWriteInfo (PropertyWriteInfo::TYPE_METHOD , $ removerAccessName , $ this ->getWriteVisiblityForMethod ($ removerMethod ), $ removerMethod ->isStatic ()));
435
+ $ mutator ->setAdderInfo (new PropertyWriteInfo (PropertyWriteInfo::TYPE_METHOD , $ adderAccessName , $ this ->getWriteVisibilityForMethod ($ adderMethod ), $ adderMethod ->isStatic ()));
436
+ $ mutator ->setRemoverInfo (new PropertyWriteInfo (PropertyWriteInfo::TYPE_METHOD , $ removerAccessName , $ this ->getWriteVisibilityForMethod ($ removerMethod ), $ removerMethod ->isStatic ()));
437
437
438
438
return $ mutator ;
439
439
}
@@ -452,7 +452,7 @@ public function getWriteInfo(string $class, string $property, array $context = [
452
452
$ method = $ reflClass ->getMethod ($ methodName );
453
453
454
454
if (!\in_array ($ mutatorPrefix , $ this ->arrayMutatorPrefixes , true )) {
455
- return new PropertyWriteInfo (PropertyWriteInfo::TYPE_METHOD , $ methodName , $ this ->getWriteVisiblityForMethod ($ method ), $ method ->isStatic ());
455
+ return new PropertyWriteInfo (PropertyWriteInfo::TYPE_METHOD , $ methodName , $ this ->getWriteVisibilityForMethod ($ method ), $ method ->isStatic ());
456
456
}
457
457
}
458
458
@@ -463,7 +463,7 @@ public function getWriteInfo(string $class, string $property, array $context = [
463
463
if ($ accessible ) {
464
464
$ method = $ reflClass ->getMethod ($ getsetter );
465
465
466
- return new PropertyWriteInfo (PropertyWriteInfo::TYPE_METHOD , $ getsetter , $ this ->getWriteVisiblityForMethod ($ method ), $ method ->isStatic ());
466
+ return new PropertyWriteInfo (PropertyWriteInfo::TYPE_METHOD , $ getsetter , $ this ->getWriteVisibilityForMethod ($ method ), $ method ->isStatic ());
467
467
}
468
468
469
469
$ errors [] = $ methodAccessibleErrors ;
@@ -472,7 +472,7 @@ public function getWriteInfo(string $class, string $property, array $context = [
472
472
if ($ reflClass ->hasProperty ($ property ) && ($ reflClass ->getProperty ($ property )->getModifiers () & $ this ->propertyReflectionFlags )) {
473
473
$ reflProperty = $ reflClass ->getProperty ($ property );
474
474
if (!$ reflProperty ->isReadOnly ()) {
475
- return new PropertyWriteInfo (PropertyWriteInfo::TYPE_PROPERTY , $ property , $ this ->getWriteVisiblityForProperty ($ reflProperty ), $ reflProperty ->isStatic ());
475
+ return new PropertyWriteInfo (PropertyWriteInfo::TYPE_PROPERTY , $ property , $ this ->getWriteVisibilityForProperty ($ reflProperty ), $ reflProperty ->isStatic ());
476
476
}
477
477
478
478
$ errors [] = [\sprintf ('The property "%s" in class "%s" is a promoted readonly property. ' , $ property , $ reflClass ->getName ())];
@@ -738,8 +738,8 @@ private function isAllowedProperty(string $class, string $property, bool $writeA
738
738
/**
739
739
* Gets the accessor method.
740
740
*
741
- * Returns an array with a the instance of \ReflectionMethod as first key
742
- * and the prefix of the method as second or null if not found.
741
+ * Returns an array with an instance of \ReflectionMethod as the first key
742
+ * and the prefix of the method as the second, or null if not found.
743
743
*/
744
744
private function getAccessorMethod (string $ class , string $ property ): ?array
745
745
{
@@ -764,8 +764,8 @@ private function getAccessorMethod(string $class, string $property): ?array
764
764
}
765
765
766
766
/**
767
- * Returns an array with a the instance of \ReflectionMethod as first key
768
- * and the prefix of the method as second or null if not found.
767
+ * Returns an array with an instance of \ReflectionMethod as the first key
768
+ * and the prefix of the method as the second, or null if not found.
769
769
*/
770
770
private function getMutatorMethod (string $ class , string $ property ): ?array
771
771
{
@@ -937,7 +937,7 @@ private function getPropertyFlags(int $accessFlags): int
937
937
return $ propertyFlags ;
938
938
}
939
939
940
- private function getReadVisiblityForProperty (\ReflectionProperty $ reflectionProperty ): string
940
+ private function getReadVisibilityForProperty (\ReflectionProperty $ reflectionProperty ): string
941
941
{
942
942
if ($ reflectionProperty ->isPrivate ()) {
943
943
return PropertyReadInfo::VISIBILITY_PRIVATE ;
@@ -950,7 +950,7 @@ private function getReadVisiblityForProperty(\ReflectionProperty $reflectionProp
950
950
return PropertyReadInfo::VISIBILITY_PUBLIC ;
951
951
}
952
952
953
- private function getReadVisiblityForMethod (\ReflectionMethod $ reflectionMethod ): string
953
+ private function getReadVisibilityForMethod (\ReflectionMethod $ reflectionMethod ): string
954
954
{
955
955
if ($ reflectionMethod ->isPrivate ()) {
956
956
return PropertyReadInfo::VISIBILITY_PRIVATE ;
@@ -963,7 +963,7 @@ private function getReadVisiblityForMethod(\ReflectionMethod $reflectionMethod):
963
963
return PropertyReadInfo::VISIBILITY_PUBLIC ;
964
964
}
965
965
966
- private function getWriteVisiblityForProperty (\ReflectionProperty $ reflectionProperty ): string
966
+ private function getWriteVisibilityForProperty (\ReflectionProperty $ reflectionProperty ): string
967
967
{
968
968
if (\PHP_VERSION_ID >= 80400 ) {
969
969
if ($ reflectionProperty ->isVirtual () && !$ reflectionProperty ->hasHook (\PropertyHookType::Set)) {
@@ -990,7 +990,7 @@ private function getWriteVisiblityForProperty(\ReflectionProperty $reflectionPro
990
990
return PropertyWriteInfo::VISIBILITY_PUBLIC ;
991
991
}
992
992
993
- private function getWriteVisiblityForMethod (\ReflectionMethod $ reflectionMethod ): string
993
+ private function getWriteVisibilityForMethod (\ReflectionMethod $ reflectionMethod ): string
994
994
{
995
995
if ($ reflectionMethod ->isPrivate ()) {
996
996
return PropertyWriteInfo::VISIBILITY_PRIVATE ;
0 commit comments