Skip to content

Commit 352f951

Browse files
committed
force trailing line comma in arguments for better diffs
1 parent 2efda01 commit 352f951

File tree

80 files changed

+492
-491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+492
-491
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
'trailing_comma_in_multiline' => [
3535
'elements' => [
3636
'arrays',
37+
'arguments',
3738
'parameters'
3839
],
3940
]

src/DependencyBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public function getMissingPackagesMessage(string $commandName, $message = null):
9696
$message = sprintf(
9797
"Missing package%s: %s, run:\n",
9898
$packagesCount > 1 ? 's' : '',
99-
$message ?: sprintf('to use the %s command', $commandName)
99+
$message ?: sprintf('to use the %s command', $commandName),
100100
);
101101

102102
if (!empty($packages)) {

src/DependencyInjection/CompilerPass/DoctrineAttributesCheckPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function process(ContainerBuilder $container): void
2020
{
2121
$container->setParameter(
2222
'maker.compatible_check.doctrine.supports_attributes',
23-
$container->hasParameter('doctrine.orm.metadata.attribute.class')
23+
$container->hasParameter('doctrine.orm.metadata.attribute.class'),
2424
);
2525
}
2626
}

src/Doctrine/EntityClassGenerator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function generateEntityClass(ClassNameDetails $entityClassDetails, bool $
4141
$repoClassDetails = $this->generator->createClassNameDetails(
4242
$entityClassDetails->getRelativeName(),
4343
'Repository\\',
44-
'Repository'
44+
'Repository',
4545
);
4646

4747
$tableName = $this->doctrineHelper->getPotentialTableName($entityClassDetails->getFullName());
@@ -71,15 +71,15 @@ public function generateEntityClass(ClassNameDetails $entityClassDetails, bool $
7171
'should_escape_table_name' => $this->doctrineHelper->isKeyword($tableName),
7272
'table_name' => $tableName,
7373
'doctrine_use_attributes' => $this->doctrineHelper->isDoctrineSupportingAttributes() && $this->doctrineHelper->doesClassUsesAttributes($entityClassDetails->getFullName()),
74-
]
74+
],
7575
);
7676

7777
if ($generateRepositoryClass) {
7878
$this->generateRepositoryClass(
7979
$repoClassDetails->getFullName(),
8080
$entityClassDetails->getFullName(),
8181
$withPasswordUpgrade,
82-
true
82+
true,
8383
);
8484
}
8585

@@ -123,7 +123,7 @@ public function generateRepositoryClass(string $repositoryClass, string $entityC
123123
'with_password_upgrade' => $withPasswordUpgrade,
124124
'password_upgrade_user_interface' => $interfaceClassNameDetails,
125125
'include_example_comments' => $includeExampleComments,
126-
]
126+
],
127127
);
128128
}
129129
}

src/Doctrine/EntityRegenerator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ public function regenerateEntities(string $classOrNamespace): void
178178
foreach ($operations as $filename => $manipulator) {
179179
$this->fileManager->dumpFile(
180180
$filename,
181-
$manipulator->getSourceCode()
181+
$manipulator->getSourceCode(),
182182
);
183183
}
184184
}
@@ -188,7 +188,7 @@ private function generateClass(ClassMetadata $metadata): string
188188
$path = $this->generator->generateClass(
189189
$metadata->name,
190190
'Class.tpl.php',
191-
[]
191+
[],
192192
);
193193
$this->generator->writeChanges();
194194

@@ -204,7 +204,7 @@ private function createClassManipulator(string $classPath): ClassSourceManipulat
204204
// if properties need to be generated then, by definition,
205205
// some non-annotation config is being used, and so, the
206206
// properties should not have annotations added to them
207-
false
207+
false,
208208
);
209209
}
210210

@@ -227,7 +227,7 @@ private function generateRepository(ClassMetadata $metadata): void
227227
$this->entityClassGenerator->generateRepositoryClass(
228228
$metadata->customRepositoryClassName,
229229
$metadata->name,
230-
false
230+
false,
231231
);
232232

233233
$this->generator->writeChanges();
@@ -241,7 +241,7 @@ private function getMappedFieldsInEntity(ClassMetadata $classMetadata): array
241241
$targetFields = array_merge(
242242
array_keys($classMetadata->fieldMappings),
243243
array_keys($classMetadata->associationMappings),
244-
array_keys($classMetadata->embeddedClasses)
244+
array_keys($classMetadata->embeddedClasses),
245245
);
246246

247247
if ($classReflection) {

src/Doctrine/EntityRelation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public function getOwningRelation(): RelationManyToMany|RelationOneToOne|Relatio
9393
->setTargetClassName($this->inverseClass)
9494
->setTargetPropertyName($this->inverseProperty)
9595
->setIsOwning(true)->setMapInverseRelation(
96-
$this->mapInverseRelation
96+
$this->mapInverseRelation,
9797
)
9898
->setIsSelfReferencing($this->isSelfReferencing),
9999
self::ONE_TO_ONE => (new RelationOneToOne())

src/Doctrine/ORMDependencyBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static function buildDependencies(DependencyBuilder $dependencies): void
3535
foreach ($classes as $class) {
3636
$dependencies->addClassDependency(
3737
$class,
38-
'orm'
38+
'orm',
3939
);
4040
}
4141
}

src/FileManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function dumpFile(string $filename, string $content): void
8181
$this->io->comment(sprintf(
8282
'%s: %s',
8383
$comment,
84-
$this->makerFileLinkFormatter->makeLinkedPath($absolutePath, $relativePath)
84+
$this->makerFileLinkFormatter->makeLinkedPath($absolutePath, $relativePath),
8585
));
8686
}
8787
}

src/Generator.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ public function writeChanges()
205205

206206
$this->fileManager->dumpFile(
207207
$targetPath,
208-
$this->getFileContentsForPendingOperation($targetPath, $templateData)
208+
$this->getFileContentsForPendingOperation($targetPath, $templateData),
209209
);
210210
}
211211

@@ -225,7 +225,7 @@ public function generateController(string $controllerClassName, string $controll
225225
$parameters +
226226
[
227227
'generator' => $this->templateComponentGenerator,
228-
]
228+
],
229229
);
230230
}
231231

@@ -237,7 +237,7 @@ public function generateTemplate(string $targetPath, string $templateName, array
237237
$this->generateFile(
238238
$this->fileManager->getPathForTemplate($targetPath),
239239
$templateName,
240-
$variables
240+
$variables,
241241
);
242242
}
243243

src/Maker/AbstractMaker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function addDependencies(array $dependencies, string $message = null):
4545

4646
return $dependencyBuilder->getMissingPackagesMessage(
4747
$this->getCommandName(),
48-
$message
48+
$message,
4949
);
5050
}
5151
}

src/Maker/MakeAuthenticator.php

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
112112
$authenticatorType = $io->choice(
113113
'What style of authentication do you want?',
114114
array_keys($authenticatorTypeValues),
115-
key($authenticatorTypeValues)
115+
key($authenticatorTypeValues),
116116
);
117117
$input->setArgument(
118118
'authenticator-type',
119-
$authenticatorTypeValues[$authenticatorType]
119+
$authenticatorTypeValues[$authenticatorType],
120120
);
121121

122122
if (self::AUTH_TYPE_FORM_LOGIN === $input->getArgument('authenticator-type')) {
@@ -140,9 +140,9 @@ function ($answer) {
140140
Validator::notBlank($answer);
141141

142142
return Validator::classDoesNotExist(
143-
$this->generator->createClassNameDetails($answer, 'Security\\', 'Authenticator')->getFullName()
143+
$this->generator->createClassNameDetails($answer, 'Security\\', 'Authenticator')->getFullName(),
144144
);
145-
}
145+
},
146146
);
147147
$input->setArgument('authenticator-class', $io->askQuestion($questionAuthenticatorClass));
148148

@@ -159,29 +159,29 @@ function ($answer) {
159159
$io->ask(
160160
'Choose a name for the controller class (e.g. <fg=yellow>SecurityController</>)',
161161
'SecurityController',
162-
[Validator::class, 'validateClassName']
163-
)
162+
[Validator::class, 'validateClassName'],
163+
),
164164
);
165165

166166
$command->addArgument('user-class', InputArgument::REQUIRED);
167167
$input->setArgument(
168168
'user-class',
169-
$userClass = $interactiveSecurityHelper->guessUserClass($io, $securityData['security']['providers'])
169+
$userClass = $interactiveSecurityHelper->guessUserClass($io, $securityData['security']['providers']),
170170
);
171171

172172
$command->addArgument('username-field', InputArgument::REQUIRED);
173173
$input->setArgument(
174174
'username-field',
175-
$interactiveSecurityHelper->guessUserNameField($io, $userClass, $securityData['security']['providers'])
175+
$interactiveSecurityHelper->guessUserNameField($io, $userClass, $securityData['security']['providers']),
176176
);
177177

178178
$command->addArgument('logout-setup', InputArgument::REQUIRED);
179179
$input->setArgument(
180180
'logout-setup',
181181
$io->confirm(
182182
'Do you want to generate a \'/logout\' URL?',
183-
true
184-
)
183+
true,
184+
),
185185
);
186186
}
187187
}
@@ -196,7 +196,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
196196
$input->getArgument('authenticator-type'),
197197
$input->getArgument('authenticator-class'),
198198
$input->hasArgument('user-class') ? $input->getArgument('user-class') : null,
199-
$input->hasArgument('username-field') ? $input->getArgument('username-field') : null
199+
$input->hasArgument('username-field') ? $input->getArgument('username-field') : null,
200200
);
201201

202202
// update security.yaml with guard config
@@ -214,7 +214,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
214214
$input->getOption('firewall-name'),
215215
$entryPoint,
216216
$input->getArgument('authenticator-class'),
217-
$input->hasArgument('logout-setup') ? $input->getArgument('logout-setup') : false
217+
$input->hasArgument('logout-setup') ? $input->getArgument('logout-setup') : false,
218218
);
219219
$generator->dumpFile($path, $newYaml);
220220
$securityYamlUpdated = true;
@@ -225,7 +225,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
225225
$this->generateFormLoginFiles(
226226
$input->getArgument('controller-class'),
227227
$input->getArgument('username-field'),
228-
$input->getArgument('logout-setup')
228+
$input->getArgument('logout-setup'),
229229
);
230230
}
231231

@@ -240,8 +240,8 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
240240
$input->getArgument('authenticator-class'),
241241
$securityData,
242242
$input->hasArgument('user-class') ? $input->getArgument('user-class') : null,
243-
$input->hasArgument('logout-setup') ? $input->getArgument('logout-setup') : false
244-
)
243+
$input->hasArgument('logout-setup') ? $input->getArgument('logout-setup') : false,
244+
),
245245
);
246246
}
247247

@@ -264,7 +264,7 @@ private function generateAuthenticatorClass(array $securityData, string $authent
264264
$this->generator->generateClass(
265265
$authenticatorClass,
266266
'authenticator/EmptyAuthenticator.tpl.php',
267-
['use_statements' => $useStatements]
267+
['use_statements' => $useStatements],
268268
);
269269

270270
return;
@@ -283,7 +283,7 @@ private function generateAuthenticatorClass(array $securityData, string $authent
283283

284284
$userClassNameDetails = $this->generator->createClassNameDetails(
285285
'\\'.$userClass,
286-
'Entity\\'
286+
'Entity\\',
287287
);
288288

289289
$this->generator->generateClass(
@@ -298,7 +298,7 @@ private function generateAuthenticatorClass(array $securityData, string $authent
298298
'username_field_var' => Str::asLowerCamelCase($userNameField),
299299
'user_needs_encoder' => $this->userClassHasEncoder($securityData, $userClass),
300300
'user_is_entity' => $this->doctrineHelper->isClassAMappedEntity($userClass),
301-
]
301+
],
302302
);
303303
}
304304

@@ -307,7 +307,7 @@ private function generateFormLoginFiles(string $controllerClass, string $userNam
307307
$controllerClassNameDetails = $this->generator->createClassNameDetails(
308308
$controllerClass,
309309
'Controller\\',
310-
'Controller'
310+
'Controller',
311311
);
312312

313313
if (!class_exists($controllerClassNameDetails->getFullName())) {
@@ -320,7 +320,7 @@ private function generateFormLoginFiles(string $controllerClass, string $userNam
320320
$controllerPath = $this->generator->generateController(
321321
$controllerClassNameDetails->getFullName(),
322322
'authenticator/EmptySecurityController.tpl.php',
323-
['use_statements' => $useStatements]
323+
['use_statements' => $useStatements],
324324
);
325325

326326
$controllerSourceCode = $this->generator->getFileContentsForPendingOperation($controllerPath);
@@ -352,7 +352,7 @@ private function generateFormLoginFiles(string $controllerClass, string $userNam
352352
'username_is_email' => false !== stripos($userNameField, 'email'),
353353
'username_label' => ucfirst(Str::asHumanWords($userNameField)),
354354
'logout_setup' => $logoutSetup,
355-
]
355+
],
356356
);
357357
}
358358

@@ -367,7 +367,7 @@ private function generateNextMessage(bool $securityYamlUpdated, string $authenti
367367
'main',
368368
null,
369369
$authenticatorClass,
370-
$logoutSetup
370+
$logoutSetup,
371371
);
372372
$nextTexts[] = "- Your <info>security.yaml</info> could not be updated automatically. You'll need to add the following config manually:\n\n".$yamlExample;
373373
}
@@ -403,13 +403,13 @@ public function configureDependencies(DependencyBuilder $dependencies, InputInte
403403
{
404404
$dependencies->addClassDependency(
405405
SecurityBundle::class,
406-
'security'
406+
'security',
407407
);
408408

409409
// needed to update the YAML files
410410
$dependencies->addClassDependency(
411411
Yaml::class,
412-
'yaml'
412+
'yaml',
413413
);
414414
}
415415
}

src/Maker/MakeCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
6464
$commandNameHasAppPrefix ? substr($commandName, 4) : $commandName,
6565
'Command\\',
6666
'Command',
67-
sprintf('The "%s" command name is not valid because it would be implemented by "%s" class, which is not valid as a PHP class name (it must start with a letter or underscore, followed by any number of letters, numbers, or underscores).', $commandName, Str::asClassName($commandName, 'Command'))
67+
sprintf('The "%s" command name is not valid because it would be implemented by "%s" class, which is not valid as a PHP class name (it must start with a letter or underscore, followed by any number of letters, numbers, or underscores).', $commandName, Str::asClassName($commandName, 'Command')),
6868
);
6969

7070
$useStatements = new UseStatementGenerator([
@@ -84,7 +84,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
8484
'use_statements' => $useStatements,
8585
'command_name' => $commandName,
8686
'set_description' => !class_exists(LazyCommand::class),
87-
]
87+
],
8888
);
8989

9090
$generator->writeChanges();
@@ -100,7 +100,7 @@ public function configureDependencies(DependencyBuilder $dependencies): void
100100
{
101101
$dependencies->addClassDependency(
102102
Command::class,
103-
'console'
103+
'console',
104104
);
105105
}
106106
}

0 commit comments

Comments
 (0)