@@ -11,27 +11,26 @@ class ScheduleStatusFilter implements Filter
1111{
1212 /**
1313 * @param ScheduleBuilder $query
14- * @param $value
15- * @param string $property
1614 * @return void
1715 */
1816 public function __invoke (Builder $ query , $ value , string $ property )
1917 {
2018 if (is_array ($ value )) {
2119 $ this ->multiValueFilter ($ value , $ query );
22- return ;
20+
21+ return ;
2322 }
2423 $ enum = $ this ->toEnum ($ value );
2524 if (! $ enum instanceof ScheduleStatusEnum) {
26- return ;
25+ return ;
2726 }
2827 $ this ->toQuery ($ enum , $ query );
2928 }
3029
3130 public function multiValueFilter (array $ value , ScheduleBuilder $ query )
3231 {
3332 $ query ->where (function (ScheduleBuilder $ query ) use ($ value ) {
34- foreach ($ value as $ status ) {
33+ foreach ($ value as $ status ) {
3534 $ status = $ this ->toEnum ($ status );
3635 if (! $ status instanceof ScheduleStatusEnum) {
3736 continue ;
@@ -44,10 +43,9 @@ public function multiValueFilter(array $value, ScheduleBuilder $query)
4443 });
4544 }
4645
47-
4846 protected function toQuery (ScheduleStatusEnum $ value , ScheduleBuilder $ query )
4947 {
50- match ($ value ) {
48+ match ($ value ) {
5149 ScheduleStatusEnum::complete => $ query ->inThePast (),
5250 ScheduleStatusEnum::in_progress => $ query ->inProgress (),
5351 ScheduleStatusEnum::upcoming => $ query ->inTheFuture (),
@@ -56,10 +54,10 @@ protected function toQuery(ScheduleStatusEnum $value, ScheduleBuilder $query)
5654
5755 protected function toEnum ($ value )
5856 {
59- if ( ! $ value instanceof ScheduleStatusEnum && is_numeric ($ value )) {
57+ if ( ! $ value instanceof ScheduleStatusEnum && is_numeric ($ value )) {
6058 return ScheduleStatusEnum::tryFrom ($ value );
6159 }
60+
6261 return $ value ;
6362 }
64-
6563}
0 commit comments