Skip to content

Reenable flex when it is found in require-dev #415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Downloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ public function __construct(Composer $composer, IoInterface $io, ParallelDownloa
$this->caFile = getenv('SYMFONY_CAFILE');
}

foreach ($composer->getPackage()->getRequires() as $link) {
// recipes apply only when symfony/flex is found in "require" in the root package
foreach (array_merge($composer->getPackage()->getRequires() ?? [], $composer->getPackage()->getDevRequires() ?? []) as $link) {
// recipes apply only when symfony/flex is found in "require" or "require-dev" in the root package
if ('symfony/flex' !== $link->getTarget()) {
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Flex.php
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ public function generateFlexId()
}

if (null === $this->downloader->getEndpoint()) {
throw new \LogicException('Cannot generate project id when "symfony/flex" is not in the "require" section of the root composer.json.');
throw new \LogicException('Cannot generate project id when "symfony/flex" is not found in the root composer.json.');
}

$json = new JsonFile(Factory::getComposerFile());
Expand All @@ -560,7 +560,7 @@ public function generateFlexId()
private function fetchRecipes(): array
{
if (null === $this->downloader->getEndpoint()) {
$this->io->writeError('<warning>Symfony recipes are disabled: "symfony/flex" is not in the "require" section of the root composer.json</warning>');
$this->io->writeError('<warning>Symfony recipes are disabled: "symfony/flex" not found in the root composer.json</warning>');

return [[], []];
}
Expand Down