File tree 5 files changed +16
-8
lines changed
5 files changed +16
-8
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,6 @@ public static function register()
35
35
if ($ annotation instanceof Inject) {
36
36
try {
37
37
$ reflectionProperty = ReflectionManager::reflectProperty ($ currentClassName , $ property );
38
- $ reflectionProperty ->setAccessible (true );
39
38
$ container = ApplicationContext::getContainer ();
40
39
if ($ container ->has ($ annotation ->value )) {
41
40
$ reflectionProperty ->setValue ($ object , $ container ->get ($ annotation ->value ));
Original file line number Diff line number Diff line change 35
35
* @coversNothing
36
36
*/
37
37
#[CoversNothing]
38
+ /**
39
+ * @internal
40
+ * @coversNothing
41
+ */
38
42
class ScannerTest extends TestCase
39
43
{
40
44
protected function tearDown (): void
@@ -61,7 +65,6 @@ public function testGetChangedAspects()
61
65
$ scanner = new Scanner (new ScanConfig (false , '/ ' ), new NullScanHandler ());
62
66
$ ref = new ReflectionClass ($ scanner );
63
67
$ property = $ ref ->getProperty ('filesystem ' );
64
- $ property ->setAccessible (true );
65
68
$ property ->setValue ($ scanner , $ filesystem = Mockery::mock (Filesystem::class . '[lastModified] ' ));
66
69
$ times = [
67
70
Debug1Aspect::class => 5 ,
@@ -73,7 +76,6 @@ public function testGetChangedAspects()
73
76
});
74
77
75
78
$ method = $ ref ->getMethod ('getChangedAspects ' );
76
- $ method ->setAccessible (true );
77
79
78
80
$ reader = new AnnotationReader ();
79
81
$ scanner ->collect ($ reader , ReflectionManager::reflectClass (Debug2Aspect::class));
Original file line number Diff line number Diff line change 25
25
* @coversNothing
26
26
*/
27
27
#[CoversNothing]
28
+ /**
29
+ * @internal
30
+ * @coversNothing
31
+ */
28
32
class AnnotationTest extends TestCase
29
33
{
30
34
protected function tearDown (): void
@@ -37,7 +41,6 @@ public function testScanAnnotationsDirectoryNotExist()
37
41
$ scanner = new Scanner (new ScanConfig (false , '/ ' ), new NullScanHandler ());
38
42
$ ref = new ReflectionClass ($ scanner );
39
43
$ method = $ ref ->getMethod ('normalizeDir ' );
40
- $ method ->setAccessible (true );
41
44
42
45
$ this ->expectException (DirectoryNotExistException::class);
43
46
$ method ->invokeArgs ($ scanner , [['/not_exists ' ]]);
@@ -48,7 +51,6 @@ public function testScanAnnotationsDirectoryEmpty()
48
51
$ scanner = new Scanner (new ScanConfig (false , '/ ' ), new NullScanHandler ());
49
52
$ ref = new ReflectionClass ($ scanner );
50
53
$ method = $ ref ->getMethod ('normalizeDir ' );
51
- $ method ->setAccessible (true );
52
54
53
55
$ this ->assertSame ([], $ method ->invokeArgs ($ scanner , [[]]));
54
56
}
Original file line number Diff line number Diff line change 26
26
* @coversNothing
27
27
*/
28
28
#[CoversNothing]
29
+ /**
30
+ * @internal
31
+ * @coversNothing
32
+ */
29
33
class ProxyCallVisitorTest extends TestCase
30
34
{
31
35
protected function tearDown (): void
@@ -58,7 +62,6 @@ protected function bar()
58
62
$ proxyCallVisitor = new ProxyCallVisitor (new VisitorMetadata ('SomeClass ' ));
59
63
60
64
$ reflectionMethod = new ReflectionMethod ($ proxyCallVisitor , 'shouldRewrite ' );
61
- $ reflectionMethod ->setAccessible (true );
62
65
$ this ->assertFalse ($ reflectionMethod ->invoke ($ proxyCallVisitor , $ stmts ->stmts [0 ]));
63
66
$ this ->assertTrue ($ reflectionMethod ->invoke ($ proxyCallVisitor , $ stmts ->stmts [1 ]));
64
67
}
@@ -74,7 +77,6 @@ public function testInterfaceShouldNotRewrite()
74
77
$ proxyCallVisitor = new ProxyCallVisitor ($ visitorMetadata );
75
78
76
79
$ reflectionMethod = new ReflectionMethod ($ proxyCallVisitor , 'shouldRewrite ' );
77
- $ reflectionMethod ->setAccessible (true );
78
80
$ this ->assertTrue ($ reflectionMethod ->invoke ($ proxyCallVisitor , new ClassMethod ('foo ' )));
79
81
80
82
$ visitorMetadata ->classLike = Node \Stmt \Interface_::class;
Original file line number Diff line number Diff line change 23
23
* @coversNothing
24
24
*/
25
25
#[CoversNothing]
26
+ /**
27
+ * @internal
28
+ * @coversNothing
29
+ */
26
30
class ClassLoaderTest extends TestCase
27
31
{
28
32
public function testDotEnv ()
@@ -35,7 +39,6 @@ public function __construct()
35
39
36
40
$ ref = new ReflectionClass ($ class );
37
41
$ method = $ ref ->getMethod ('loadDotenv ' );
38
- $ method ->setAccessible (true );
39
42
$ method ->invoke ($ class );
40
43
41
44
$ this ->assertNotEquals ('0.0.0 ' , env ('SW_VERSION ' ));
You can’t perform that action at this time.
0 commit comments