@@ -12,7 +12,7 @@ |
||
12 | 12 | /** |
13 | 13 | * @param Builder $src |
14 | 14 | * @param OperationInterface|SortOperation $operation |
15 | - * @return mixed |
|
15 | + * @return Builder |
|
16 | 16 | */ |
17 | 17 | public function process($src, OperationInterface $operation) |
18 | 18 | { |
@@ -14,7 +14,7 @@ |
||
14 | 14 | * @param Builder|EloquentBuilder $src |
15 | 15 | * @param OperationInterface[] $operations |
16 | 16 | */ |
17 | - public function __construct($src, array $operations = []) |
|
17 | + public function __construct($src, array $operations = [ ]) |
|
18 | 18 | { |
19 | 19 | $this->operations()->set($operations); |
20 | 20 | $this->processingService = new EloquentProcessingService( |
@@ -12,7 +12,7 @@ |
||
12 | 12 | /** |
13 | 13 | * @param Builder $src |
14 | 14 | * @param OperationInterface|SortOperation $operation |
15 | - * @return mixed |
|
15 | + * @return Builder |
|
16 | 16 | */ |
17 | 17 | public function process($src, OperationInterface $operation) |
18 | 18 | { |
@@ -19,15 +19,15 @@ |
||
19 | 19 | $value = $operation->getValue(); |
20 | 20 | $operator = $operation->getOperator(); |
21 | 21 | $field = $operation->getField(); |
22 | - if($operator == FilterOperation::STR_STARTS_WITH){ |
|
22 | + if ($operator == FilterOperation::STR_STARTS_WITH) { |
|
23 | 23 | $operator = FilterOperation::OPERATOR_LIKE; |
24 | - $value = $value."%"; |
|
25 | - }else if($operator == FilterOperation::STR_ENDS_WITH){ |
|
24 | + $value = $value . "%"; |
|
25 | + } else if ($operator == FilterOperation::STR_ENDS_WITH) { |
|
26 | 26 | $operator = FilterOperation::OPERATOR_LIKE; |
27 | - $value = "%".$value; |
|
28 | - }else if($operator == FilterOperation::STR_CONTAINS){ |
|
27 | + $value = "%" . $value; |
|
28 | + } else if ($operator == FilterOperation::STR_CONTAINS) { |
|
29 | 29 | $operator = FilterOperation::OPERATOR_LIKE; |
30 | - $value = "%".$value."%"; |
|
30 | + $value = "%" . $value . "%"; |
|
31 | 31 | } |
32 | 32 | $src->where($field, $operator, $value); |
33 | 33 | return $src; |
@@ -22,10 +22,10 @@ |
||
22 | 22 | if($operator == FilterOperation::STR_STARTS_WITH){ |
23 | 23 | $operator = FilterOperation::OPERATOR_LIKE; |
24 | 24 | $value = $value."%"; |
25 | - }else if($operator == FilterOperation::STR_ENDS_WITH){ |
|
25 | + } else if($operator == FilterOperation::STR_ENDS_WITH){ |
|
26 | 26 | $operator = FilterOperation::OPERATOR_LIKE; |
27 | 27 | $value = "%".$value; |
28 | - }else if($operator == FilterOperation::STR_CONTAINS){ |
|
28 | + } else if($operator == FilterOperation::STR_CONTAINS){ |
|
29 | 29 | $operator = FilterOperation::OPERATOR_LIKE; |
30 | 30 | $value = "%".$value."%"; |
31 | 31 | } |
@@ -12,7 +12,7 @@ |
||
12 | 12 | /** |
13 | 13 | * @param Builder $src |
14 | 14 | * @param OperationInterface|SortOperation $operation |
15 | - * @return mixed |
|
15 | + * @return Builder |
|
16 | 16 | */ |
17 | 17 | public function process($src, OperationInterface $operation) |
18 | 18 | { |