Skip to content

Commit c91141e

Browse files
committed
Fix CS
1 parent 97afb4c commit c91141e

File tree

6 files changed

+87
-7
lines changed

6 files changed

+87
-7
lines changed

src/DependencyInjection/MakerExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class MakerExtension extends Extension
4141
'subscriber_namespace',
4242
'twig_namespace',
4343
'unit_test_namespace',
44-
'validator_namespace'
44+
'validator_namespace',
4545
];
4646

4747
/**
@@ -74,7 +74,7 @@ public function load(array $configs, ContainerBuilder $container): void
7474

7575
$namespacesHelperDefinition = $container->getDefinition('maker.namespaces_helper');
7676
foreach (static::$namespaces as $index => $namespace) {
77-
$namespacesHelperDefinition->replaceArgument($index, \trim($config[$namespace], '\\'));
77+
$namespacesHelperDefinition->replaceArgument($index, trim($config[$namespace], '\\'));
7878
}
7979

8080
$container->registerForAutoconfiguration(MakerInterface::class)

src/Doctrine/DoctrineHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private function isDoctrineInstalled(): bool
6363

6464
public function getEntityNamespace(): string
6565
{
66-
return \sprintf(
66+
return sprintf(
6767
'%s\\%s',
6868
$this->namespacesHelper->getRootNamespace(),
6969
$this->namespacesHelper->getEntityNamespace()

src/Maker/MakeSerializerNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
5151
{
5252
$normalizerClassNameDetails = $generator->createClassNameDetails(
5353
$input->getArgument('name'),
54-
\sprintf('%s\\Normalizer\\', $generator->getNamespacesHelper()->getSerializerNamespace()),
54+
sprintf('%s\\Normalizer\\', $generator->getNamespacesHelper()->getSerializerNamespace()),
5555
\Normalizer::class
5656
);
5757

src/Maker/MakeUser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
163163

164164
// C) Generate a custom user provider, if necessary
165165
if (!$userClassConfiguration->isEntity()) {
166-
$userProviderClass = \sprintf(
166+
$userProviderClass = sprintf(
167167
'%s\\%s\\UserProvider',
168168
$namespacesHelper->getRootNamespace(),
169169
$namespacesHelper->getSecurityNamespace()

src/Maker/MakeVoter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
4848
{
4949
$voterClassNameDetails = $generator->createClassNameDetails(
5050
$input->getArgument('name'),
51-
\sprintf('%s\\Voter\\', $generator->getNamespacesHelper()->getSecurityNamespace()),
51+
sprintf('%s\\Voter\\', $generator->getNamespacesHelper()->getSecurityNamespace()),
5252
'Voter'
5353
);
5454

src/Util/NamespacesHelper.php

Lines changed: 81 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
<?php
2+
23
declare(strict_types=1);
34

5+
/*
6+
* This file is part of the Symfony MakerBundle package.
7+
*
8+
* (c) Fabien Potencier <[email protected]>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
414
namespace Symfony\Bundle\MakerBundle\Util;
515

616
final class NamespacesHelper
@@ -79,71 +89,141 @@ public function __construct(
7989
$this->validator = $validator ?? 'Validator\\';
8090
}
8191

92+
/**
93+
* Get command namespace.
94+
*
95+
* @return string
96+
*/
8297
public function getCommandNamespace(): string
8398
{
8499
return $this->trim($this->command);
85100
}
86101

102+
/**
103+
* Get controller namespace.
104+
*
105+
* @return string
106+
*/
87107
public function getControllerNamespace(): string
88108
{
89109
return $this->trim($this->controller);
90110
}
91111

112+
/**
113+
* Get entity namespace.
114+
*
115+
* @return string
116+
*/
92117
public function getEntityNamespace(): string
93118
{
94119
return $this->trim($this->entity);
95120
}
96121

122+
/**
123+
* Get fixtures namespace.
124+
*
125+
* @return string
126+
*/
97127
public function getFixturesNamespace(): string
98128
{
99129
return $this->trim($this->fixtures);
100130
}
101131

132+
/**
133+
* Get form namespace.
134+
*
135+
* @return string
136+
*/
102137
public function getFormNamespace(): string
103138
{
104139
return $this->trim($this->form);
105140
}
106141

142+
/**
143+
* Get functional_test namespace.
144+
*
145+
* @return string
146+
*/
107147
public function getFunctionalTestNamespace(): string
108148
{
109149
return $this->trim($this->functionalTest);
110150
}
111151

152+
/**
153+
* Get repository namespace.
154+
*
155+
* @return string
156+
*/
112157
public function getRepositoryNamespace(): string
113158
{
114159
return $this->trim($this->repository);
115160
}
116161

162+
/**
163+
* Get root namespace.
164+
*
165+
* @return string
166+
*/
117167
public function getRootNamespace(): string
118168
{
119169
return $this->trim($this->root);
120170
}
121171

172+
/**
173+
* Get security namespace.
174+
*
175+
* @return string
176+
*/
122177
public function getSecurityNamespace(): string
123178
{
124179
return $this->trim($this->security);
125180
}
126181

182+
/**
183+
* Get serializer namespace.
184+
*
185+
* @return string
186+
*/
127187
public function getSerializerNamespace(): string
128188
{
129189
return $this->trim($this->serializer);
130190
}
131191

192+
/**
193+
* Get subscriber namespace.
194+
*
195+
* @return string
196+
*/
132197
public function getSubscriberNamespace(): string
133198
{
134199
return $this->trim($this->subscriber);
135200
}
136201

202+
/**
203+
* Get twig namespace.
204+
*
205+
* @return string
206+
*/
137207
public function getTwigNamespace(): string
138208
{
139209
return $this->trim($this->twig);
140210
}
141211

212+
/**
213+
* Get unit_test namespace.
214+
*
215+
* @return string
216+
*/
142217
public function getUnitTestNamespace(): string
143218
{
144219
return $this->trim($this->unitTest);
145220
}
146221

222+
/**
223+
* Get validator namespace.
224+
*
225+
* @return string
226+
*/
147227
public function getValidatorNamespace(): string
148228
{
149229
return $this->trim($this->validator);
@@ -158,6 +238,6 @@ public function getValidatorNamespace(): string
158238
*/
159239
private function trim(string $namespace): string
160240
{
161-
return \trim($namespace, '\\');
241+
return trim($namespace, '\\');
162242
}
163243
}

0 commit comments

Comments
 (0)