Skip to content

Commit

Permalink
Run compare script to see diffs
Browse files Browse the repository at this point in the history
  • Loading branch information
janedbal committed Sep 3, 2024
1 parent 4ae54c0 commit 2552afc
Show file tree
Hide file tree
Showing 24 changed files with 42 additions and 42 deletions.
10 changes: 5 additions & 5 deletions tests/Rule/data/DeadMethodRule/array-map-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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 {}

}

Expand Down
8 changes: 4 additions & 4 deletions tests/Rule/data/DeadMethodRule/basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ abstract class TestParent {

use TestTrait;

public function __construct() // error: Unused DeadBasic\TestParent::__construct
public function __construct()
{
}

Expand All @@ -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
{

}
Expand All @@ -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()
{
}

Expand All @@ -94,7 +94,7 @@ public function traitMethodUsed(): void

}

public function traitMethodUnused(): void // error: Unused DeadBasic\TestTrait::traitMethodUnused
public function traitMethodUnused(): void
{

}
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/class-string.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class ClassWithMethod {

public static function someMethod(): void {}
public static function someMethod(): void {} // error: Unused ClassStringCall\ClassWithMethod::someMethod
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/ctor-interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

interface MyInterface
{
public function __construct(); // error: Unused CtorInterface\MyInterface::__construct
public function __construct();
}

class Child1 implements MyInterface
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/ctor.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __construct()

class Child1 extends ParentClass
{
public function __construct() // error: Unused Ctor\Child1::__construct
public function __construct()
{
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/dead-in-parent-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class B extends A
/**
* @inheritDoc
*/
public function __construct() // error: Unused DeadParent\B::__construct
public function __construct()
{
parent::__construct();
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Rule/data/DeadMethodRule/dynamic-method.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/entrypoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public function __construct()
{
}

public function someUnused(): void
public function someUnused(): void // error: Unused DeadEntrypoint\Entrypoint::someUnused
{
Dead::usedMethod();
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/indirect-interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

interface FooInterface
{
public function foo(): void; // error: Unused DeadIndirect\FooInterface::foo
public function foo(): void;
}

abstract class FooAbstract
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/nullsafe.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Rule/data/DeadMethodRule/overwriting-methods-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/Rule/data/DeadMethodRule/overwriting-methods-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions tests/Rule/data/DeadMethodRule/overwriting-methods-3.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/overwriting-methods-4.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/overwriting-methods-5.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

interface Interface1
{
public function foo(): void; // error: Unused DeadOver5\Interface1::foo
public function foo(): void;
}

interface Interface2
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/parent-call-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/parent-call-2.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

abstract class AbstractClass
{
public function foo(): void {} // error: Unused ParentCall2\AbstractClass::foo
public function foo(): void {}
}

class Child1 extends AbstractClass
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/parent-call-4.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function __construct()

class AbstractClass extends RootClass
{
public function __construct() // error: Unused ParentCall4\AbstractClass::__construct
public function __construct()
{
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/traits-1.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/Rule/data/DeadMethodRule/traits-3.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/traits-4.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

trait MyTrait1 {

public function __construct() // error: Unused DeadTrait4\MyTrait1::__construct
public function __construct()
{
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/traits-5.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/traits-7.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace DeadTrait7;

trait HelloWorld {
public function sayHello() { // error: Unused DeadTrait7\HelloWorld::sayHello
public function sayHello() {
echo 'Hello World!';
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Rule/data/DeadMethodRule/traits-8.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace DeadTrait8;

trait A {
public function smallTalk() { // error: Unused DeadTrait8\A::smallTalk
public function smallTalk() {
echo 'a';
}
public function bigTalk() {
Expand Down

0 comments on commit 2552afc

Please sign in to comment.