8000 minor #59522 [PropertyInfo] Fix typo in method name (HypeMC) · symfony/symfony@8d4a538 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8d4a538

Browse files
minor #59522 [PropertyInfo] Fix typo in method name (HypeMC)
This PR was merged into the 7.3 branch. Discussion ---------- [PropertyInfo] Fix typo in method name | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT ~~Not sure if I should target 7.3, it's more an improvement than a bug?~~ Commits ------- 7813a00 [PropertyInfo] Fix typo in method name
2 parents d096737 + 7813a00 commit 8d4a538

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

src/Symfony/Component/PropertyInfo/Extractor/ReflectionExtractor.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -373,22 +373,22 @@ public function getReadInfo(string $class, string $property, array $context = []
373373
if ($reflClass->hasMethod($methodName) && $reflClass->getMethod($methodName)->getModifiers() & $this->methodReflectionFlags && !$reflClass->getMethod($methodName)->getNumberOfRequiredParameters()) {
374374
$method = $reflClass->getMethod($methodName);
375375

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);
377377
}
378378
}
379379

380380
if ($allowGetterSetter && $reflClass->hasMethod($getsetter) && ($reflClass->getMethod($getsetter)->getModifiers() & $this->methodReflectionFlags)) {
381381
$method = $reflClass->getMethod($getsetter);
382382

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);
384384
}
385385

386386
if ($allowMagicGet && $reflClass->hasMethod('__get') && (($r = $reflClass->getMethod('__get'))->getModifiers() & $this->methodReflectionFlags)) {
387387
return new PropertyReadInfo(PropertyReadInfo::TYPE_PROPERTY, $property, PropertyReadInfo::VISIBILITY_PUBLIC, false, $r->returnsReference());
388388
}
389389

390390
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);
392392
}
393393

394394
if ($allowMagicCall && $reflClass->hasMethod('__call') && ($reflClass->getMethod('__call')->getModifiers() & $this->methodReflectionFlags)) {
@@ -432,8 +432,8 @@ public function getWriteInfo(string $class, string $property, array $context = [
432432
$removerMethod = $reflClass->getMethod($removerAccessName);
433433

434434
$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()));
437437

438438
return $mutator;
439439
}
@@ -452,7 +452,7 @@ public function getWriteInfo(string $class, string $property, array $context = [
452452
$method = $reflClass->getMethod($methodName);
453453

454454
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());
456456
}
457457
}
458458

@@ -463,7 +463,7 @@ public function getWriteInfo(string $class, string $property, array $context = [
463463
if ($accessible) {
464464
$method = $reflClass->getMethod($getsetter);
465465

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());
467467
}
468468

469469
$errors[] = $methodAccessibleErrors;
@@ -472,7 +472,7 @@ public function getWriteInfo(string $class, string $property, array $context = [
472472
if ($reflClass->hasProperty($property) && ($reflClass->getProperty($property)->getModifiers() & $this->propertyReflectionFlags)) {
473473
$reflProperty = $reflClass->getProperty($property);
474474
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());
476476
}
477477

478478
$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
738738
/**
739739
* Gets the accessor method.
740740
*
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.
743743
*/
744744
private function getAccessorMethod(string $class, string $property): ?array
745745
{
@@ -764,8 +764,8 @@ private function getAccessorMethod(string $class, string $property): ?array
764764
}
765765

766766
/**
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.
769769
*/
770770
private function getMutatorMethod(string $class, string $property): ?array
771771
{
@@ -937,7 +937,7 @@ private function getPropertyFlags(int $accessFlags): int
937937
return $propertyFlags;
938938
}
939939

940-
private function getReadVisiblityForProperty(\ReflectionProperty $reflectionProperty): string
940+
private function getReadVisibilityForProperty(\ReflectionProperty $reflectionProperty): string
941941
{
942942
if ($reflectionProperty->isPrivate()) {
943943
return PropertyReadInfo::VISIBILITY_PRIVATE;
@@ -950,7 +950,7 @@ private function getReadVisiblityForProperty(\ReflectionProperty $reflectionProp
950950
return PropertyReadInfo::VISIBILITY_PUBLIC;
951951
}
952952

953-
private function getReadVisiblityForMethod(\ReflectionMethod $reflectionMethod): string
953+
private function getReadVisibilityForMethod(\ReflectionMethod $reflectionMethod): string
954954
{
955955
if ($reflectionMethod->isPrivate()) {
956956
return PropertyReadInfo::VISIBILITY_PRIVATE;
@@ -963,7 +963,7 @@ private function getReadVisiblityForMethod(\ReflectionMethod $reflectionMethod):
963963
return PropertyReadInfo::VISIBILITY_PUBLIC;
964964
}
965965

966-
private function getWriteVisiblityForProperty(\ReflectionProperty $reflectionProperty): string
966+
private function getWriteVisibilityForProperty(\ReflectionProperty $reflectionProperty): string
967967
{
968968
if (\PHP_VERSION_ID >= 80400) {
969969
if ($reflectionProperty->isVirtual() && !$reflectionProperty->hasHook(\PropertyHookType::Set)) {
@@ -990,7 +990,7 @@ private function getWriteVisiblityForProperty(\ReflectionProperty $reflectionPro
990990
return PropertyWriteInfo::VISIBILITY_PUBLIC;
991991
}
992992

993-
private function getWriteVisiblityForMethod(\ReflectionMethod $reflectionMethod): string
993+
private function getWriteVisibilityForMethod(\ReflectionMethod $reflectionMethod): string
994994
{
995995
if ($reflectionMethod->isPrivate()) {
996996
return PropertyWriteInfo::VISIBILITY_PRIVATE;

0 commit comments

Comments
 (0)
0