Skip to content

Drop legacy check for Symfony 4 and use constants in return #967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: 1.9
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions src/Command/Configuration/MigrateLegacyConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

use Pimcore\Console\AbstractCommand;
use Pimcore\Model\Tool\SettingsStore;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

Expand Down Expand Up @@ -63,17 +62,14 @@ private function migrateConfiguration(string $fileName, string $scope): void
}

/**
* @return int|null
* @return int
*
* @throws \Exception
*/
public function execute(InputInterface $input, OutputInterface $output)
{
$this->migrateConfiguration('datahub-configurations.php', 'pimcore_data_hub');
if (defined('Symfony\Component\Console\Command\Command::SUCCESS')) {
return Command::SUCCESS;
} else {
return 0;
}

return self::SUCCESS;
}
}
9 changes: 2 additions & 7 deletions src/Command/Configuration/RebuildWorkspacesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Pimcore\Bundle\DataHubBundle\Configuration;
use Pimcore\Bundle\DataHubBundle\WorkspaceHelper;
use Pimcore\Console\AbstractCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -41,7 +40,7 @@ protected function configure()
/**
*
*
* @return int|null
* @return int
*
* @throws \Exception
*/
Expand Down Expand Up @@ -76,10 +75,6 @@ public function execute(InputInterface $input, OutputInterface $output)
}
}

if (defined('Symfony\Component\Console\Command\Command::SUCCESS')) {
return Command::SUCCESS;
} else {
return 0;
}
return self::SUCCESS;
}
}
10 changes: 2 additions & 8 deletions src/Command/GraphQL/RebuildDefinitionsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

use Pimcore\Bundle\DataHubBundle\Configuration;
use Pimcore\Console\AbstractCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
Expand All @@ -44,7 +43,7 @@ protected function configure()
*
* @throws \Exception
*
*@deprecated Use Pimcore\Bundle\DataHubBundle\Command\Configuration\RebuildWorkspacesCommand instead.
* @deprecated Use Pimcore\Bundle\DataHubBundle\Command\Configuration\RebuildWorkspacesCommand instead.
*
*/
public function execute(InputInterface $input, OutputInterface $output)
Expand Down Expand Up @@ -76,11 +75,6 @@ public function execute(InputInterface $input, OutputInterface $output)

$this->output->writeln('done');

if (defined('Symfony\Component\Console\Command\Command::SUCCESS')) {
return Command::SUCCESS;
} else {
//TODO remove this as soon as support for Symfony 4 gets dropped
return 0;
}
return self::SUCCESS;
}
}