12
12
13
13
namespace PHPCR \Shell \DependencyInjection ;
14
14
15
+ use DTL \Glob \GlobHelper ;
16
+ use PHPCR \Shell \Config \Config ;
17
+ use PHPCR \Shell \Config \ConfigManager ;
18
+ use PHPCR \Shell \Config \Profile ;
19
+ use PHPCR \Shell \Config \ProfileLoader ;
20
+ use PHPCR \Shell \Console \Application \EmbeddedApplication ;
21
+ use PHPCR \Shell \Console \Application \ShellApplication ;
22
+ use PHPCR \Shell \Console \Helper \EditorHelper ;
23
+ use PHPCR \Shell \Console \Helper \NodeHelper ;
24
+ use PHPCR \Shell \Console \Helper \PathHelper ;
25
+ use PHPCR \Shell \Console \Helper \RepositoryHelper ;
26
+ use PHPCR \Shell \Console \Helper \ResultFormatterHelper ;
27
+ use PHPCR \Shell \Console \Helper \TextHelper ;
28
+ use PHPCR \Shell \Console \Input \AutoComplete ;
29
+ use PHPCR \Shell \Phpcr \SessionManager ;
15
30
use PHPCR \Shell \PhpcrShell ;
31
+ use PHPCR \Shell \Query \UpdateProcessor ;
32
+ use PHPCR \Shell \Subscriber \AliasSubscriber ;
33
+ use PHPCR \Shell \Subscriber \ConfigInitSubscriber ;
34
+ use PHPCR \Shell \Subscriber \ExceptionSubscriber ;
35
+ use PHPCR \Shell \Subscriber \ProfileFromSessionInputSubscriber ;
36
+ use PHPCR \Shell \Subscriber \ProfileLoaderSubscriber ;
37
+ use PHPCR \Shell \Subscriber \ProfileWriterSubscriber ;
38
+ use PHPCR \Shell \Transport \Transport \DoctrineDbal ;
39
+ use PHPCR \Shell \Transport \Transport \JackalopeFs ;
40
+ use PHPCR \Shell \Transport \Transport \Jackrabbit ;
41
+ use PHPCR \Shell \Transport \TransportRegistry ;
42
+ use Symfony \Component \Console \Helper \QuestionHelper ;
16
43
use Symfony \Component \DependencyInjection \ContainerBuilder ;
17
44
use Symfony \Component \DependencyInjection \Reference ;
45
+ use Symfony \Component \EventDispatcher \EventDispatcher ;
46
+ use Symfony \Component \ExpressionLanguage \ExpressionLanguage ;
18
47
19
48
class Container extends ContainerBuilder
20
49
{
@@ -24,9 +53,9 @@ class Container extends ContainerBuilder
24
53
* @var array Transports
25
54
*/
26
55
protected $ transports = [
27
- 'transport.transport.doctrinedbal ' => ' PHPCR\Shell\Transport\Transport\ DoctrineDbal' ,
28
- 'transport.transport.jackrabbit ' => ' PHPCR\Shell\Transport\Transport\ Jackrabbit' ,
29
- 'transport.transport.fs ' => ' PHPCR\Shell\Transport\Transport\ JackalopeFs' ,
56
+ 'transport.transport.doctrinedbal ' => DoctrineDbal::class ,
57
+ 'transport.transport.jackrabbit ' => Jackrabbit::class ,
58
+ 'transport.transport.fs ' => JackalopeFs::class ,
30
59
];
31
60
32
61
public function __construct ($ mode = PhpcrShell::MODE_STANDALONE )
@@ -46,27 +75,27 @@ public function __construct($mode = PhpcrShell::MODE_STANDALONE)
46
75
47
76
public function registerHelpers ()
48
77
{
49
- $ this ->register ('helper.question ' , ' Symfony\Component\Console\Helper\ QuestionHelper' );
50
- $ this ->register ('helper.editor ' , ' PHPCR\Shell\Console\Helper\ EditorHelper' );
51
- $ this ->register ('helper.path ' , ' PHPCR\Shell\Console\Helper\ PathHelper' );
52
- $ this ->register ('helper.repository ' , ' PHPCR\Shell\Console\Helper\ RepositoryHelper' )
78
+ $ this ->register ('helper.question ' , QuestionHelper::class );
79
+ $ this ->register ('helper.editor ' , EditorHelper::class );
80
+ $ this ->register ('helper.path ' , PathHelper::class );
81
+ $ this ->register ('helper.repository ' , RepositoryHelper::class )
53
82
->addArgument (new Reference ('phpcr.session_manager ' ));
54
- $ this ->register ('helper.text ' , ' PHPCR\Shell\Console\Helper\ TextHelper' );
55
- $ this ->register ('helper.node ' , ' PHPCR\Shell\Console\Helper\ NodeHelper' );
56
- $ this ->register ('helper.result_formatter ' , ' PHPCR\Shell\Console\Helper\ ResultFormatterHelper' )
83
+ $ this ->register ('helper.text ' , TextHelper::class );
84
+ $ this ->register ('helper.node ' , NodeHelper::class );
85
+ $ this ->register ('helper.result_formatter ' , ResultFormatterHelper::class )
57
86
->addArgument (new Reference ('helper.text ' ))
58
87
->addArgument (new Reference ('config.config.phpcrsh ' ));
59
88
}
60
89
61
90
public function registerConfig ()
62
91
{
63
- $ this ->register ('config.manager ' , ' PHPCR\Shell\Config\ ConfigManager' )
92
+ $ this ->register ('config.manager ' , ConfigManager::class )
64
93
->addArgument (new Reference ('helper.question ' ));
65
94
66
- $ this ->register ('config.profile ' , ' PHPCR\Shell\Config\ Profile' );
67
- $ this ->register ('config.profile_loader ' , ' PHPCR\Shell\Config\ ProfileLoader' )
95
+ $ this ->register ('config.profile ' , Profile::class );
96
+ $ this ->register ('config.profile_loader ' , ProfileLoader::class )
68
97
->addArgument (new Reference ('config.manager ' ));
69
- $ this ->register ('config.config.phpcrsh ' , ' PHPCR\Shell\ Config\Config ' )
98
+ $ this ->register ('config.config.phpcrsh ' , Config::class )
70
99
->setFactory ([new Reference ('config.manager ' ), 'getPhpcrshConfig ' ]);
71
100
}
72
101
@@ -77,17 +106,17 @@ public function registerPhpcr()
77
106
$ this ->register ($ id , $ class )->addArgument (new Reference ('config.profile ' ));
78
107
}
79
108
80
- $ registry = $ this ->register ('phpcr.transport_registry ' , ' PHPCR\Shell\Transport\ TransportRegistry' );
109
+ $ registry = $ this ->register ('phpcr.transport_registry ' , TransportRegistry::class );
81
110
82
111
foreach (array_keys ($ this ->transports ) as $ transportId ) {
83
112
$ registry ->addMethodCall ('register ' , [new Reference ($ transportId )]);
84
113
}
85
114
86
- $ this ->register ('phpcr.session_manager.active ' , ' PHPCR\Shell\Phpcr\ SessionManager' )
115
+ $ this ->register ('phpcr.session_manager.active ' , SessionManager::class )
87
116
->addArgument (new Reference ('phpcr.transport_registry ' ))
88
117
->addArgument (new Reference ('config.profile ' ));
89
118
90
- $ this ->register ('phpcr.session_manager.passive ' , ' PHPCR\Shell\Phpcr\ SessionManager' )
119
+ $ this ->register ('phpcr.session_manager.passive ' , SessionManager::class )
91
120
->addArgument (new Reference ('phpcr.transport_registry ' ))
92
121
->addArgument (new Reference ('config.profile ' ));
93
122
@@ -99,54 +128,54 @@ public function registerPhpcr()
99
128
$ repositoryDefinition ->setFactory ([new Reference ('phpcr.session_manager ' ), 'getRepository ' ]);
100
129
$ sessionDefinition ->setFactory ([new Reference ('phpcr.session_manager ' ), 'getSession ' ]);
101
130
102
- $ this ->register ('dtl.glob.helper ' , ' DTL\Glob\ GlobHelper' );
131
+ $ this ->register ('dtl.glob.helper ' , GlobHelper::class );
103
132
}
104
133
105
134
public function registerEvent ()
106
135
{
107
136
if ($ this ->mode === PhpcrShell::MODE_STANDALONE ) {
108
137
$ this ->register (
109
138
'event.subscriber.profile_from_session_input ' ,
110
- ' PHPCR\Shell\Subscriber\ ProfileFromSessionInputSubscriber'
139
+ ProfileFromSessionInputSubscriber::class
111
140
)->addTag ('event.subscriber ' );
112
141
113
142
$ this ->register (
114
143
'event.subscriber.profile_loader ' ,
115
- ' PHPCR\Shell\Subscriber\ ProfileLoaderSubscriber'
144
+ ProfileLoaderSubscriber::class
116
145
)
117
146
->addArgument (new Reference ('config.profile_loader ' ))
118
147
->addArgument (new Reference ('helper.question ' ))
119
148
->addTag ('event.subscriber ' );
120
149
121
150
$ this ->register (
122
151
'event.subscriber.profile_writer ' ,
123
- ' PHPCR\Shell\Subscriber\ ProfileWriterSubscriber'
152
+ ProfileWriterSubscriber::class
124
153
)
125
154
->addArgument (new Reference ('config.profile_loader ' ))
126
155
->addArgument (new Reference ('helper.question ' ))
127
156
->addTag ('event.subscriber ' );
128
157
129
158
$ this ->register (
130
159
'event.subscriber.config_init ' ,
131
- ' PHPCR\Shell\Subscriber\ ConfigInitSubscriber'
160
+ ConfigInitSubscriber::class
132
161
)
133
162
->addArgument (new Reference ('config.manager ' ))
134
163
->addTag ('event.subscriber ' );
135
164
}
136
165
137
166
$ this ->register (
138
167
'event.subscriber.alias ' ,
139
- ' PHPCR\Shell\Subscriber\ AliasSubscriber'
168
+ AliasSubscriber::class
140
169
)
141
170
->addArgument (new Reference ('config.manager ' ))
142
171
->addTag ('event.subscriber ' );
143
172
144
173
$ this ->register (
145
174
'event.subscriber.exception ' ,
146
- ' PHPCR\Shell\Subscriber\ ExceptionSubscriber'
175
+ ExceptionSubscriber::class
147
176
)->addTag ('event.subscriber ' );
148
177
149
- $ dispatcher = $ this ->register ('event.dispatcher ' , ' Symfony\Component\ EventDispatcher\EventDispatcher ' );
178
+ $ dispatcher = $ this ->register ('event.dispatcher ' , EventDispatcher::class );
150
179
151
180
foreach (array_keys ($ this ->findTaggedServiceIds ('event.subscriber ' )) as $ id ) {
152
181
$ dispatcher ->addMethodCall ('addSubscriber ' , [new Reference ($ id )]);
@@ -156,22 +185,22 @@ public function registerEvent()
156
185
public function registerConsole ()
157
186
{
158
187
if ($ this ->mode === PhpcrShell::MODE_STANDALONE ) {
159
- $ this ->register ('application ' , ' PHPCR\Shell\Console\Application\ ShellApplication' )
188
+ $ this ->register ('application ' , ShellApplication::class )
160
189
->addArgument (new Reference ('container ' ));
161
190
} else {
162
- $ this ->register ('application ' , ' PHPCR\Shell\Console\Application\ EmbeddedApplication' )
191
+ $ this ->register ('application ' , EmbeddedApplication::class )
163
192
->addArgument (new Reference ('container ' ));
164
193
}
165
194
166
- $ this ->register ('console.input.autocomplete ' , ' PHPCR\Shell\Console\Input\ AutoComplete' )
195
+ $ this ->register ('console.input.autocomplete ' , AutoComplete::class )
167
196
->addArgument (new Reference ('application ' ))
168
197
->addArgument (new Reference ('phpcr.session ' ));
169
198
}
170
199
171
200
public function registerQuery ()
172
201
{
173
- $ this ->register ('query.update.expression_language ' , ' Symfony\Component\ ExpressionLanguage\ExpressionLanguage ' );
174
- $ this ->register ('query.update.processor ' , ' PHPCR\Shell\Query\ UpdateProcessor' )
202
+ $ this ->register ('query.update.expression_language ' , ExpressionLanguage::class );
203
+ $ this ->register ('query.update.processor ' , UpdateProcessor::class )
175
204
->addArgument (new Reference ('query.update.expression_language ' ));
176
205
}
177
206
0 commit comments