Skip to content

Commit 3d8b581

Browse files
authored
Merge pull request #298 from ergebnis/feature/update
Enhancement: Simplify update of locker
2 parents a39a3e5 + 9170f87 commit 3d8b581

File tree

1 file changed

+4
-37
lines changed

1 file changed

+4
-37
lines changed

src/Command/NormalizeCommand.php

+4-37
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,10 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
231231

232232
$this->resetComposer();
233233

234-
$file = $input->getArgument('file');
235-
236-
if (\is_string($file)) {
237-
return $this->updateLockerInWorkingDirectory(
238-
$output,
239-
\dirname($file)
240-
);
241-
}
242-
243-
return $this->updateLocker($output);
234+
return $this->updateLockerInWorkingDirectory(
235+
$output,
236+
\dirname($composerFile)
237+
);
244238
}
245239

246240
/**
@@ -374,33 +368,6 @@ private function validateComposerFile(Console\Output\OutputInterface $output, st
374368
);
375369
}
376370

377-
/**
378-
* @see https://getcomposer.org/doc/03-cli.md#update
379-
*
380-
* @param Console\Output\OutputInterface $output
381-
*
382-
* @throws \Exception
383-
*
384-
* @return int
385-
*/
386-
private function updateLocker(Console\Output\OutputInterface $output): int
387-
{
388-
/** @var Console\Application $application */
389-
$application = $this->getApplication();
390-
391-
return $application->run(
392-
new Console\Input\ArrayInput([
393-
'command' => 'update',
394-
'--lock' => true,
395-
'--no-autoloader' => true,
396-
'--no-plugins' => true,
397-
'--no-scripts' => true,
398-
'--no-suggest' => true,
399-
]),
400-
$output
401-
);
402-
}
403-
404371
/**
405372
* @see https://getcomposer.org/doc/03-cli.md#update
406373
*

0 commit comments

Comments
 (0)