Skip to content

Commit 54afc7e

Browse files
fixed #17 desc of tasks in debug command
1 parent e228e05 commit 54afc7e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Command/DebugTasksCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
4747
$limit = $input->getOption('limit');
4848

4949
if (null !== $key) {
50-
$tasks = $this->storage->findByKey($key, $limit);
50+
$tasks = $this->storage->findByKey($key, $limit, 'DESC');
5151
} else {
52-
$tasks = $this->storage->findAll($limit);
52+
$tasks = $this->storage->findAll($limit, 'DESC');
5353
}
5454

5555
$table = new Table($output);

src/Storage/DoctrineStorage.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,26 +70,26 @@ function (TaskEntity $entity) {
7070
/**
7171
* {@inheritdoc}
7272
*/
73-
public function findAll($limit = null)
73+
public function findAll($limit = null, $sortOrder= 'ASC')
7474
{
7575
return array_map(
7676
function (TaskEntity $entity) {
7777
return $entity->getTask();
7878
},
79-
$this->taskRepository->findBy([], null, $limit)
79+
$this->taskRepository->findBy([], ['executionDate' => $sortOrder], $limit)
8080
);
8181
}
8282

8383
/**
8484
* {@inheritdoc}
8585
*/
86-
public function findByKey($key, $limit = null)
86+
public function findByKey($key, $limit = null, $sortOrder= 'ASC')
8787
{
8888
return array_map(
8989
function (TaskEntity $entity) {
9090
return $entity->getTask();
9191
},
92-
$this->taskRepository->findBy(['key' => $key], null, $limit)
92+
$this->taskRepository->findBy(['key' => $key], ['executionDate' => $sortOrder], $limit)
9393
);
9494
}
9595

0 commit comments

Comments
 (0)