[Scoped] Remove no longer needed vendor patch for VisibilityRequiredFixer#290
Merged
samsonasik merged 2 commits intomainfrom Aug 14, 2025
Merged
[Scoped] Remove no longer needed vendor patch for VisibilityRequiredFixer#290samsonasik merged 2 commits intomainfrom
samsonasik merged 2 commits intomainfrom
Conversation
Collaborator
Author
|
Also re-run rector to remove It covered on downgrade to add it: ➜ easy-coding-standard git:(remove-vis) ✗ vendor/bin/rector process src/Utils/PrivatesAccessorHelper.php --dry-run --config build/rector-downgrade-php-72.php
1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100%
1 file with changes
===================
1) src/Utils/PrivatesAccessorHelper.php:8
---------- begin diff ----------
@@ @@
final class PrivatesAccessorHelper
{
- public static function getPropertyValue(object $object, string $propertyName): mixed
+ /**
+ * @return mixed
+ */
+ public static function getPropertyValue(object $object, string $propertyName)
{
$reflectionProperty = new ReflectionProperty($object, $propertyName);
+ $reflectionProperty->setAccessible(true);
return $reflectionProperty->getValue($object);
}
- public static function setPropertyValue(object $object, string $propertyName, mixed $value): void
+ /**
+ * @param mixed $value
+ */
+ public static function setPropertyValue(object $object, string $propertyName, $value): void
{
$reflectionProperty = new ReflectionProperty($object, $propertyName);
+ $reflectionProperty->setAccessible(true);
$reflectionProperty->setValue($object, $value);
}
----------- end diff -----------
Applied rules:
* DowngradeMixedTypeDeclarationRector |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The downgrade on merge constant class already covered on rector-downgrade-php
with rector 2.1.3
so vendor patch for VisibilityRequiredFixer no longer needed, now it works correctly:
➜ easy-coding-standard git:(remove-vis) vendor/bin/rector process vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/VisibilityRequiredFixer.php --dry-run --config build/rector-downgrade-php-72.php 1/1 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓] 100% 1 file with changes =================== 1) vendor/friendsofphp/php-cs-fixer/src/Fixer/ClassNotation/VisibilityRequiredFixer.php:53 ---------- begin diff ---------- @@ @@ private const PROPERTY_TYPE_DECLARATION_KINDS = [\T_STRING, \T_NS_SEPARATOR, CT::T_NULLABLE_TYPE, CT::T_ARRAY_TYPEHINT, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE]; private const EXPECTED_KINDS_GENERIC = [\T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC, \T_STATIC, \T_VAR, CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE, FCT::T_READONLY, FCT::T_PRIVATE_SET, FCT::T_PROTECTED_SET, FCT::T_PUBLIC_SET]; - private const EXPECTED_KINDS_PROPERTY_KINDS = [...self::EXPECTED_KINDS_GENERIC, ...self::PROPERTY_TYPE_DECLARATION_KINDS]; + private const EXPECTED_KINDS_PROPERTY_KINDS = [\T_ABSTRACT, \T_FINAL, \T_PRIVATE, \T_PROTECTED, \T_PUBLIC, \T_STATIC, \T_VAR, CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC, CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED, CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE, FCT::T_READONLY, FCT::T_PRIVATE_SET, FCT::T_PROTECTED_SET, FCT::T_PUBLIC_SET, \T_STRING, \T_NS_SEPARATOR, CT::T_NULLABLE_TYPE, CT::T_ARRAY_TYPEHINT, CT::T_TYPE_ALTERNATION, CT::T_TYPE_INTERSECTION, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_OPEN, CT::T_DISJUNCTIVE_NORMAL_FORM_TYPE_PARENTHESIS_CLOSE];/cc @zonuexe