Skip to content

Commit dfd8da3

Browse files
committed
Generic/LowerCaseType: add test for properties with asymmetric visibility
This sniff already handles this correctly. This commit just updates a test to safeguard this for the future.
1 parent 81305d2 commit dfd8da3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class TypedProperties
7575
}
7676

7777
class ConstructorPropertyPromotionWithTypes {
78-
public function __construct(protected Float|Int $x, public ?STRING &$y = 'test', private mixed $z) {}
78+
public function __construct(protected Float|Int $x, public(set) ?STRING &$y = 'test', private mixed $z) {}
7979
}
8080

8181
class ConstructorPropertyPromotionAndNormalParams {

src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class TypedProperties
7575
}
7676

7777
class ConstructorPropertyPromotionWithTypes {
78-
public function __construct(protected float|int $x, public ?string &$y = 'test', private mixed $z) {}
78+
public function __construct(protected float|int $x, public(set) ?string &$y = 'test', private mixed $z) {}
7979
}
8080

8181
class ConstructorPropertyPromotionAndNormalParams {

0 commit comments

Comments
 (0)