File tree Expand file tree Collapse file tree 1 file changed +62
-0
lines changed
rules-tests/DependencyInjection/Rector/Class_/GetBySymfonyStringToConstructorInjectionRector/Fixture Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace Rector \Symfony \Tests \DependencyInjection \Rector \Class_ \GetBySymfonyStringToConstructorInjectionRector \Fixture ;
4
+
5
+ use Psr \EventDispatcher \EventDispatcherInterface ;
6
+ use Symfony \Bundle \FrameworkBundle \Controller \Controller ;
7
+
8
+ class PreferRequiredSetter extends Controller
9
+ {
10
+ private EventDispatcherInterface $ eventDispatcher ;
11
+
12
+ /**
13
+ * @required
14
+ */
15
+ public function autowire (
16
+ EventDispatcherInterface $ eventDispatcher
17
+ ) {
18
+ $ this ->eventDispatcher = $ eventDispatcher ;
19
+ }
20
+
21
+
22
+ public function configure ()
23
+ {
24
+ $ someType = $ this ->get ('validator ' );
25
+ }
26
+ }
27
+
28
+ ?>
29
+ -----
30
+ <?php
31
+
32
+ namespace Rector \Symfony \Tests \DependencyInjection \Rector \Class_ \GetBySymfonyStringToConstructorInjectionRector \Fixture ;
33
+
34
+ use Psr \EventDispatcher \EventDispatcherInterface ;
35
+ use Symfony \Bundle \FrameworkBundle \Controller \Controller ;
36
+ use Symfony \Component \Validator \Validator \ValidatorInterface ;
37
+
38
+ class PreferRequiredSetter extends Controller
39
+ {
40
+ private EventDispatcherInterface $ eventDispatcher ;
41
+
42
+ private ValidatorInterface $ validator ;
43
+
44
+ /**
45
+ * @required
46
+ */
47
+ public function autowire (
48
+ EventDispatcherInterface $ eventDispatcher ,
49
+ ValidatorInterface $ validator
50
+ ) {
51
+ $ this ->eventDispatcher = $ eventDispatcher ;
52
+ $ this ->validator = $ validator ;
53
+ }
54
+
55
+
56
+ public function configure ()
57
+ {
58
+ $ someType = $ this ->validator ;
59
+ }
60
+ }
61
+
62
+ ?>
You can’t perform that action at this time.
0 commit comments