From 2552afc40f1766c35fe2ca61f89de3fa4eb08372 Mon Sep 17 00:00:00 2001 From: Jan Nedbal Date: Tue, 3 Sep 2024 15:29:41 +0200 Subject: [PATCH] Run compare script to see diffs --- tests/Rule/data/DeadMethodRule/array-map-1.php | 10 +++++----- tests/Rule/data/DeadMethodRule/basic.php | 8 ++++---- tests/Rule/data/DeadMethodRule/class-string.php | 2 +- tests/Rule/data/DeadMethodRule/ctor-interface.php | 2 +- tests/Rule/data/DeadMethodRule/ctor.php | 2 +- tests/Rule/data/DeadMethodRule/dead-in-parent-1.php | 2 +- tests/Rule/data/DeadMethodRule/dynamic-method.php | 8 ++++---- tests/Rule/data/DeadMethodRule/entrypoint.php | 2 +- tests/Rule/data/DeadMethodRule/indirect-interface.php | 2 +- tests/Rule/data/DeadMethodRule/nullsafe.php | 2 +- .../Rule/data/DeadMethodRule/overwriting-methods-1.php | 4 ++-- .../Rule/data/DeadMethodRule/overwriting-methods-2.php | 8 ++++---- .../Rule/data/DeadMethodRule/overwriting-methods-3.php | 8 ++++---- .../Rule/data/DeadMethodRule/overwriting-methods-4.php | 2 +- .../Rule/data/DeadMethodRule/overwriting-methods-5.php | 2 +- tests/Rule/data/DeadMethodRule/parent-call-1.php | 2 +- tests/Rule/data/DeadMethodRule/parent-call-2.php | 2 +- tests/Rule/data/DeadMethodRule/parent-call-4.php | 2 +- tests/Rule/data/DeadMethodRule/traits-1.php | 2 +- tests/Rule/data/DeadMethodRule/traits-3.php | 4 ++-- tests/Rule/data/DeadMethodRule/traits-4.php | 2 +- tests/Rule/data/DeadMethodRule/traits-5.php | 2 +- tests/Rule/data/DeadMethodRule/traits-7.php | 2 +- tests/Rule/data/DeadMethodRule/traits-8.php | 2 +- 24 files changed, 42 insertions(+), 42 deletions(-) diff --git a/tests/Rule/data/DeadMethodRule/array-map-1.php b/tests/Rule/data/DeadMethodRule/array-map-1.php index f795204..b8b9fde 100644 --- a/tests/Rule/data/DeadMethodRule/array-map-1.php +++ b/tests/Rule/data/DeadMethodRule/array-map-1.php @@ -15,10 +15,10 @@ public function __construct() } public function method1(string $foo): void {} // error: Unused DeadMap\ArrayMapTest::method1 - public function method2(): void {} - public function method3(): void {} - public function method4(): void {} - public static function method5(): void {} + public function method2(): void {} // error: Unused DeadMap\ArrayMapTest::method2 + public function method3(): void {} // error: Unused DeadMap\ArrayMapTest::method3 + public function method4(): void {} // error: Unused DeadMap\ArrayMapTest::method4 + public static function method5(): void {} // error: Unused DeadMap\ArrayMapTest::method5 public static function method6(): void {} // error: Unused DeadMap\ArrayMapTest::method6 } @@ -28,7 +28,7 @@ public function method2(): void {} public function method3(): void {} public function method4(): void {} public static function method5(): void {} // should be reported (https://github.com/phpstan/phpstan-src/pull/3372) - public static function method6(): void {} // error: Unused DeadMap\Child::method6 + public static function method6(): void {} } diff --git a/tests/Rule/data/DeadMethodRule/basic.php b/tests/Rule/data/DeadMethodRule/basic.php index e78ba58..fd4293b 100644 --- a/tests/Rule/data/DeadMethodRule/basic.php +++ b/tests/Rule/data/DeadMethodRule/basic.php @@ -62,7 +62,7 @@ abstract class TestParent { use TestTrait; - public function __construct() // error: Unused DeadBasic\TestParent::__construct + public function __construct() { } @@ -72,7 +72,7 @@ public function parentMethodUsed(TestChild $child): void $this->traitMethodUsed(); } - public function overwrittenParentMethodUsedByChild(): void // error: Unused DeadBasic\TestParent::overwrittenParentMethodUsedByChild + public function overwrittenParentMethodUsedByChild(): void { } @@ -85,7 +85,7 @@ public function parentMethodUnused(): void // error: Unused DeadBasic\TestParen trait TestTrait { - public function __construct() // error: Unused DeadBasic\TestTrait::__construct + public function __construct() { } @@ -94,7 +94,7 @@ public function traitMethodUsed(): void } - public function traitMethodUnused(): void // error: Unused DeadBasic\TestTrait::traitMethodUnused + public function traitMethodUnused(): void { } diff --git a/tests/Rule/data/DeadMethodRule/class-string.php b/tests/Rule/data/DeadMethodRule/class-string.php index bfcb719..423d64e 100644 --- a/tests/Rule/data/DeadMethodRule/class-string.php +++ b/tests/Rule/data/DeadMethodRule/class-string.php @@ -4,7 +4,7 @@ class ClassWithMethod { - public static function someMethod(): void {} + public static function someMethod(): void {} // error: Unused ClassStringCall\ClassWithMethod::someMethod } /** diff --git a/tests/Rule/data/DeadMethodRule/ctor-interface.php b/tests/Rule/data/DeadMethodRule/ctor-interface.php index 3fec867..ac675fb 100644 --- a/tests/Rule/data/DeadMethodRule/ctor-interface.php +++ b/tests/Rule/data/DeadMethodRule/ctor-interface.php @@ -4,7 +4,7 @@ interface MyInterface { - public function __construct(); // error: Unused CtorInterface\MyInterface::__construct + public function __construct(); } class Child1 implements MyInterface diff --git a/tests/Rule/data/DeadMethodRule/ctor.php b/tests/Rule/data/DeadMethodRule/ctor.php index 8246d39..d57c431 100644 --- a/tests/Rule/data/DeadMethodRule/ctor.php +++ b/tests/Rule/data/DeadMethodRule/ctor.php @@ -11,7 +11,7 @@ public function __construct() class Child1 extends ParentClass { - public function __construct() // error: Unused Ctor\Child1::__construct + public function __construct() { } } diff --git a/tests/Rule/data/DeadMethodRule/dead-in-parent-1.php b/tests/Rule/data/DeadMethodRule/dead-in-parent-1.php index 5d0e3cd..5022eee 100644 --- a/tests/Rule/data/DeadMethodRule/dead-in-parent-1.php +++ b/tests/Rule/data/DeadMethodRule/dead-in-parent-1.php @@ -20,7 +20,7 @@ class B extends A /** * @inheritDoc */ - public function __construct() // error: Unused DeadParent\B::__construct + public function __construct() { parent::__construct(); } diff --git a/tests/Rule/data/DeadMethodRule/dynamic-method.php b/tests/Rule/data/DeadMethodRule/dynamic-method.php index 5ec0d83..3c595c5 100644 --- a/tests/Rule/data/DeadMethodRule/dynamic-method.php +++ b/tests/Rule/data/DeadMethodRule/dynamic-method.php @@ -4,11 +4,11 @@ class Test { - public static function a(): void {} - public static function b(): void {} + public static function a(): void {} // error: Unused DynamicMethod\Test::a + public static function b(): void {} // error: Unused DynamicMethod\Test::b - public function c(): void {} - public function d(): void {} + public function c(): void {} // error: Unused DynamicMethod\Test::c + public function d(): void {} // error: Unused DynamicMethod\Test::d } /** diff --git a/tests/Rule/data/DeadMethodRule/entrypoint.php b/tests/Rule/data/DeadMethodRule/entrypoint.php index ee3d4f1..9f68e80 100644 --- a/tests/Rule/data/DeadMethodRule/entrypoint.php +++ b/tests/Rule/data/DeadMethodRule/entrypoint.php @@ -9,7 +9,7 @@ public function __construct() { } - public function someUnused(): void + public function someUnused(): void // error: Unused DeadEntrypoint\Entrypoint::someUnused { Dead::usedMethod(); } diff --git a/tests/Rule/data/DeadMethodRule/indirect-interface.php b/tests/Rule/data/DeadMethodRule/indirect-interface.php index 8b6a804..d9b963f 100644 --- a/tests/Rule/data/DeadMethodRule/indirect-interface.php +++ b/tests/Rule/data/DeadMethodRule/indirect-interface.php @@ -4,7 +4,7 @@ interface FooInterface { - public function foo(): void; // error: Unused DeadIndirect\FooInterface::foo + public function foo(): void; } abstract class FooAbstract diff --git a/tests/Rule/data/DeadMethodRule/nullsafe.php b/tests/Rule/data/DeadMethodRule/nullsafe.php index 3025b46..b8e0ad7 100644 --- a/tests/Rule/data/DeadMethodRule/nullsafe.php +++ b/tests/Rule/data/DeadMethodRule/nullsafe.php @@ -12,7 +12,7 @@ public function second(): self { return $this; } - public static function secondStatic(): self { + public static function secondStatic(): self { // error: Unused Nullsafe\A::secondStatic return new self(); } } diff --git a/tests/Rule/data/DeadMethodRule/overwriting-methods-1.php b/tests/Rule/data/DeadMethodRule/overwriting-methods-1.php index 86e50e0..d3d0895 100644 --- a/tests/Rule/data/DeadMethodRule/overwriting-methods-1.php +++ b/tests/Rule/data/DeadMethodRule/overwriting-methods-1.php @@ -4,12 +4,12 @@ interface Interface1 { - public function foo(): void; // error: Unused DeadOver1\Interface1::foo + public function foo(): void; } interface Interface2 { - public function foo(): void; // error: Unused DeadOver1\Interface2::foo + public function foo(): void; } abstract class AbstractClass implements Interface1, Interface2 diff --git a/tests/Rule/data/DeadMethodRule/overwriting-methods-2.php b/tests/Rule/data/DeadMethodRule/overwriting-methods-2.php index 6883cfc..8fa17b1 100644 --- a/tests/Rule/data/DeadMethodRule/overwriting-methods-2.php +++ b/tests/Rule/data/DeadMethodRule/overwriting-methods-2.php @@ -4,17 +4,17 @@ interface Interface1 { - public function foo(): void; // error: Unused DeadOver2\Interface1::foo + public function foo(): void; } interface Interface2 { - public function foo(): void; // error: Unused DeadOver2\Interface2::foo + public function foo(): void; } abstract class AbstractClass implements Interface1, Interface2 { - public abstract function foo(): void; // error: Unused DeadOver2\AbstractClass::foo + public abstract function foo(): void; } class Child1 extends AbstractClass @@ -24,7 +24,7 @@ public function foo(): void {} class Child2 extends AbstractClass { - public function foo(): void {} // error: Unused DeadOver2\Child2::foo + public function foo(): void {} } function testIt(Child1 $child1): void diff --git a/tests/Rule/data/DeadMethodRule/overwriting-methods-3.php b/tests/Rule/data/DeadMethodRule/overwriting-methods-3.php index aa2fd08..fd4a0b4 100644 --- a/tests/Rule/data/DeadMethodRule/overwriting-methods-3.php +++ b/tests/Rule/data/DeadMethodRule/overwriting-methods-3.php @@ -4,22 +4,22 @@ interface Interface1 { - public function foo(): void; // error: Unused DeadOver3\Interface1::foo + public function foo(): void; } interface Interface2 { - public function foo(): void; // error: Unused DeadOver3\Interface2::foo + public function foo(): void; } abstract class AbstractClass implements Interface1, Interface2 { - public abstract function foo(): void; // error: Unused DeadOver3\AbstractClass::foo + public abstract function foo(): void; } class Child1 extends AbstractClass { - public function foo(): void {} // error: Unused DeadOver3\Child1::foo + public function foo(): void {} } class Child2 extends AbstractClass diff --git a/tests/Rule/data/DeadMethodRule/overwriting-methods-4.php b/tests/Rule/data/DeadMethodRule/overwriting-methods-4.php index e7fca49..05d0dd3 100644 --- a/tests/Rule/data/DeadMethodRule/overwriting-methods-4.php +++ b/tests/Rule/data/DeadMethodRule/overwriting-methods-4.php @@ -9,7 +9,7 @@ public function foo(): void; interface Interface2 { - public function foo(): void; // error: Unused DeadOver4\Interface2::foo + public function foo(): void; } abstract class AbstractClass implements Interface1, Interface2 diff --git a/tests/Rule/data/DeadMethodRule/overwriting-methods-5.php b/tests/Rule/data/DeadMethodRule/overwriting-methods-5.php index d0b4036..48ffe94 100644 --- a/tests/Rule/data/DeadMethodRule/overwriting-methods-5.php +++ b/tests/Rule/data/DeadMethodRule/overwriting-methods-5.php @@ -4,7 +4,7 @@ interface Interface1 { - public function foo(): void; // error: Unused DeadOver5\Interface1::foo + public function foo(): void; } interface Interface2 diff --git a/tests/Rule/data/DeadMethodRule/parent-call-1.php b/tests/Rule/data/DeadMethodRule/parent-call-1.php index b1c1429..bf175dc 100644 --- a/tests/Rule/data/DeadMethodRule/parent-call-1.php +++ b/tests/Rule/data/DeadMethodRule/parent-call-1.php @@ -19,7 +19,7 @@ public function foo(): void { class Child2 extends AbstractClass { - public function foo(): void {} // error: Unused ParentCall1\Child2::foo + public function foo(): void {} } function testIt(Child1 $child1): void diff --git a/tests/Rule/data/DeadMethodRule/parent-call-2.php b/tests/Rule/data/DeadMethodRule/parent-call-2.php index c460f69..de7ec50 100644 --- a/tests/Rule/data/DeadMethodRule/parent-call-2.php +++ b/tests/Rule/data/DeadMethodRule/parent-call-2.php @@ -4,7 +4,7 @@ abstract class AbstractClass { - public function foo(): void {} // error: Unused ParentCall2\AbstractClass::foo + public function foo(): void {} } class Child1 extends AbstractClass diff --git a/tests/Rule/data/DeadMethodRule/parent-call-4.php b/tests/Rule/data/DeadMethodRule/parent-call-4.php index 6ddf264..9923d12 100644 --- a/tests/Rule/data/DeadMethodRule/parent-call-4.php +++ b/tests/Rule/data/DeadMethodRule/parent-call-4.php @@ -11,7 +11,7 @@ public function __construct() class AbstractClass extends RootClass { - public function __construct() // error: Unused ParentCall4\AbstractClass::__construct + public function __construct() { } } diff --git a/tests/Rule/data/DeadMethodRule/traits-1.php b/tests/Rule/data/DeadMethodRule/traits-1.php index 127b312..6d3e84c 100644 --- a/tests/Rule/data/DeadMethodRule/traits-1.php +++ b/tests/Rule/data/DeadMethodRule/traits-1.php @@ -5,7 +5,7 @@ trait Trait1 { public static function used(): void {} - public static function unused(): void {} // error: Unused DeadTrait1\Trait1::unused + public static function unused(): void {} } class User1 diff --git a/tests/Rule/data/DeadMethodRule/traits-3.php b/tests/Rule/data/DeadMethodRule/traits-3.php index b7695d0..59723cc 100644 --- a/tests/Rule/data/DeadMethodRule/traits-3.php +++ b/tests/Rule/data/DeadMethodRule/traits-3.php @@ -5,12 +5,12 @@ trait MyTrait1 { public function used(): void {} - public function unused(): void {} // error: Unused DeadTrait3\MyTrait1::unused + public function unused(): void {} } interface TraitInterface { - public function used(): void; // error: Unused DeadTrait3\TraitInterface::used + public function used(): void; } class MyUser1 implements TraitInterface diff --git a/tests/Rule/data/DeadMethodRule/traits-4.php b/tests/Rule/data/DeadMethodRule/traits-4.php index c273f87..b7d8c69 100644 --- a/tests/Rule/data/DeadMethodRule/traits-4.php +++ b/tests/Rule/data/DeadMethodRule/traits-4.php @@ -4,7 +4,7 @@ trait MyTrait1 { - public function __construct() // error: Unused DeadTrait4\MyTrait1::__construct + public function __construct() { } } diff --git a/tests/Rule/data/DeadMethodRule/traits-5.php b/tests/Rule/data/DeadMethodRule/traits-5.php index 22bc2fe..a6b2846 100644 --- a/tests/Rule/data/DeadMethodRule/traits-5.php +++ b/tests/Rule/data/DeadMethodRule/traits-5.php @@ -5,7 +5,7 @@ trait MyTrait1 { // because all children override this method, it is unused - public function used(): void {} // error: Unused DeadTrait5\MyTrait1::used + public function used(): void {} } interface TraitInterface diff --git a/tests/Rule/data/DeadMethodRule/traits-7.php b/tests/Rule/data/DeadMethodRule/traits-7.php index 3852761..740f1f2 100644 --- a/tests/Rule/data/DeadMethodRule/traits-7.php +++ b/tests/Rule/data/DeadMethodRule/traits-7.php @@ -3,7 +3,7 @@ namespace DeadTrait7; trait HelloWorld { - public function sayHello() { // error: Unused DeadTrait7\HelloWorld::sayHello + public function sayHello() { echo 'Hello World!'; } } diff --git a/tests/Rule/data/DeadMethodRule/traits-8.php b/tests/Rule/data/DeadMethodRule/traits-8.php index aaf2274..f299f8b 100644 --- a/tests/Rule/data/DeadMethodRule/traits-8.php +++ b/tests/Rule/data/DeadMethodRule/traits-8.php @@ -3,7 +3,7 @@ namespace DeadTrait8; trait A { - public function smallTalk() { // error: Unused DeadTrait8\A::smallTalk + public function smallTalk() { echo 'a'; } public function bigTalk() {