Skip to content

Commit 2552afc

Browse files
committed
Run compare script to see diffs
1 parent 4ae54c0 commit 2552afc

24 files changed

+42
-42
lines changed

tests/Rule/data/DeadMethodRule/array-map-1.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff 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

tests/Rule/data/DeadMethodRule/basic.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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

8686
trait 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
}

tests/Rule/data/DeadMethodRule/class-string.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class ClassWithMethod {
66

7-
public static function someMethod(): void {}
7+
public static function someMethod(): void {} // error: Unused ClassStringCall\ClassWithMethod::someMethod
88
}
99

1010
/**

tests/Rule/data/DeadMethodRule/ctor-interface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
interface MyInterface
66
{
7-
public function __construct(); // error: Unused CtorInterface\MyInterface::__construct
7+
public function __construct();
88
}
99

1010
class Child1 implements MyInterface

tests/Rule/data/DeadMethodRule/ctor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function __construct()
1111

1212
class Child1 extends ParentClass
1313
{
14-
public function __construct() // error: Unused Ctor\Child1::__construct
14+
public function __construct()
1515
{
1616
}
1717
}

tests/Rule/data/DeadMethodRule/dead-in-parent-1.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

tests/Rule/data/DeadMethodRule/dynamic-method.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
class 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
/**

tests/Rule/data/DeadMethodRule/entrypoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

tests/Rule/data/DeadMethodRule/indirect-interface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
interface FooInterface
66
{
7-
public function foo(): void; // error: Unused DeadIndirect\FooInterface::foo
7+
public function foo(): void;
88
}
99

1010
abstract class FooAbstract

tests/Rule/data/DeadMethodRule/nullsafe.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
}

tests/Rule/data/DeadMethodRule/overwriting-methods-1.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
interface Interface1
66
{
7-
public function foo(): void; // error: Unused DeadOver1\Interface1::foo
7+
public function foo(): void;
88
}
99

1010
interface Interface2
1111
{
12-
public function foo(): void; // error: Unused DeadOver1\Interface2::foo
12+
public function foo(): void;
1313
}
1414

1515
abstract class AbstractClass implements Interface1, Interface2

tests/Rule/data/DeadMethodRule/overwriting-methods-2.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
interface Interface1
66
{
7-
public function foo(): void; // error: Unused DeadOver2\Interface1::foo
7+
public function foo(): void;
88
}
99

1010
interface Interface2
1111
{
12-
public function foo(): void; // error: Unused DeadOver2\Interface2::foo
12+
public function foo(): void;
1313
}
1414

1515
abstract class AbstractClass implements Interface1, Interface2
1616
{
17-
public abstract function foo(): void; // error: Unused DeadOver2\AbstractClass::foo
17+
public abstract function foo(): void;
1818
}
1919

2020
class Child1 extends AbstractClass
@@ -24,7 +24,7 @@ public function foo(): void {}
2424

2525
class Child2 extends AbstractClass
2626
{
27-
public function foo(): void {} // error: Unused DeadOver2\Child2::foo
27+
public function foo(): void {}
2828
}
2929

3030
function testIt(Child1 $child1): void

tests/Rule/data/DeadMethodRule/overwriting-methods-3.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44

55
interface Interface1
66
{
7-
public function foo(): void; // error: Unused DeadOver3\Interface1::foo
7+
public function foo(): void;
88
}
99

1010
interface Interface2
1111
{
12-
public function foo(): void; // error: Unused DeadOver3\Interface2::foo
12+
public function foo(): void;
1313
}
1414

1515
abstract class AbstractClass implements Interface1, Interface2
1616
{
17-
public abstract function foo(): void; // error: Unused DeadOver3\AbstractClass::foo
17+
public abstract function foo(): void;
1818
}
1919

2020
class Child1 extends AbstractClass
2121
{
22-
public function foo(): void {} // error: Unused DeadOver3\Child1::foo
22+
public function foo(): void {}
2323
}
2424

2525
class Child2 extends AbstractClass

tests/Rule/data/DeadMethodRule/overwriting-methods-4.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public function foo(): void;
99

1010
interface Interface2
1111
{
12-
public function foo(): void; // error: Unused DeadOver4\Interface2::foo
12+
public function foo(): void;
1313
}
1414

1515
abstract class AbstractClass implements Interface1, Interface2

tests/Rule/data/DeadMethodRule/overwriting-methods-5.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
interface Interface1
66
{
7-
public function foo(): void; // error: Unused DeadOver5\Interface1::foo
7+
public function foo(): void;
88
}
99

1010
interface Interface2

tests/Rule/data/DeadMethodRule/parent-call-1.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function foo(): void {
1919

2020
class Child2 extends AbstractClass
2121
{
22-
public function foo(): void {} // error: Unused ParentCall1\Child2::foo
22+
public function foo(): void {}
2323
}
2424

2525
function testIt(Child1 $child1): void

tests/Rule/data/DeadMethodRule/parent-call-2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
abstract class AbstractClass
66
{
7-
public function foo(): void {} // error: Unused ParentCall2\AbstractClass::foo
7+
public function foo(): void {}
88
}
99

1010
class Child1 extends AbstractClass

tests/Rule/data/DeadMethodRule/parent-call-4.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public function __construct()
1111

1212
class AbstractClass extends RootClass
1313
{
14-
public function __construct() // error: Unused ParentCall4\AbstractClass::__construct
14+
public function __construct()
1515
{
1616
}
1717
}

tests/Rule/data/DeadMethodRule/traits-1.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
trait Trait1 {
66

77
public static function used(): void {}
8-
public static function unused(): void {} // error: Unused DeadTrait1\Trait1::unused
8+
public static function unused(): void {}
99
}
1010

1111
class User1

tests/Rule/data/DeadMethodRule/traits-3.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
trait MyTrait1 {
66

77
public function used(): void {}
8-
public function unused(): void {} // error: Unused DeadTrait3\MyTrait1::unused
8+
public function unused(): void {}
99
}
1010

1111
interface TraitInterface
1212
{
13-
public function used(): void; // error: Unused DeadTrait3\TraitInterface::used
13+
public function used(): void;
1414
}
1515

1616
class MyUser1 implements TraitInterface

tests/Rule/data/DeadMethodRule/traits-4.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
trait MyTrait1 {
66

7-
public function __construct() // error: Unused DeadTrait4\MyTrait1::__construct
7+
public function __construct()
88
{
99
}
1010
}

tests/Rule/data/DeadMethodRule/traits-5.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
trait MyTrait1 {
66

77
// because all children override this method, it is unused
8-
public function used(): void {} // error: Unused DeadTrait5\MyTrait1::used
8+
public function used(): void {}
99
}
1010

1111
interface TraitInterface

tests/Rule/data/DeadMethodRule/traits-7.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace DeadTrait7;
44

55
trait HelloWorld {
6-
public function sayHello() { // error: Unused DeadTrait7\HelloWorld::sayHello
6+
public function sayHello() {
77
echo 'Hello World!';
88
}
99
}

tests/Rule/data/DeadMethodRule/traits-8.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace DeadTrait8;
44

55
trait A {
6-
public function smallTalk() { // error: Unused DeadTrait8\A::smallTalk
6+
public function smallTalk() {
77
echo 'a';
88
}
99
public function bigTalk() {

0 commit comments

Comments
 (0)