for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PHPSemVerChecker\Console;
use PHPSemVerChecker\Configuration\Configuration;
use Symfony\Component\Console\Input\InputInterface;
/**
* Merges CLI input with existing configuration values.
*
* This is to ensure that CLI input has priority and is prepared for validation
* by symfony/console commands.
*/
class InputMerger
{
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \PHPSemVerChecker\Configuration\Configuration $config
public function merge(InputInterface $input, Configuration $config)
foreach ($input->getArguments() as $argument => $value) {
if ($input->hasArgumentSet($argument)) {
hasArgumentSet()
Symfony\Component\Console\Input\InputInterface
hasArgument()
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.
$config->set($argument, $value);
} else {
$input->setArgument($argument, $config->get($argument));
}
foreach ($input->getOptions() as $option => $value) {
if ($input->hasOptionSet($option)) {
hasOptionSet()
hasOption()
$config->set($option, $value);
$input->setOption($option, $config->get($option));
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.