Skip to content

Commit e3fe298

Browse files
authored
Merge pull request #226 from phpcr/fix-phpdoc
fix phpdoc and some bugs
2 parents 206f8cd + f48b616 commit e3fe298

20 files changed

+143
-113
lines changed

Diff for: CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
1.6.1
5+
-----
6+
7+
- Fixed phpdoc comments
8+
- Fixed AutoSaveSubscriber to actually work
9+
410
1.6.0
511
-----
612

Diff for: src/PHPCR/Shell/Console/.gitignore

-1
This file was deleted.
-32 KB
Binary file not shown.

Diff for: src/PHPCR/Shell/Console/Command/BaseCommand.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function setContainer(ContainerInterface $container = null): void
2828
$this->container = $container;
2929
}
3030

31-
protected function get($serviceId)
31+
public function get($serviceId)
3232
{
3333
if (null === $this->container) {
3434
throw new \RuntimeException(

Diff for: src/PHPCR/Shell/DependencyInjection/Container.php

+59-30
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,38 @@
1212

1313
namespace PHPCR\Shell\DependencyInjection;
1414

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;
1530
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;
1643
use Symfony\Component\DependencyInjection\ContainerBuilder;
1744
use Symfony\Component\DependencyInjection\Reference;
45+
use Symfony\Component\EventDispatcher\EventDispatcher;
46+
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
1847

1948
class Container extends ContainerBuilder
2049
{
@@ -24,9 +53,9 @@ class Container extends ContainerBuilder
2453
* @var array Transports
2554
*/
2655
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,
3059
];
3160

3261
public function __construct($mode = PhpcrShell::MODE_STANDALONE)
@@ -46,27 +75,27 @@ public function __construct($mode = PhpcrShell::MODE_STANDALONE)
4675

4776
public function registerHelpers()
4877
{
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)
5382
->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)
5786
->addArgument(new Reference('helper.text'))
5887
->addArgument(new Reference('config.config.phpcrsh'));
5988
}
6089

6190
public function registerConfig()
6291
{
63-
$this->register('config.manager', 'PHPCR\Shell\Config\ConfigManager')
92+
$this->register('config.manager', ConfigManager::class)
6493
->addArgument(new Reference('helper.question'));
6594

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)
6897
->addArgument(new Reference('config.manager'));
69-
$this->register('config.config.phpcrsh', 'PHPCR\Shell\Config\Config')
98+
$this->register('config.config.phpcrsh', Config::class)
7099
->setFactory([new Reference('config.manager'), 'getPhpcrshConfig']);
71100
}
72101

@@ -77,17 +106,17 @@ public function registerPhpcr()
77106
$this->register($id, $class)->addArgument(new Reference('config.profile'));
78107
}
79108

80-
$registry = $this->register('phpcr.transport_registry', 'PHPCR\Shell\Transport\TransportRegistry');
109+
$registry = $this->register('phpcr.transport_registry', TransportRegistry::class);
81110

82111
foreach (array_keys($this->transports) as $transportId) {
83112
$registry->addMethodCall('register', [new Reference($transportId)]);
84113
}
85114

86-
$this->register('phpcr.session_manager.active', 'PHPCR\Shell\Phpcr\SessionManager')
115+
$this->register('phpcr.session_manager.active', SessionManager::class)
87116
->addArgument(new Reference('phpcr.transport_registry'))
88117
->addArgument(new Reference('config.profile'));
89118

90-
$this->register('phpcr.session_manager.passive', 'PHPCR\Shell\Phpcr\SessionManager')
119+
$this->register('phpcr.session_manager.passive', SessionManager::class)
91120
->addArgument(new Reference('phpcr.transport_registry'))
92121
->addArgument(new Reference('config.profile'));
93122

@@ -99,54 +128,54 @@ public function registerPhpcr()
99128
$repositoryDefinition->setFactory([new Reference('phpcr.session_manager'), 'getRepository']);
100129
$sessionDefinition->setFactory([new Reference('phpcr.session_manager'), 'getSession']);
101130

102-
$this->register('dtl.glob.helper', 'DTL\Glob\GlobHelper');
131+
$this->register('dtl.glob.helper', GlobHelper::class);
103132
}
104133

105134
public function registerEvent()
106135
{
107136
if ($this->mode === PhpcrShell::MODE_STANDALONE) {
108137
$this->register(
109138
'event.subscriber.profile_from_session_input',
110-
'PHPCR\Shell\Subscriber\ProfileFromSessionInputSubscriber'
139+
ProfileFromSessionInputSubscriber::class
111140
)->addTag('event.subscriber');
112141

113142
$this->register(
114143
'event.subscriber.profile_loader',
115-
'PHPCR\Shell\Subscriber\ProfileLoaderSubscriber'
144+
ProfileLoaderSubscriber::class
116145
)
117146
->addArgument(new Reference('config.profile_loader'))
118147
->addArgument(new Reference('helper.question'))
119148
->addTag('event.subscriber');
120149

121150
$this->register(
122151
'event.subscriber.profile_writer',
123-
'PHPCR\Shell\Subscriber\ProfileWriterSubscriber'
152+
ProfileWriterSubscriber::class
124153
)
125154
->addArgument(new Reference('config.profile_loader'))
126155
->addArgument(new Reference('helper.question'))
127156
->addTag('event.subscriber');
128157

129158
$this->register(
130159
'event.subscriber.config_init',
131-
'PHPCR\Shell\Subscriber\ConfigInitSubscriber'
160+
ConfigInitSubscriber::class
132161
)
133162
->addArgument(new Reference('config.manager'))
134163
->addTag('event.subscriber');
135164
}
136165

137166
$this->register(
138167
'event.subscriber.alias',
139-
'PHPCR\Shell\Subscriber\AliasSubscriber'
168+
AliasSubscriber::class
140169
)
141170
->addArgument(new Reference('config.manager'))
142171
->addTag('event.subscriber');
143172

144173
$this->register(
145174
'event.subscriber.exception',
146-
'PHPCR\Shell\Subscriber\ExceptionSubscriber'
175+
ExceptionSubscriber::class
147176
)->addTag('event.subscriber');
148177

149-
$dispatcher = $this->register('event.dispatcher', 'Symfony\Component\EventDispatcher\EventDispatcher');
178+
$dispatcher = $this->register('event.dispatcher', EventDispatcher::class);
150179

151180
foreach (array_keys($this->findTaggedServiceIds('event.subscriber')) as $id) {
152181
$dispatcher->addMethodCall('addSubscriber', [new Reference($id)]);
@@ -156,22 +185,22 @@ public function registerEvent()
156185
public function registerConsole()
157186
{
158187
if ($this->mode === PhpcrShell::MODE_STANDALONE) {
159-
$this->register('application', 'PHPCR\Shell\Console\Application\ShellApplication')
188+
$this->register('application', ShellApplication::class)
160189
->addArgument(new Reference('container'));
161190
} else {
162-
$this->register('application', 'PHPCR\Shell\Console\Application\EmbeddedApplication')
191+
$this->register('application', EmbeddedApplication::class)
163192
->addArgument(new Reference('container'));
164193
}
165194

166-
$this->register('console.input.autocomplete', 'PHPCR\Shell\Console\Input\AutoComplete')
195+
$this->register('console.input.autocomplete', AutoComplete::class)
167196
->addArgument(new Reference('application'))
168197
->addArgument(new Reference('phpcr.session'));
169198
}
170199

171200
public function registerQuery()
172201
{
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)
175204
->addArgument(new Reference('query.update.expression_language'));
176205
}
177206

Diff for: src/PHPCR/Shell/Event/Event.php

+2-9
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,8 @@
22

33
namespace PHPCR\Shell\Event;
44

5-
use Symfony\Component\EventDispatcher\Event as OldEvent;
65
use Symfony\Contracts\EventDispatcher\Event as ContractEvent;
76

8-
if (class_exists(ContractEvent::class)) {
9-
class Event extends ContractEvent
10-
{
11-
}
12-
} else {
13-
class Event extends OldEvent
14-
{
15-
}
7+
class Event extends ContractEvent
8+
{
169
}

0 commit comments

Comments
 (0)