File tree Expand file tree Collapse file tree 7 files changed +17
-17
lines changed
tests/Rule/data/DeadMethodRule Expand file tree Collapse file tree 7 files changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ public function __construct()
1515 }
1616
1717 public function method1 (string $ foo ): void {} // error: Unused DeadMap\ArrayMapTest::method1
18- public function method2 (): void {}
19- public function method3 (): void {}
20- public function method4 (): void {}
21- public static function method5 (): void {}
18+ public function method2 (): void {} // error: Unused DeadMap\ArrayMapTest::method2
19+ public function method3 (): void {} // error: Unused DeadMap\ArrayMapTest::method3
20+ public function method4 (): void {} // error: Unused DeadMap\ArrayMapTest::method4
21+ public static function method5 (): void {} // error: Unused DeadMap\ArrayMapTest::method5
2222 public static function method6 (): void {} // error: Unused DeadMap\ArrayMapTest::method6
2323}
2424
@@ -28,7 +28,7 @@ public function method2(): void {}
2828 public function method3 (): void {}
2929 public function method4 (): void {}
3030 public static function method5 (): void {} // should be reported (https://github.com/phpstan/phpstan-src/pull/3372)
31- public static function method6 (): void {} // error: Unused DeadMap\Child::method6
31+ public static function method6 (): void {}
3232
3333}
3434
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ abstract class TestParent {
6262
6363 use TestTrait;
6464
65- public function __construct () // error: Unused DeadBasic\TestParent::__construct
65+ public function __construct ()
6666 {
6767 }
6868
@@ -72,7 +72,7 @@ public function parentMethodUsed(TestChild $child): void
7272 $ this ->traitMethodUsed ();
7373 }
7474
75- public function overwrittenParentMethodUsedByChild (): void // error: Unused DeadBasic\TestParent::overwrittenParentMethodUsedByChild
75+ public function overwrittenParentMethodUsedByChild (): void
7676 {
7777
7878 }
@@ -85,7 +85,7 @@ public function parentMethodUnused(): void // error: Unused DeadBasic\TestParen
8585
8686trait TestTrait {
8787
88- public function __construct () // error: Unused DeadBasic\TestTrait::__construct
88+ public function __construct ()
8989 {
9090 }
9191
@@ -94,7 +94,7 @@ public function traitMethodUsed(): void
9494
9595 }
9696
97- public function traitMethodUnused (): void // error: Unused DeadBasic\TestTrait::traitMethodUnused
97+ public function traitMethodUnused (): void
9898 {
9999
100100 }
Original file line number Diff line number Diff line change 44
55class ClassWithMethod {
66
7- public static function someMethod (): void {}
7+ public static function someMethod (): void {} // error: Unused ClassStringCall\ClassWithMethod::someMethod
88}
99
1010/**
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class B extends A
2020 /**
2121 * @inheritDoc
2222 */
23- public function __construct () // error: Unused DeadParent\B::__construct
23+ public function __construct ()
2424 {
2525 parent ::__construct ();
2626 }
Original file line number Diff line number Diff line change 44
55class Test {
66
7- public static function a (): void {}
8- public static function b (): void {}
7+ public static function a (): void {} // error: Unused DynamicMethod\Test::a
8+ public static function b (): void {} // error: Unused DynamicMethod\Test::b
99
10- public function c (): void {}
11- public function d (): void {}
10+ public function c (): void {} // error: Unused DynamicMethod\Test::c
11+ public function d (): void {} // error: Unused DynamicMethod\Test::d
1212}
1313
1414/**
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ public function __construct()
99 {
1010 }
1111
12- public function someUnused (): void
12+ public function someUnused (): void // error: Unused DeadEntrypoint\Entrypoint::someUnused
1313 {
1414 Dead::usedMethod ();
1515 }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public function second(): self {
1212 return $ this ;
1313 }
1414
15- public static function secondStatic (): self {
15+ public static function secondStatic (): self { // error: Unused Nullsafe\A::secondStatic
1616 return new self ();
1717 }
1818}
You can’t perform that action at this time.
0 commit comments