File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 44
55namespace Rector \PhpSpecToPHPUnit \NodeFactory ;
66
7+ use Rector \PhpSpecToPHPUnit \Exception \ShouldNotHappenException ;
78use PhpParser \Node \Arg ;
89use PhpParser \Node \Expr ;
910use 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 ' ));
Original file line number Diff line number Diff line change 44
55namespace Rector \PhpSpecToPHPUnit \NodeFactory ;
66
7+ use Rector \PhpSpecToPHPUnit \Exception \ShouldNotHappenException ;
78use PhpParser \Node \Expr \Assign ;
89use PhpParser \Node \Expr \ClassConstFetch ;
910use 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 ));
Original file line number Diff line number Diff line change 44
55namespace Rector \PhpSpecToPHPUnit ;
66
7+ use Rector \PhpSpecToPHPUnit \Exception \ShouldNotHappenException ;
78use PhpParser \Node \Name ;
89use PhpParser \Node \Param ;
910use 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 ));
You can’t perform that action at this time.
0 commit comments