Skip to content

Commit 8b4fb88

Browse files
committed
php-cs
1 parent c3e4ac7 commit 8b4fb88

20 files changed

+98
-105
lines changed

src/Command/InstallRecipesCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Composer\Command\BaseCommand;
1515
use Composer\DependencyResolver\Operation\InstallOperation;
16-
use Composer\Factory;
1716
use Symfony\Component\Console\Exception\RuntimeException;
1817
use Symfony\Component\Console\Input\InputArgument;
1918
use Symfony\Component\Console\Input\InputInterface;

src/Command/UpdateRecipesCommand.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7070
if (!$symfonyLock->has($packageName)) {
7171
$io->writeError([
7272
'Package not found inside symfony.lock. It looks like it\'s not installed?',
73-
sprintf('Try running <info>composer recipes:install %s --force -v</info> to re-install the recipe.', $packageName)
73+
sprintf('Try running <info>composer recipes:install %s --force -v</info> to re-install the recipe.', $packageName),
7474
]);
7575

7676
return 1;
@@ -81,7 +81,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8181
$io->writeError([
8282
'It doesn\'t look like this package had a recipe when it was originally installed.',
8383
'To install the latest version of the recipe, if there is one, run:',
84-
sprintf(' <info>composer recipes:install %s --force -v</info>', $packageName)
84+
sprintf(' <info>composer recipes:install %s --force -v</info>', $packageName),
8585
]);
8686

8787
return 1;
@@ -94,7 +94,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9494
'The version of the installed recipe was not saved into symfony.lock.',
9595
'This is possible if it was installed by an old version of Symfony Flex.',
9696
'Update the recipe by re-installing the latest version with:',
97-
sprintf(' <info>composer recipes:install %s --force -v</info>', $packageName)
97+
sprintf(' <info>composer recipes:install %s --force -v</info>', $packageName),
9898
]);
9999

100100
return 1;
@@ -106,7 +106,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
106106
$io->writeError([
107107
'The original recipe version you have installed could not be found, it may be too old.',
108108
'Update the recipe by re-installing the latest version with:',
109-
sprintf(' <info>composer recipes:install %s --force -v</info>', $packageName)
109+
sprintf(' <info>composer recipes:install %s --force -v</info>', $packageName),
110110
]);
111111

112112
return 1;
@@ -134,7 +134,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
134134
$throwable->getMessage(),
135135
'',
136136
'Update the recipe by re-installing the latest version with:',
137-
sprintf(' <info>composer recipes:install %s --force -v</info>', $packageName)
137+
sprintf(' <info>composer recipes:install %s --force -v</info>', $packageName),
138138
]);
139139

140140
return 1;
@@ -154,7 +154,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
154154
$io->write([
155155
' The recipe was updated but with <bg=red;fg=white>one or more conflicts</>.',
156156
' Run <comment>git status</comment> to see them.',
157-
' After resolving, commit your changes like normal.'
157+
' After resolving, commit your changes like normal.',
158158
]);
159159
} else {
160160
if (!$patch->getPatch()) {
@@ -169,7 +169,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
169169
}
170170
}
171171

172-
if (0 !== count($recipeUpdate->getCopyFromPackagePaths())) {
172+
if (0 !== \count($recipeUpdate->getCopyFromPackagePaths())) {
173173
$io->write([
174174
'',
175175
' <bg=red;fg=white>NOTE:</>',
@@ -181,7 +181,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
181181
$io->write([
182182
'',
183183
' The recipe updater has no way of knowing if these files have changed since you originally installed the recipe.',
184-
' And so, no updates were made to these paths.'
184+
' And so, no updates were made to these paths.',
185185
]);
186186
}
187187

@@ -213,7 +213,7 @@ private function getRecipe(string $packageName, string $recipeRef = null, string
213213
}
214214
$recipes = $this->downloader->getRecipes([$operation]);
215215

216-
if (0 === count($recipes['manifests'] ?? [])) {
216+
if (0 === \count($recipes['manifests'] ?? [])) {
217217
return null;
218218
}
219219

src/Configurator/AbstractConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ protected function updateData(string $file, string $data): bool
9696
}
9797

9898
/**
99-
* @return string|null Returns the updated content if the section was found, null if not found.
99+
* @return string|null returns the updated content if the section was found, null if not found
100100
*/
101101
protected function updateDataString(string $contents, string $data): ?string
102102
{

src/Configurator/ContainerConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private function configureParameters(array $parameters, bool $update = false): s
8585
$matches = [];
8686
if (preg_match(sprintf('/^\s+%s\:/', preg_quote($key, '/')), $line, $matches)) {
8787
if ($update) {
88-
$lines[$i] = substr($line, 0, strlen($matches[0])).' '.str_replace("'", "''", $value)."\n";
88+
$lines[$i] = substr($line, 0, \strlen($matches[0])).' '.str_replace("'", "''", $value)."\n";
8989
}
9090

9191
unset($parameters[$key]);

src/Configurator/DockerComposeConfigurator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function unconfigure(Recipe $recipe, $config, Lock $lock)
8181

8282
public function update(RecipeUpdate $recipeUpdate, array $originalConfig, array $newConfig): void
8383
{
84-
if (!DockerComposeConfigurator::shouldConfigureDockerRecipe($this->composer, $this->io, $recipeUpdate->getNewRecipe())) {
84+
if (!self::shouldConfigureDockerRecipe($this->composer, $this->io, $recipeUpdate->getNewRecipe())) {
8585
return;
8686
}
8787

@@ -331,7 +331,7 @@ private function configureDockerCompose(Recipe $recipe, array $config, bool $upd
331331

332332
private function getContentsAfterApplyingRecipe(string $rootDir, Recipe $recipe, array $config): array
333333
{
334-
if (0 === count($config)) {
334+
if (0 === \count($config)) {
335335
return [];
336336
}
337337

src/Configurator/DockerfileConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ private function configureDockerfile(Recipe $recipe, array $config, bool $update
9696

9797
private function getContentsAfterApplyingRecipe(Recipe $recipe, array $config): ?string
9898
{
99-
if (0 === count($config)) {
99+
if (0 === \count($config)) {
100100
return null;
101101
}
102102

src/Configurator/EnvConfigurator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ private function getContentsAfterApplyingRecipe(string $rootDir, Recipe $recipe,
202202
{
203203
$files = ['.env', '.env.dist', 'phpunit.xml.dist', 'phpunit.xml'];
204204

205-
if (0 === count($vars)) {
205+
if (0 === \count($vars)) {
206206
return array_fill_keys($files, null);
207207
}
208208

@@ -264,7 +264,7 @@ private function findExistingValue(string $var, string $filename, Recipe $recipe
264264
continue;
265265
}
266266

267-
return trim(substr($line, strlen($var) + 1));
267+
return trim(substr($line, \strlen($var) + 1));
268268
}
269269

270270
return null;

src/Configurator/GitignoreConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private function configureGitignore(Recipe $recipe, array $vars, bool $update)
7777

7878
private function getContentsAfterApplyingRecipe(string $rootDir, Recipe $recipe, $vars): ?string
7979
{
80-
if (0 === count($vars)) {
80+
if (0 === \count($vars)) {
8181
return null;
8282
}
8383

src/Configurator/MakefileConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ private function configureMakefile(Recipe $recipe, array $definitions, bool $upd
9494

9595
private function getContentsAfterApplyingRecipe(string $rootDir, Recipe $recipe, array $definitions): ?string
9696
{
97-
if (0 === count($definitions)) {
97+
if (0 === \count($definitions)) {
9898
return null;
9999
}
100100

src/GithubApi.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function findRecipeCommitDataFromTreeRef(string $package, string $repo, s
6262
if ($treeItem['sha'] === $lockRef) {
6363
// remove *this* commit from the new commits list
6464
array_pop($commitShas);
65+
6566
return [
6667
// shorten for brevity
6768
'commit' => substr($commitData['sha'], 0, 7),
@@ -127,7 +128,7 @@ public function getPullRequestForCommit(string $commit, string $repo): ?array
127128
{
128129
$data = $this->requestGitHubApi('https://api.github.com/search/issues?q='.$commit);
129130

130-
if (0 === count($data['items'])) {
131+
if (0 === \count($data['items'])) {
131132
return null;
132133
}
133134

0 commit comments

Comments
 (0)