Skip to content

Commit 81305d2

Browse files
committed
Generic/UnusedFunctionParameter: add tests for properties with asymmetric visibility
This sniff already handles this correctly. This commit just updates the tests to safeguard this for the future.
1 parent 8fab89f commit 81305d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.1.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ function moreParamSecond(LogicException $bar, Exception $foo) {
140140
// phpcs:set Generic.CodeAnalysis.UnusedFunctionParameter ignoreTypeHints[]
141141

142142
class ConstructorPropertyPromotionNoContentInMethod {
143-
public function __construct(protected int $id) {}
143+
public function __construct(protected int $id, private(set) $foo) {}
144144
}
145145

146146
class ConstructorPropertyPromotionWithContentInMethod {
147-
public function __construct(protected int $id, $toggle = true) {
147+
public function __construct(protected int $id, private(set) $foo, $toggle = true) {
148148
if ($toggle === true) {
149149
doSomething();
150150
}

0 commit comments

Comments
 (0)