File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,11 @@ class TasksQuery
22
22
*/
23
23
private ?array $ canceledBy = null ;
24
24
25
+ /**
26
+ * @var bool|null
27
+ */
28
+ private ?bool $ reverse = null ;
29
+
25
30
/**
26
31
* @return $this
27
32
*/
@@ -54,6 +59,16 @@ public function setLimit(int $limit): self
54
59
return $ this ;
55
60
}
56
61
62
+ /**
63
+ * @return $this
64
+ */
65
+ public function setReverse (bool $ reverse ): self
66
+ {
67
+ $ this ->reverse = $ reverse ;
68
+
69
+ return $ this ;
70
+ }
71
+
57
72
public function toArray (): array
58
73
{
59
74
return array_filter (
@@ -63,6 +78,7 @@ public function toArray(): array
63
78
'from ' => $ this ->from ,
64
79
'limit ' => $ this ->limit ,
65
80
'canceledBy ' => $ this ->formatArray ($ this ->canceledBy ),
81
+ 'reverse ' => $ this ->reverse ,
66
82
]
67
83
), static function ($ item ) { return null !== $ item ; }
68
84
);
Original file line number Diff line number Diff line change @@ -109,4 +109,11 @@ public function testSetFrom(): void
109
109
110
110
self ::assertSame (['from ' => 1 ], $ data ->toArray ());
111
111
}
112
+
113
+ public function testSetReverse (): void
114
+ {
115
+ $ data = (new TasksQuery ())->setReverse (true );
116
+
117
+ self ::assertSame (['reverse ' => true ], $ data ->toArray ());
118
+ }
112
119
}
You can’t perform that action at this time.
0 commit comments