Skip to content

Commit 967fb2d

Browse files
bug #631 Fix typos (nicolas-grekas)
This PR was merged into the 1.8-dev branch. Discussion ---------- Fix typos Commits ------- c01fbaf Fix typos
2 parents 0fc2cd9 + c01fbaf commit 967fb2d

File tree

7 files changed

+15
-8
lines changed

7 files changed

+15
-8
lines changed

src/Command/UnpackCommand.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Composer\Json\JsonFile;
1919
use Composer\Package\Locker;
2020
use Composer\Package\Version\VersionParser;
21+
use Composer\Plugin\PluginInterface;
2122
use Symfony\Component\Console\Input\InputArgument;
2223
use Symfony\Component\Console\Input\InputInterface;
2324
use Symfony\Component\Console\Input\InputOption;
@@ -28,6 +29,8 @@
2829

2930
class UnpackCommand extends BaseCommand
3031
{
32+
private $resolver;
33+
3134
public function __construct(PackageResolver $resolver)
3235
{
3336
$this->resolver = $resolver;

src/Configurator/ContainerConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private function addParameters(array $parameters)
4747
$lines = [];
4848
foreach (file($target) as $i => $line) {
4949
$lines[] = $line;
50-
if (!$isParameters && !preg_match('/^parameters\:/', $line)) {
50+
if (!$isParameters && !preg_match('/^parameters:/', $line)) {
5151
continue;
5252
}
5353
if (!$isParameters) {

src/Downloader.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public function getRecipes(array $operations): array
138138
if ($this->rfs instanceof HttpDownloader) {
139139
$jobs = [];
140140
foreach ($paths as $path) {
141-
$this->rfs->add($this->endpoint.$path[0]);
141+
$jobs[] = $this->rfs->add($this->endpoint.$path[0]);
142142
}
143143
$this->rfs->wait();
144144
$bodies = [];
@@ -150,6 +150,7 @@ public function getRecipes(array $operations): array
150150
$this->io->writeError('<warning>Failed to download recipes: '.$e->getMessage().'</>');
151151
});
152152
} else {
153+
$bodies = [];
153154
$this->rfs->download($paths, function ($path) use (&$bodies) {
154155
if ($body = $this->get($path, [], false)->getBody()) {
155156
$bodies[] = $body;

src/Flex.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class_exists(__NAMESPACE__.str_replace('/', '\\', substr($file, \strlen(__DIR__)
120120
$this->filter = new PackageFilter($io, $symfonyRequire, $this->downloader);
121121
}
122122

123-
$setRepositories = function () {};
123+
$setRepositories = null;
124124
} else {
125125
$rfs = Factory::createRemoteFilesystem($this->io, $this->config);
126126
$this->rfs = new ParallelDownloader($this->io, $this->config, $rfs->getOptions(), $rfs->isTlsDisabled());
@@ -222,7 +222,9 @@ class_exists(__NAMESPACE__.str_replace('/', '\\', substr($file, \strlen(__DIR__)
222222
$this->displayThanksReminder = 1;
223223
} elseif ('outdated' === $command) {
224224
$symfonyRequire = null;
225-
$setRepositories($manager);
225+
if ($setRepositories) {
226+
$setRepositories($manager);
227+
}
226228
}
227229

228230
if (isset(self::$aliasResolveCommands[$command])) {
@@ -845,7 +847,7 @@ private function getFlexId()
845847
private function formatOrigin(string $origin): string
846848
{
847849
// symfony/translation:[email protected]/symfony/recipes:master
848-
if (!preg_match('/^([^\:]+?)\:([^\@]+)@(.+)$/', $origin, $matches)) {
850+
if (!preg_match('/^([^:]++):([^@]++)@(.+)$/', $origin, $matches)) {
849851
return $origin;
850852
}
851853

src/Recipe.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function getURL(): string
7474
}
7575

7676
// symfony/translation:[email protected]/symfony/recipes:master
77-
if (!preg_match('/^([^\:]+?)\:([^\@]+)@([^\:]+)\:(.+)$/', $this->data['origin'], $matches)) {
77+
if (!preg_match('/^([^:]++):([^@]++)@([^:]++):(.+)$/', $this->data['origin'], $matches)) {
7878
// that excludes auto-generated recipes, which is what we want
7979
return '';
8080
}

src/Response.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private function parseHeaders(array $headers): array
7474
{
7575
$values = [];
7676
foreach (array_reverse($headers) as $header) {
77-
if (preg_match('{^([^\:]+):\s*(.+?)\s*$}i', $header, $match)) {
77+
if (preg_match('{^([^:]++):\s*(.+?)\s*$}i', $header, $match)) {
7878
$values[strtolower($match[1])][] = $match[2];
7979
} elseif (preg_match('{^HTTP/}i', $header)) {
8080
break;

src/ScriptExecutor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Composer\EventDispatcher\ScriptExecutionException;
1616
use Composer\IO\IOInterface;
1717
use Composer\Semver\Constraint\EmptyConstraint;
18+
use Composer\Semver\Constraint\MatchAllConstraint;
1819
use Composer\Util\ProcessExecutor;
1920
use Symfony\Component\Console\Output\OutputInterface;
2021
use Symfony\Component\Console\Output\StreamOutput;
@@ -93,7 +94,7 @@ private function expandCmd(string $type, string $cmd)
9394
private function expandSymfonyCmd(string $cmd)
9495
{
9596
$repo = $this->composer->getRepositoryManager()->getLocalRepository();
96-
if (!$repo->findPackage('symfony/console', new EmptyConstraint())) {
97+
if (!$repo->findPackage('symfony/console', class_exists(MatchAllConstraint::class) ? new MatchAllConstraint() : new EmptyConstraint())) {
9798
$this->io->writeError(sprintf('<warning>Skipping "%s" (needs symfony/console to run).</>', $cmd));
9899

99100
return null;

0 commit comments

Comments
 (0)