<NME> IntegrationDeleteCommand.php
<BEF> <?php
namespace Platformsh\Cli\Command\Integration;

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class IntegrationDeleteCommand extends IntegrationCommandBase
{
    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this
            ->setName('integration:delete')
            ->addArgument('id', InputArgument::OPTIONAL, 'The integration ID. Leave blank to choose from a list.')
            ->setDescription('Delete an integration from a project');
        $this->addProjectOption()->addWaitOptions();
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->validateInput($input);

        $integration = $this->selectIntegration($this->getSelectedProject(), $input->getArgument('id'), $input->isInteractive());
        if (!$integration) {
            return 1;
        }

        $confirmText = sprintf('Delete the integration <info>%s</info> (type: %s)?', $integration->id, $integration->type);
        /** @var \Platformsh\Cli\Service\QuestionHelper $questionHelper */
        $questionHelper = $this->getService('question_helper');
        if (!$questionHelper->confirm($confirmText)) {
            return 1;
        }

        $oldGitUrl = $project->getGitUrl();

        $result = $integration->delete();

        $this->stdErr->writeln(sprintf('Deleted integration <info>%s</info>', $integration->id));

        if ($this->shouldWait($input)) {
            /** @var \Platformsh\Cli\Service\ActivityMonitor $activityMonitor */
            $activityMonitor = $this->getService('activity_monitor');
            $activityMonitor->waitMultiple($result->getActivities(), $this->getSelectedProject());
        }

        $this->updateGitUrl($oldGitUrl);

        return 0;
    }
}

<MSG> Fix bug in integration:delete command: "Call to a member function getGitUrl() on null"

<DFF> @@ -22,8 +22,9 @@ class IntegrationDeleteCommand extends IntegrationCommandBase
     protected function execute(InputInterface $input, OutputInterface $output)
     {
         $this->validateInput($input);
+        $project = $this->getSelectedProject();
 
-        $integration = $this->selectIntegration($this->getSelectedProject(), $input->getArgument('id'), $input->isInteractive());
+        $integration = $this->selectIntegration($project, $input->getArgument('id'), $input->isInteractive());
         if (!$integration) {
             return 1;
         }

{'addition_count': 2, 'commit_subject': 'Fix bug in integration:delete command: "Call to a member function getGitUrl() on null"', 'deletion_count': 1, 'file_extension': '.php', 'lang': 'php', 'license': 'mit', 'repo_name': 'platformsh/platformsh-cli'}