Skip to content

Commit

Permalink
feat: add support for doctrine/orm 3 (#109)
Browse files Browse the repository at this point in the history
Co-authored-by: Christopher Georg <christopher.georg@sr-travel.de>
  • Loading branch information
Chris53897 and Chris8934 authored Feb 4, 2024
1 parent 8ed2034 commit f3fc901
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions Command/RemoveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
['name' => $commandName]
);

if(!$command)
{throw new \InvalidArgumentException('Command with that name not found');}

$this->em->remove($command);
$this->em->flush();

Expand Down
3 changes: 1 addition & 2 deletions Repository/ScheduledCommandRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ public function findEnabledCommand(): ?array
* findAll override to implement the default orderBy clause.
* @inheritdoc
*/
public function findAll(): ?array
public function findAll(): array
{
return $this->findBy([], ['disabled' => 'ASC', 'priority' => 'DESC']);
}


/**
* Find all commands ordered by next run time
*
Expand Down
1 change: 1 addition & 0 deletions Tests/App/config/config_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ doctrine:
charset: UTF8
path: "%database_path%"
url: null
use_savepoints: true
orm:
auto_generate_proxy_classes: true
auto_mapping: false
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
],
"require": {
"php": ">=8.2",
"doctrine/orm": "^2.17.2",
"doctrine/orm": "^2.17.5 || ^3.0.0",
"doctrine/doctrine-bundle": "^2.11",
"doctrine/collections": "^2.1",
"doctrine/dbal": "^3.7",
"doctrine/dbal": "^3.8.1",
"doctrine/persistence": "^3.2",
"dragonmantank/cron-expression": "^3.3",
"knplabs/knp-time-bundle": "^2.2",
"lorisleiva/cron-translator": "^0.4.4",
"lorisleiva/cron-translator": "^0.4.5",
"symfony/asset": "^7.0",
"symfony/config": "^7.0",
"symfony/console": "^7.0",
Expand Down

0 comments on commit f3fc901

Please # to comment.