File tree Expand file tree Collapse file tree
rules-tests/Php81/Rector/MethodCall/RemoveReflectionSetAccessibleCallsRector/Fixture Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \Php81 \Rector \MethodCall \RemoveReflectionSetAccessibleCallsRector \Fixture ;
4+
5+ use ReflectionProperty ;
6+
7+ $ accessProperty = function (): void {
8+ $ reflectionProperty = new ReflectionProperty ('Foo ' , 'bar ' );
9+ $ reflectionProperty ->setAccessible (true );
10+ $ reflectionProperty ->getValue ();
11+ };
12+
13+ ?>
14+ -----
15+ <?php
16+
17+ namespace Rector \Tests \Php81 \Rector \MethodCall \RemoveReflectionSetAccessibleCallsRector \Fixture ;
18+
19+ use ReflectionProperty ;
20+
21+ $ accessProperty = function (): void {
22+ $ reflectionProperty = new ReflectionProperty ('Foo ' , 'bar ' );
23+ $ reflectionProperty ->getValue ();
24+ };
25+
26+ ?>
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \Php81 \Rector \MethodCall \RemoveReflectionSetAccessibleCallsRector \Fixture ;
4+
5+ use ReflectionProperty ;
6+
7+ final class SkipMethodCallCaller
8+ {
9+ public function run (): void
10+ {
11+ $ this ->getReflectionProperty ()->setAccessible (true );
12+ }
13+
14+ private function getReflectionProperty (): ReflectionProperty
15+ {
16+ return new ReflectionProperty ('Foo ' , 'bar ' );
17+ }
18+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \Php81 \Rector \MethodCall \RemoveReflectionSetAccessibleCallsRector \Fixture ;
4+
5+ final class SkipNonReflectionObject
6+ {
7+ public function run (): void
8+ {
9+ $ service = new \stdClass ();
10+ $ service ->setAccessible (true );
11+ }
12+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \Php81 \Rector \MethodCall \RemoveReflectionSetAccessibleCallsRector \Fixture ;
4+
5+ final class SkipUntypedParam
6+ {
7+ public function run ($ reflectionProperty ): void
8+ {
9+ $ reflectionProperty ->setAccessible (true );
10+ }
11+ }
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \Php81 \Rector \MethodCall \RemoveReflectionSetAccessibleCallsRector \Fixture ;
4+
5+ use ReflectionMethod ;
6+
7+ function standaloneReflectionCall (): void
8+ {
9+ $ reflectionMethod = new ReflectionMethod ('Foo ' , 'bar ' );
10+ $ reflectionMethod ->setAccessible (true );
11+ $ reflectionMethod ->invoke (null );
12+ }
13+
14+ ?>
15+ -----
16+ <?php
17+
18+ namespace Rector \Tests \Php81 \Rector \MethodCall \RemoveReflectionSetAccessibleCallsRector \Fixture ;
19+
20+ use ReflectionMethod ;
21+
22+ function standaloneReflectionCall (): void
23+ {
24+ $ reflectionMethod = new ReflectionMethod ('Foo ' , 'bar ' );
25+ $ reflectionMethod ->invoke (null );
26+ }
27+
28+ ?>
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ namespace Rector \Tests \Php81 \Rector \MethodCall \RemoveReflectionSetAccessibleCallsRector \Fixture ;
4+
5+ use ReflectionProperty ;
6+
7+ final class TypedParam
8+ {
9+ public function run (ReflectionProperty $ reflectionProperty ): void
10+ {
11+ $ reflectionProperty ->setAccessible (true );
12+ $ reflectionProperty ->getValue ();
13+ }
14+ }
15+
16+ ?>
17+ -----
18+ <?php
19+
20+ namespace Rector \Tests \Php81 \Rector \MethodCall \RemoveReflectionSetAccessibleCallsRector \Fixture ;
21+
22+ use ReflectionProperty ;
23+
24+ final class TypedParam
25+ {
26+ public function run (ReflectionProperty $ reflectionProperty ): void
27+ {
28+ $ reflectionProperty ->getValue ();
29+ }
30+ }
31+
32+ ?>
You can’t perform that action at this time.
0 commit comments