Skip to content

Commit 99cadba

Browse files
committed
cs
1 parent d5cf1e2 commit 99cadba

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/NodeFactory/ExpectExceptionMethodCallFactory.php

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

55
namespace Rector\PhpSpecToPHPUnit\NodeFactory;
66

7+
use Rector\PhpSpecToPHPUnit\Exception\ShouldNotHappenException;
78
use PhpParser\Node\Arg;
89
use PhpParser\Node\Expr;
910
use PhpParser\Node\Expr\ClassConstFetch;
@@ -75,7 +76,7 @@ private function createThisExpectException(Expr $expr): MethodCall
7576
{
7677
if ($expr instanceof New_) {
7778
if ($expr->class instanceof Class_) {
78-
throw new \Rector\PhpSpecToPHPUnit\Exception\ShouldNotHappenException();
79+
throw new ShouldNotHappenException();
7980
}
8081

8182
$arg = new Arg(new ClassConstFetch($expr->class, 'class'));

src/NodeFactory/LetMockNodeFactory.php

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

55
namespace Rector\PhpSpecToPHPUnit\NodeFactory;
66

7+
use Rector\PhpSpecToPHPUnit\Exception\ShouldNotHappenException;
78
use PhpParser\Node\Expr\Assign;
89
use PhpParser\Node\Expr\ClassConstFetch;
910
use PhpParser\Node\Expr\PropertyFetch;
@@ -41,7 +42,7 @@ public function createMockProperties(array $params): array
4142
$mockProperty = $this->crateMockProperty($parameterName);
4243

4344
if (! $param->type instanceof Name) {
44-
throw new \Rector\PhpSpecToPHPUnit\Exception\ShouldNotHappenException();
45+
throw new ShouldNotHappenException();
4546
}
4647

4748
$mockedClass = $param->type->toString();
@@ -67,7 +68,7 @@ public function createMockPropertyAssignExpressions(array $params): array
6768
foreach ($params as $param) {
6869
$parameterName = $this->createMockVariableName($param);
6970
if (! $param->type instanceof Name) {
70-
throw new \Rector\PhpSpecToPHPUnit\Exception\ShouldNotHappenException();
71+
throw new ShouldNotHappenException();
7172
}
7273

7374
$mockPropertyFetch = new PropertyFetch(new Variable('this'), new Identifier($parameterName));

src/ServiceMockResolver.php

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

55
namespace Rector\PhpSpecToPHPUnit;
66

7+
use Rector\PhpSpecToPHPUnit\Exception\ShouldNotHappenException;
78
use PhpParser\Node\Name;
89
use PhpParser\Node\Param;
910
use PhpParser\Node\Stmt\ClassMethod;
@@ -45,7 +46,7 @@ private function createServiceMock(Param $param): ServiceMock
4546

4647
// this should be always typed
4748
if (! $param->type instanceof Name) {
48-
throw new \Rector\PhpSpecToPHPUnit\Exception\ShouldNotHappenException(sprintf(
49+
throw new ShouldNotHappenException(sprintf(
4950
'Param "%s" must be typed',
5051
$variableName
5152
));

0 commit comments

Comments
 (0)