File tree Expand file tree Collapse file tree 5 files changed +42
-19
lines changed Expand file tree Collapse file tree 5 files changed +42
-19
lines changed Original file line number Diff line number Diff line change 18
18
"symfony/config" : " ^5.4 || ^6.0 || ^7.0" ,
19
19
"symfony/console" : " ^5.4 || ^6.0 || ^7.0" ,
20
20
"symfony/process" : " ^5.4 || ^6.0 || ^7.0" ,
21
- "doctrine/orm" : " ^2.5.3"
21
+ "doctrine/orm" : " ^2.5.3 || ^3.0 "
22
22
},
23
23
"require-dev" : {
24
24
"symfony/framework-bundle" : " ^5.4 || ^6.0 || ^7.0" ,
Original file line number Diff line number Diff line change 9
9
use Task \Scheduler \TaskSchedulerInterface ;
10
10
use Task \Storage \TaskExecutionRepositoryInterface ;
11
11
use Task \TaskBundle \Builder \TaskBuilder ;
12
+ use Task \TaskBundle \Entity \SystemTaskRepositoryInterface ;
12
13
use Task \TaskBundle \Entity \TaskRepository ;
13
14
use Task \TaskInterface ;
14
15
use Task \TaskStatus ;
@@ -29,7 +30,7 @@ class ScheduleSystemTasksCommand extends Command
29
30
private $ scheduler ;
30
31
31
32
/**
32
- * @var TaskRepository
33
+ * @var SystemTaskRepositoryInterface
33
34
*/
34
35
private $ taskRepository ;
35
36
@@ -42,14 +43,14 @@ class ScheduleSystemTasksCommand extends Command
42
43
* @param string $name
43
44
* @param array $systemTasks
44
45
* @param TaskSchedulerInterface $scheduler
45
- * @param TaskRepository $taskRepository
46
+ * @param SystemTaskRepositoryInterface $taskRepository
46
47
* @param TaskExecutionRepositoryInterface $taskExecutionRepository
47
48
*/
48
49
public function __construct (
49
50
$ name ,
50
51
array $ systemTasks ,
51
52
TaskSchedulerInterface $ scheduler ,
52
- TaskRepository $ taskRepository ,
53
+ SystemTaskRepositoryInterface $ taskRepository ,
53
54
TaskExecutionRepositoryInterface $ taskExecutionRepository
54
55
) {
55
56
parent ::__construct ($ name );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ declare (strict_types=1 );
4
+
5
+ namespace Task \TaskBundle \Entity ;
6
+
7
+ use Task \Storage \TaskRepositoryInterface ;
8
+
9
+ interface SystemTaskRepositoryInterface extends TaskRepositoryInterface
10
+ {
11
+ /**
12
+ * Returns all system-task.
13
+ *
14
+ * @return TaskInterface[]
15
+ */
16
+ public function findSystemTasks ();
17
+
18
+ /**
19
+ * Returns task identified by system-key.
20
+ *
21
+ * @param string $systemKey
22
+ *
23
+ * @return TaskInterface
24
+ */
25
+ public function findBySystemKey ($ systemKey );
26
+ }
Original file line number Diff line number Diff line change 11
11
12
12
namespace Task \TaskBundle \Entity ;
13
13
14
+ use DateTime ;
14
15
use Doctrine \ORM \EntityRepository ;
15
16
use Doctrine \ORM \NoResultException ;
16
- use Task \Storage \TaskRepositoryInterface ;
17
17
use Task \TaskInterface ;
18
18
19
19
/**
20
- * Repository for task.
20
+ * Repository for tasks
21
+ *
22
+ * @extends EntityRepository<TaskInterface>
21
23
*/
22
- class TaskRepository extends EntityRepository implements TaskRepositoryInterface
24
+ class TaskRepository extends EntityRepository implements SystemTaskRepositoryInterface
23
25
{
24
26
/**
25
27
* {@inheritdoc}
@@ -62,7 +64,7 @@ public function remove(TaskInterface $task)
62
64
/**
63
65
* {@inheritdoc}
64
66
*/
65
- public function findAll ($ page = 1 , $ pageSize = null )
67
+ public function findAll ($ page = 1 , $ pageSize = null ): array
66
68
{
67
69
$ query = $ this ->createQueryBuilder ('t ' )
68
70
->getQuery ();
@@ -100,11 +102,7 @@ public function findEndBefore(\DateTime $dateTime)
100
102
}
101
103
102
104
/**
103
- * Returns task identified by system-key.
104
- *
105
- * @param string $systemKey
106
- *
107
- * @return TaskInterface
105
+ * {@inheritdoc}
108
106
*/
109
107
public function findBySystemKey ($ systemKey )
110
108
{
@@ -120,9 +118,7 @@ public function findBySystemKey($systemKey)
120
118
}
121
119
122
120
/**
123
- * Returns all system-task.
124
- *
125
- * @return TaskInterface[]
121
+ * {@inheritdoc}
126
122
*/
127
123
public function findSystemTasks ()
128
124
{
Original file line number Diff line number Diff line change 13
13
use Task \Storage \TaskExecutionRepositoryInterface ;
14
14
use Task \TaskBundle \Builder \TaskBuilder ;
15
15
use Task \TaskBundle \Command \ScheduleSystemTasksCommand ;
16
+ use Task \TaskBundle \Entity \SystemTaskRepositoryInterface ;
16
17
use Task \TaskBundle \Entity \Task ;
17
- use Task \TaskBundle \Entity \TaskRepository ;
18
18
use Task \TaskBundle \Tests \Functional \TestHandler ;
19
19
use Task \TaskStatus ;
20
20
@@ -28,7 +28,7 @@ class ScheduleSystemTasksCommandTest extends TestCase
28
28
private $ scheduler ;
29
29
30
30
/**
31
- * @var TaskRepository
31
+ * @var SystemTaskRepositoryInterface
32
32
*/
33
33
private $ taskRepository ;
34
34
@@ -40,7 +40,7 @@ class ScheduleSystemTasksCommandTest extends TestCase
40
40
protected function setUp (): void
41
41
{
42
42
$ this ->scheduler = $ this ->prophesize (TaskSchedulerInterface::class);
43
- $ this ->taskRepository = $ this ->prophesize (TaskRepository ::class);
43
+ $ this ->taskRepository = $ this ->prophesize (SystemTaskRepositoryInterface ::class);
44
44
$ this ->taskExecutionRepository = $ this ->prophesize (TaskExecutionRepositoryInterface::class);
45
45
}
46
46
You can’t perform that action at this time.
0 commit comments