vaened /
laravel-searcher
| 1 | <?php |
||
| 2 | /** |
||
| 3 | * Created by enea dhack - 23/11/2019 17:47. |
||
| 4 | */ |
||
| 5 | |||
| 6 | namespace Vaened\Searcher; |
||
| 7 | |||
| 8 | use Illuminate\Contracts\Pagination\LengthAwarePaginator; |
||
| 9 | use Illuminate\Database\Eloquent\{Builder, Collection}; |
||
| 10 | use Vaened\Searcher\Constraints\{Between, Comparison, Has, In, IsNotNull, IsNull, Like, Limit, OrderBy}; |
||
| 11 | use Vaened\Searcher\Keywords\{Operator, OrderDirection, Wildcard}; |
||
|
0 ignored issues
–
show
The type
Vaened\Searcher\Keywords\Operator was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
The type
Vaened\Searcher\Keywords\Wildcard was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 12 | |||
| 13 | abstract class Searcheable extends Queryable |
||
| 14 | { |
||
| 15 | protected array $unload = []; |
||
| 16 | |||
| 17 | protected array $relationships = []; |
||
| 18 | |||
| 19 | public function paginate(int $perPage = 15): LengthAwarePaginator |
||
| 20 | { |
||
| 21 | return $this->statement()->paginate($perPage); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function get(): Collection |
||
| 25 | { |
||
| 26 | return $this->statement()->get(); |
||
| 27 | } |
||
| 28 | |||
| 29 | public function with(array $relations): self |
||
| 30 | { |
||
| 31 | $this->relationships = array_merge($this->relationships, $relations); |
||
| 32 | return $this; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function without(array $relations): self |
||
| 36 | { |
||
| 37 | $this->unload = array_merge($this->unload, $relations); |
||
| 38 | return $this; |
||
| 39 | } |
||
| 40 | |||
| 41 | public function limit(int $limit): self |
||
| 42 | { |
||
| 43 | $this->apply(new Limit($limit)); |
||
| 44 | return $this; |
||
| 45 | } |
||
| 46 | |||
| 47 | public function orderBy(string $column, OrderDirection $direction = null): self |
||
| 48 | { |
||
| 49 | $this->apply(new OrderBy($column, $direction)); |
||
| 50 | return $this; |
||
| 51 | } |
||
| 52 | |||
| 53 | protected function comparision($value, Operator $operator, string $column): void |
||
| 54 | { |
||
| 55 | $this->apply(new Comparison($value, $operator, $column)); |
||
| 56 | } |
||
| 57 | |||
| 58 | protected function in(array $values, string $column): void |
||
| 59 | { |
||
| 60 | $this->apply(new In($values, $column)); |
||
| 61 | } |
||
| 62 | |||
| 63 | protected function equals(string $value, string $column): void |
||
| 64 | { |
||
| 65 | $this->comparision($value, Operator::EQUAL(), $column); |
||
| 66 | } |
||
| 67 | |||
| 68 | protected function notEquals(string $value, string $column): void |
||
| 69 | { |
||
| 70 | $this->comparision($value, Operator::NOT_EQUAL(), $column); |
||
| 71 | } |
||
| 72 | |||
| 73 | protected function isNotNull(string $column): void |
||
| 74 | { |
||
| 75 | $this->apply(new IsNotNull($column)); |
||
| 76 | } |
||
| 77 | |||
| 78 | protected function isNull(string $column): void |
||
| 79 | { |
||
| 80 | $this->apply(new IsNull($column)); |
||
| 81 | } |
||
| 82 | |||
| 83 | protected function like(string $value, string $column, Wildcard $wildcard = null): void |
||
| 84 | { |
||
| 85 | $this->apply(new Like($value, $column, $wildcard)); |
||
| 86 | } |
||
| 87 | |||
| 88 | protected function between(Rangeable $range, string $column): void |
||
| 89 | { |
||
| 90 | $this->apply(new Between($range, $column)); |
||
| 91 | } |
||
| 92 | |||
| 93 | protected function has(string $relation, Constraint $constraint = null): void |
||
| 94 | { |
||
| 95 | $this->apply(new Has($relation, $constraint)); |
||
| 96 | } |
||
| 97 | |||
| 98 | protected function through(string $relation, Constraint $constraint): void |
||
| 99 | { |
||
| 100 | $this->has($relation, $constraint); |
||
| 101 | } |
||
| 102 | |||
| 103 | protected function statement(): Builder |
||
| 104 | { |
||
| 105 | return $this->getQuery()->create($this->relationships, $this->unload); |
||
| 106 | } |
||
| 107 | } |
||
| 108 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths