diff --git a/.travis.yml b/.travis.yml index 7bc1d50..02d6c81 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,6 +57,12 @@ matrix: - php: 7.3 env: - STORAGE=doctrine + - php: 7.4 + env: + - STORAGE=array + - php: 7.4 + env: + - STORAGE=doctrine before_install: - if [[ -z $CODE_COVERAGE ]]; then phpenv config-rm xdebug.ini ; fi diff --git a/composer.json b/composer.json index 0dc1ef1..b02cd2e 100644 --- a/composer.json +++ b/composer.json @@ -11,22 +11,22 @@ ], "require": { "php": "^5.6 || ^7.0", - "php-task/php-task": "^1.3", - "symfony/http-kernel": "^2.8 || ^3.4 || ^4.0", - "symfony/dependency-injection": "^2.8 || ^3.4 || ^4.0", - "symfony/expression-language": "^2.8 || ^3.4 || ^4.0", - "symfony/config": "^2.8 || ^3.4 || ^4.0", - "symfony/console": "^2.8 || ^3.4 || ^4.0", - "symfony/process": "^2.8 || ^3.4 || ^4.0", + "php-task/php-task": "^1.4", + "symfony/http-kernel": "^2.8 || ^3.4 || ^4.0 || ^5.0", + "symfony/dependency-injection": "^2.8 || ^3.4 || ^4.0 || ^5.0", + "symfony/expression-language": "^2.8 || ^3.4 || ^4.0 || ^5.0", + "symfony/config": "^2.8 || ^3.4 || ^4.0 || ^5.0", + "symfony/console": "^2.8 || ^3.4 || ^4.0 || ^5.0", + "symfony/process": "^2.8 || ^3.4 || ^4.0 || ^5.0", "doctrine/orm": "^2.5" }, "require-dev": { "phpunit/phpunit": "^4.8 || ^5.0", "sebastian/comparator": "^1.2.3", - "symfony/debug": "^2.8 || ^3.4 || ^4.0", - "symfony/framework-bundle": "^2.8 || ^3.4 || ^4.0", - "symfony/finder": "^2.8 || ^3.4 || ^4.0", - "symfony/yaml": "^2.8 || ^3.4 || ^4.0", + "symfony/debug": "^2.8 || ^3.4 || ^4.0 || ^5.0", + "symfony/framework-bundle": "^2.8 || ^3.4 || ^4.0 || ^5.0", + "symfony/finder": "^2.8 || ^3.4 || ^4.0 || ^5.0", + "symfony/yaml": "^2.8 || ^3.4 || ^4.0 || ^5.0", "doctrine/doctrine-bundle": "^1.5", "doctrine/data-fixtures": "^1.1" }, diff --git a/src/Command/DebugTasksCommand.php b/src/Command/DebugTasksCommand.php index 9cafb91..93f8910 100644 --- a/src/Command/DebugTasksCommand.php +++ b/src/Command/DebugTasksCommand.php @@ -84,5 +84,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $table->render(); + + return 0; } } diff --git a/src/Command/RunCommand.php b/src/Command/RunCommand.php index 6535b35..0edc7a1 100644 --- a/src/Command/RunCommand.php +++ b/src/Command/RunCommand.php @@ -67,5 +67,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { $this->runner->runTasks(); $this->scheduler->scheduleTasks(); + + return 0; } } diff --git a/src/Command/ScheduleSystemTasksCommand.php b/src/Command/ScheduleSystemTasksCommand.php index 2aae4ed..fda9c80 100644 --- a/src/Command/ScheduleSystemTasksCommand.php +++ b/src/Command/ScheduleSystemTasksCommand.php @@ -108,6 +108,8 @@ protected function execute(InputInterface $input, OutputInterface $output) $output->writeln(''); $output->writeln('System-tasks successfully scheduled'); + + return 0; } /** diff --git a/src/Command/ScheduleTaskCommand.php b/src/Command/ScheduleTaskCommand.php index 522dbc2..f6931c5 100644 --- a/src/Command/ScheduleTaskCommand.php +++ b/src/Command/ScheduleTaskCommand.php @@ -94,5 +94,7 @@ protected function execute(InputInterface $input, OutputInterface $output) } $taskBuilder->schedule(); + + return 0; } } diff --git a/src/DependencyInjection/Configuration.php b/src/DependencyInjection/Configuration.php index cd584ef..5d521c4 100644 --- a/src/DependencyInjection/Configuration.php +++ b/src/DependencyInjection/Configuration.php @@ -11,6 +11,7 @@ namespace Task\TaskBundle\DependencyInjection; +use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; use Symfony\Component\Config\Definition\Builder\TreeBuilder; use Symfony\Component\Config\Definition\ConfigurationInterface; @@ -37,9 +38,16 @@ public function __construct(array $lockingStorageAliases) */ public function getConfigTreeBuilder() { - $treeBuilder = new TreeBuilder(); + $treeBuilder = new TreeBuilder('task'); - $treeBuilder->root('task') + if (method_exists($treeBuilder, 'getRootNode')) { + $rootNode = $treeBuilder->getRootNode(); + } else { + // BC layer for symfony/config 4.1 and older + $rootNode = $treeBuilder->root('task'); + } + + $rootNode ->children() ->enumNode('storage')->values(['array', 'doctrine'])->defaultValue('doctrine')->end() ->arrayNode('adapters') diff --git a/src/Executor/ExecutionProcessFactory.php b/src/Executor/ExecutionProcessFactory.php index e49fb7b..b463837 100644 --- a/src/Executor/ExecutionProcessFactory.php +++ b/src/Executor/ExecutionProcessFactory.php @@ -45,8 +45,14 @@ public function __construct($consolePath, $processTimeout, $environment) */ public function create($uuid) { - return $process = (new Process( - implode(' ', [$this->consolePath, 'task:execute', $uuid, '--env=' . $this->environment]) - ))->setTimeout($this->processTimeout); + $command = implode(' ', [$this->consolePath, 'task:execute', $uuid, '--env=' . $this->environment]); + + if (method_exists(Process::class, 'fromShellCommandline')) { + $process = Process::fromShellCommandline($command); + } else { + $process = new Process($command); + } + + return $process->setTimeout($this->processTimeout); } }