Skip to content

Commit 318378f

Browse files
authored
[CodeQuality] Produce void callbacks with bare return in WithCallbackIdenticalToStandaloneAssertsRector (#712)
1 parent c682804 commit 318378f

20 files changed

Lines changed: 46 additions & 45 deletions

rules-tests/CodeQuality/Rector/MethodCall/WithCallbackIdenticalToStandaloneAssertsRector/Fixture/array_key_exists.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ final class ArrayKeyExists extends TestCase
3232

3333
$someMock->expects($this->any())
3434
->method('trans')
35-
->with($this->callback(function (array $args): bool {
35+
->with($this->callback(function (array $args): void {
3636
$this->assertArrayHasKey(5, $args);
3737
$this->assertInstanceOf(\stdClass::class, $args[0]);
38-
return true;
38+
return;
3939
}));
4040
}
4141
}

rules-tests/CodeQuality/Rector/MethodCall/WithCallbackIdenticalToStandaloneAssertsRector/Fixture/arrow_with_class_variable.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ final class ArrowWithClassVariable extends TestCase
3232
$this->createMock('SomeType')
3333
->method('someMethod')
3434
->with($this->callback(
35-
function ($item) use ($type): bool {
35+
function ($item) use ($type): void {
3636
$this->assertInstanceOf($type, $item);
3737
$this->assertSame('name', $item->getName());
38-
return true;
38+
return;
3939
}
4040
));
4141
}

rules-tests/CodeQuality/Rector/MethodCall/WithCallbackIdenticalToStandaloneAssertsRector/Fixture/assert_method_call_true.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ final class AssertMethodCallTrue extends TestCase
3838

3939
$someMock->expects($this->any())
4040
->method('trans')
41-
->with($this->callback(function ($arg): bool {
41+
->with($this->callback(function ($arg): void {
4242
$this->assertInstanceOf(\Rector\PHPUnit\Tests\CodeQuality\Rector\MethodCall\WithCallbackIdenticalToStandaloneAssertsRector\Source\SomeClassWithMethodCall::class, $arg);
4343
$this->assertTrue($arg->isReady());
44-
return true;
44+
return;
4545
}));
4646
}
4747
}

rules-tests/CodeQuality/Rector/MethodCall/WithCallbackIdenticalToStandaloneAssertsRector/Fixture/closure_instance_of.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ final class ClosureInstanceOf extends TestCase
3434

3535
$someMock->expects($this->any())
3636
->method('trans')
37-
->with($this->callback(function ($args): bool {
37+
->with($this->callback(function ($args): void {
3838
$this->assertCount(5, $args);
3939
$this->assertInstanceOf(\stdClass::class, $args[0]);
40-
return true;
40+
return;
4141
}));
4242
}
4343
}

rules-tests/CodeQuality/Rector/MethodCall/WithCallbackIdenticalToStandaloneAssertsRector/Fixture/cover_equal.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ final class CoverEqual extends TestCase
3232
$this->createMock('SomeType')
3333
->method('someMethod')
3434
->with($this->callback(
35-
function ($item) use ($type): bool {
35+
function ($item) use ($type): void {
3636
$this->assertInstanceOf($type, $item);
3737
$this->assertEquals('name', $item->getName());
38-
return true;
38+
return;
3939
}
4040
));
4141
}

rules-tests/CodeQuality/Rector/MethodCall/WithCallbackIdenticalToStandaloneAssertsRector/Fixture/extra_stmt.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ final class ExtraStmt extends TestCase
3535

3636
$someMock->expects($this->any())
3737
->method('trans')
38-
->with($this->callback(function ($args): bool {
38+
->with($this->callback(function ($args): void {
3939
$item = 100;
4040
$this->assertCount(5, $args);
4141
$this->assertArrayHasKey(0, $args);
4242
$this->assertSame('some_value', $args[0]);
43-
return true;
43+
return;
4444
}));
4545
}
4646
}

rules-tests/CodeQuality/Rector/MethodCall/WithCallbackIdenticalToStandaloneAssertsRector/Fixture/handle_solo_compare.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ final class HandleSoloCompare extends TestCase
3636
->method('trans')
3737
->with(
3838
$this->callback(
39-
function ($args): bool {
39+
function ($args): void {
4040
$this->assertCount(5, $args);
41-
return true;
41+
return;
4242
}
4343
)
4444
);

rules-tests/CodeQuality/Rector/MethodCall/WithCallbackIdenticalToStandaloneAssertsRector/Fixture/handle_solo_instance.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ final class HandleSoloInstance extends TestCase
3636
->method('trans')
3737
->with(
3838
$this->callback(
39-
function ($arg): bool {
39+
function ($arg): void {
4040
$this->assertInstanceOf(\stdClass::class, $arg);
41-
return true;
41+
return;
4242
}
4343
)
4444
);

rules-tests/CodeQuality/Rector/MethodCall/WithCallbackIdenticalToStandaloneAssertsRector/Fixture/handle_solo_isset.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ final class HandleSoloIsset extends TestCase
3636
->method('trans')
3737
->with(
3838
$this->callback(
39-
function ($args): bool {
39+
function ($args): void {
4040
$this->assertArrayHasKey('key', $args);
41-
return true;
41+
return;
4242
}
4343
)
4444
);

rules-tests/CodeQuality/Rector/MethodCall/WithCallbackIdenticalToStandaloneAssertsRector/Fixture/include_no_args.php.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ final class IncludeNoArgs extends TestCase
3939

4040
$someMock->expects($this->any())
4141
->method('trans')
42-
->with($this->callback(function (): bool {
42+
->with($this->callback(function (): void {
4343
$args= [1, 2, 3];
4444
$this->assertCount(5, $args);
4545
$this->assertSame('some_value', $args[0]);
46-
return true;
46+
return;
4747
}));
4848
}
4949
}

0 commit comments

Comments
 (0)