From 2656ed7fca6da0a62318d8243aa9e825a4374454 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Thu, 23 Oct 2025 02:54:43 +0200 Subject: [PATCH] PHP 8.5 | BCFile/Variables::getMemberProperties(): add tests with asymmetric visibility for static properties Looks to be handled correctly already. Just safeguarding this with some tests. This syncs the tests with the same update made in PHPCS 4.0.1. --- .../BCFile/GetMemberPropertiesTest.inc | 8 +++- .../BCFile/GetMemberPropertiesTest.php | 40 +++++++++++++++++-- 2 files changed, 42 insertions(+), 6 deletions(-) diff --git a/Tests/BackCompat/BCFile/GetMemberPropertiesTest.inc b/Tests/BackCompat/BCFile/GetMemberPropertiesTest.inc index 3b27cbe2..093ad850 100644 --- a/Tests/BackCompat/BCFile/GetMemberPropertiesTest.inc +++ b/Tests/BackCompat/BCFile/GetMemberPropertiesTest.inc @@ -398,8 +398,12 @@ class AsymVisibility { /* testPHP84AsymPrivateSetPublicProperty */ private(set) public mixed $prop9; - /* testPHP84IllegalAsymPublicProtectedSetStaticProperty */ - public protected(set) static mixed $prop10; + /* testPHP85AsymPrivateSetStaticProperty */ + private(set) static mixed $prop10; + /* testPHP85AsymFinalPublicProtectedSetStaticProperty */ + final public protected(set) static Union|Type $prop11; + /* testPHP85AsymPublicSetStaticProperty */ + static public(set) ?array $prop12; } abstract class WithAbstractProperties { diff --git a/Tests/BackCompat/BCFile/GetMemberPropertiesTest.php b/Tests/BackCompat/BCFile/GetMemberPropertiesTest.php index 48f5a2a4..5e536bab 100644 --- a/Tests/BackCompat/BCFile/GetMemberPropertiesTest.php +++ b/Tests/BackCompat/BCFile/GetMemberPropertiesTest.php @@ -1694,12 +1694,12 @@ public static function dataGetMemberProperties() 'nullable_type' => false, ], ], - 'php8.4-illegal-asym-public-protected-set-static' => [ - 'identifier' => '/* testPHP84IllegalAsymPublicProtectedSetStaticProperty */', + 'php8.5-asym-private-set-static' => [ + 'identifier' => '/* testPHP85AsymPrivateSetStaticProperty */', 'expected' => [ 'scope' => 'public', - 'scope_specified' => true, - 'set_scope' => 'protected', + 'scope_specified' => false, + 'set_scope' => 'private', 'is_static' => true, 'is_readonly' => false, 'is_final' => false, @@ -1710,6 +1710,38 @@ public static function dataGetMemberProperties() 'nullable_type' => false, ], ], + 'php8.5-asym-final-public-protected-set-static' => [ + 'identifier' => '/* testPHP85AsymFinalPublicProtectedSetStaticProperty */', + 'expected' => [ + 'scope' => 'public', + 'scope_specified' => true, + 'set_scope' => 'protected', + 'is_static' => true, + 'is_readonly' => false, + 'is_final' => true, + 'is_abstract' => false, + 'type' => 'Union|Type', + 'type_token' => -4, + 'type_end_token' => -2, + 'nullable_type' => false, + ], + ], + 'php8.5-asym-static-public-set' => [ + 'identifier' => '/* testPHP85AsymPublicSetStaticProperty */', + 'expected' => [ + 'scope' => 'public', + 'scope_specified' => false, + 'set_scope' => 'public', + 'is_static' => true, + 'is_readonly' => false, + 'is_final' => false, + 'is_abstract' => false, + 'type' => '?array', + 'type_token' => -2, + 'type_end_token' => -2, + 'nullable_type' => true, + ], + ], 'php8.4-abstract-public-property' => [ 'identifier' => '/* testPHP84AbstractPublicTypedProp */', 'expected' => [