17
17
use HyperfTest \Di \Stub \NotFoundAttributeTarget ;
18
18
use PHPUnit \Framework \TestCase ;
19
19
use ReflectionClass ;
20
+ use Throwable ;
20
21
21
22
/**
22
23
* @internal
@@ -33,7 +34,7 @@ public function testGetNotFoundAttributesOfClass()
33
34
try {
34
35
$ annotationReader = new AnnotationReader ();
35
36
$ annotationReader ->getAttributes ($ reflectionClass );
36
- } catch (\ Throwable $ exception ) {
37
+ } catch (Throwable $ exception ) {
37
38
} finally {
38
39
$ actual = '' ;
39
40
if (isset ($ exception )) {
@@ -53,7 +54,7 @@ public function testGetNotFoundAttributesOfMethod()
53
54
try {
54
55
$ annotationReader = new AnnotationReader ();
55
56
$ annotationReader ->getAttributes ($ reflectionMethod );
56
- } catch (\ Throwable $ exception ) {
57
+ } catch (Throwable $ exception ) {
57
58
} finally {
58
59
$ actual = '' ;
59
60
if (isset ($ exception )) {
@@ -73,7 +74,7 @@ public function testGetNotFoundAttributesOfProperty()
73
74
try {
74
75
$ annotationReader = new AnnotationReader ();
75
76
$ annotationReader ->getAttributes ($ reflectionProperty );
76
- } catch (\ Throwable $ exception ) {
77
+ } catch (Throwable $ exception ) {
77
78
} finally {
78
79
$ actual = '' ;
79
80
if (isset ($ exception )) {
@@ -87,14 +88,14 @@ public function testIgnoreAnnotations()
87
88
{
88
89
$ reader = new AnnotationReader (['NotExistAnnotation ' ]);
89
90
90
- $ res = $ reader ->getClassAnnotations (new \ ReflectionClass (FooWithNotExistAnnotation::class));
91
+ $ res = $ reader ->getClassAnnotations (new ReflectionClass (FooWithNotExistAnnotation::class));
91
92
92
93
$ this ->assertSame (1 , count ($ res ));
93
94
$ this ->assertInstanceOf (IgnoreDemoAnnotation::class, $ res [0 ]);
94
95
95
96
$ reader = new AnnotationReader (['NotExistAnnotation ' , IgnoreDemoAnnotation::class]);
96
97
97
- $ res = $ reader ->getClassAnnotations (new \ ReflectionClass (FooWithNotExistAnnotation::class));
98
+ $ res = $ reader ->getClassAnnotations (new ReflectionClass (FooWithNotExistAnnotation::class));
98
99
99
100
$ this ->assertSame ([], $ res );
100
101
}
0 commit comments