Skip to content

Commit a16ca9f

Browse files
committed
Clean up some unused code
1 parent 73d40f6 commit a16ca9f

15 files changed

+15
-27
lines changed

src/Command/App/AppListCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
namespace Platformsh\Cli\Command\App;
33

44
use Platformsh\Cli\Command\CommandBase;
5-
use Platformsh\Cli\Local\ApplicationFinder;
6-
use Platformsh\Cli\Local\LocalApplication;
75
use Platformsh\Cli\Service\Table;
86
use Platformsh\Client\Model\Deployment\EnvironmentDeployment;
97
use Symfony\Component\Console\Input\InputInterface;

src/Command/Auth/ApiTokenLoginCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use CommerceGuys\Guzzle\Oauth2\AccessToken;
55
use GuzzleHttp\Client;
66
use GuzzleHttp\Exception\BadResponseException;
7-
use GuzzleHttp\Url;
87
use Platformsh\Cli\Command\CommandBase;
98
use Platformsh\Client\OAuth2\ApiToken;
109
use Symfony\Component\Console\Input\InputInterface;

src/Command/CompletionCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Platformsh\Cli\Local\ApplicationFinder;
66
use Platformsh\Cli\Service\Api;
7-
use Platformsh\Cli\Local\LocalApplication;
87
use Stecman\Component\Symfony\Console\BashCompletion\Completion;
98
use Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand as ParentCompletionCommand;
109

src/Command/Environment/EnvironmentXdebugCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
namespace Platformsh\Cli\Command\Environment;
33

44
use Platformsh\Cli\Command\CommandBase;
5-
use Platformsh\Cli\Local\LocalApplication;
65
use Platformsh\Cli\Service\Ssh;
76
use Symfony\Component\Console\Input\InputArgument;
87
use Symfony\Component\Console\Input\InputInterface;

src/Command/Local/LocalDrushAliasesCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7676

7777
$aliases = $drush->getAliases($current_group);
7878
$new_group = ltrim($input->getOption('group'), '@');
79-
if (empty($aliases) && !$new_group && $project && $current_group === $project->id) {
79+
if (empty($aliases) && !$new_group && $current_group === $project->id) {
8080
$new_group = (new Slugify())->slugify($project->title);
8181
}
8282

src/Command/Mount/MountUploadCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace Platformsh\Cli\Command\Mount;
44

55
use Platformsh\Cli\Command\CommandBase;
6-
use Platformsh\Cli\Local\LocalApplication;
76
use Platformsh\Cli\Service\Ssh;
87
use Platformsh\Cli\Util\OsUtil;
98
use Symfony\Component\Console\Input\InputInterface;

src/Command/MultiCommand.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7575
try {
7676
$application->setCurrentCommand($command);
7777
$commandInput = new StringInput($commandLine . ' --project ' . escapeshellarg($project->id));
78-
if ($command instanceof MultiAwareInterface) {
79-
$command->setRunningViaMulti(true);
80-
}
78+
$command->setRunningViaMulti(true);
8179
$returnCode = $command->run($commandInput, $output);
8280
$application->setCurrentCommand($this);
8381
if ($returnCode !== 0) {

src/Command/Project/Variable/ProjectVariableSetCommand.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
7979
*/
8080
protected function validateJson($string)
8181
{
82-
$null = json_decode($string) === null;
83-
84-
return !$null || ($null && $string === 'null');
82+
if ($string === 'null') {
83+
return true;
84+
}
85+
return \json_decode($string) !== null;
8586
}
8687
}

src/Command/Route/RouteListCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ protected function configure()
2323
->setAliases(['routes'])
2424
->setDescription('List all routes for an environment')
2525
->addArgument('environment', InputArgument::OPTIONAL, 'The environment ID')
26-
->addOption('refresh', null, InputOption::VALUE_NONE, 'Bypass the cache of routes');;
26+
->addOption('refresh', null, InputOption::VALUE_NONE, 'Bypass the cache of routes');
2727
$this->setHiddenAliases(['environment:routes']);
2828
Table::configureInput($this->getDefinition());
2929
$this->addProjectOption()

src/Command/Server/ServerRunCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
namespace Platformsh\Cli\Command\Server;
33

44
use Platformsh\Cli\Exception\RootNotFoundException;
5-
use Platformsh\Cli\Local\LocalApplication;
65
use Platformsh\Cli\Local\BuildFlavor\Drupal;
76
use Platformsh\Cli\Service\Url;
87
use Platformsh\Cli\Util\PortUtil;

0 commit comments

Comments
 (0)