mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-28 13:43:31 +00:00
CS Fixes
This commit is contained in:
parent
7f1d9072dd
commit
bee8c051b5
|
@ -54,7 +54,7 @@
|
|||
"@check-cs",
|
||||
"phpunit",
|
||||
"@phpstan",
|
||||
"update-docs"
|
||||
"@update-docs"
|
||||
],
|
||||
"check-cs": "vendor/bin/ecs check bin packages src tests",
|
||||
"fix-cs": [
|
||||
|
|
|
@ -40,16 +40,19 @@ final class DelegateExceptionArgumentsRector extends AbstractPHPUnitRector
|
|||
|
||||
public function getDefinition(): RectorDefinition
|
||||
{
|
||||
return new RectorDefinition('Takes `setExpectedException()` 2nd and next arguments to own methods in PHPUnit.', [
|
||||
new CodeSample(
|
||||
'$this->setExpectedException(Exception::class, "Message", "CODE");',
|
||||
<<<'CODE_SAMPLE'
|
||||
return new RectorDefinition(
|
||||
'Takes `setExpectedException()` 2nd and next arguments to own methods in PHPUnit.',
|
||||
[
|
||||
new CodeSample(
|
||||
'$this->setExpectedException(Exception::class, "Message", "CODE");',
|
||||
<<<'CODE_SAMPLE'
|
||||
$this->setExpectedException(Exception::class);
|
||||
$this->expectExceptionMessage("Message");
|
||||
$this->expectExceptionCode("CODE");
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function isCandidate(Node $node): bool
|
||||
|
|
|
@ -45,9 +45,11 @@ final class ExceptionAnnotationRector extends AbstractPHPUnitRector
|
|||
|
||||
public function getDefinition(): RectorDefinition
|
||||
{
|
||||
return new RectorDefinition('Takes `setExpectedException()` 2nd and next arguments to own methods in PHPUnit.', [
|
||||
new CodeSample(
|
||||
<<<'CODE_SAMPLE'
|
||||
return new RectorDefinition(
|
||||
'Takes `setExpectedException()` 2nd and next arguments to own methods in PHPUnit.',
|
||||
[
|
||||
new CodeSample(
|
||||
<<<'CODE_SAMPLE'
|
||||
/**
|
||||
* @expectedException Exception
|
||||
* @expectedExceptionMessage Message
|
||||
|
@ -57,8 +59,8 @@ public function test()
|
|||
// tested code
|
||||
}
|
||||
CODE_SAMPLE
|
||||
,
|
||||
<<<'CODE_SAMPLE'
|
||||
,
|
||||
<<<'CODE_SAMPLE'
|
||||
public function test()
|
||||
{
|
||||
$this->expectException('Exception');
|
||||
|
@ -66,8 +68,9 @@ public function test()
|
|||
// tested code
|
||||
}
|
||||
CODE_SAMPLE
|
||||
),
|
||||
]);
|
||||
),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public function isCandidate(Node $node): bool
|
||||
|
|
Loading…
Reference in New Issue
Block a user