From ecb26c7b7521ec4f06b876c9c3ae3f2c8127f6b5 Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Thu, 30 Nov 2017 15:39:00 +0100 Subject: [PATCH] support COMPOSER env var in validate command (#6834) * support COMPOSER env var in validate command --- src/Composer/Command/ValidateCommand.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Command/ValidateCommand.php b/src/Composer/Command/ValidateCommand.php index c72fdf648..c4f78d2df 100644 --- a/src/Composer/Command/ValidateCommand.php +++ b/src/Composer/Command/ValidateCommand.php @@ -44,7 +44,7 @@ class ValidateCommand extends BaseCommand new InputOption('no-check-publish', null, InputOption::VALUE_NONE, 'Do not check for publish errors'), new InputOption('with-dependencies', 'A', InputOption::VALUE_NONE, 'Also validate the composer.json of all installed dependencies'), new InputOption('strict', null, InputOption::VALUE_NONE, 'Return a non-zero exit code for warnings as well as errors'), - new InputArgument('file', InputArgument::OPTIONAL, 'path to composer.json file', './composer.json'), + new InputArgument('file', InputArgument::OPTIONAL, 'path to composer.json file'), )) ->setHelp(<<getArgument('file'); + $file = $input->getArgument('file') ?: Factory::getComposerFile(); $io = $this->getIO(); if (!file_exists($file)) {