| Conditions | 5 |
| Paths | 9 |
| Total Lines | 23 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5.0729 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | 1 | public function apply(Builder $query, $value, $property): Builder |
|
| 13 | { |
||
| 14 | 1 | $min = head($value); |
|
| 15 | 1 | $max = last($value); |
|
| 16 | 1 | if (is_string($min)) { |
|
| 17 | 1 | $startAt = Carbon::parse($min); |
|
| 18 | 1 | if ($startAt->toDateString() === $min) { |
|
| 19 | 1 | $startAt->startOfDay(); |
|
| 20 | } |
||
| 21 | } else { |
||
| 22 | $startAt = $min; |
||
| 23 | } |
||
| 24 | |||
| 25 | 1 | if (is_string($max)) { |
|
| 26 | 1 | $endAt = Carbon::parse($max); |
|
| 27 | 1 | if ($endAt->toDateString() === $max) { |
|
| 28 | 1 | $endAt->endOfDay(); |
|
| 29 | } |
||
| 30 | } else { |
||
| 31 | $endAt = $max; |
||
| 32 | } |
||
| 33 | |||
| 34 | 1 | return parent::apply($query, [$startAt, $endAt], $property); |
|
| 35 | } |
||
| 37 |
This check looks for function or method calls that always return null and whose return value is assigned to a variable.
The method
getObject()can return nothing but null, so it makes no sense to assign that value to a variable.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.