@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function getProcessor(): ProcessorInterface |
40 | 40 | { |
41 | - if (! $this->processor) { |
|
41 | + if (!$this->processor) { |
|
42 | 42 | $this->processor = $this->createProcessor(); |
43 | 43 | } |
44 | 44 | |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $name = $this->config->get('rql.default_processor', 'eloquent'); |
54 | 54 | $class = config("rql.processors.{$name}.class"); |
55 | 55 | |
56 | - if (! class_exists($class)) { |
|
56 | + if (!class_exists($class)) { |
|
57 | 57 | throw new RuntimeException('Processor class "' . $class . '" does not exist!'); |
58 | 58 | } |
59 | 59 | |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | protected function createFilterSpecResolver(array $config): ResolverInterface |
71 | 71 | { |
72 | 72 | return (new FilterSpecResolver()) |
73 | - ->registerAll($config['filter_specs']); |
|
73 | + ->registerAll($config[ 'filter_specs' ]); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -86,6 +86,6 @@ discard block |
||
86 | 86 | throw new RuntimeException('RQL config does not exist.'); |
87 | 87 | } |
88 | 88 | |
89 | - return $config['processors'][$processorName]; |
|
89 | + return $config[ 'processors' ][ $processorName ]; |
|
90 | 90 | } |
91 | 91 | } |
@@ -18,7 +18,7 @@ |
||
18 | 18 | */ |
19 | 19 | public function isSatisfiedBy(ProcessorInterface $processor, ExprInterface $exprClass): bool |
20 | 20 | { |
21 | - if (! $exprClass instanceof BetweenExpr) { |
|
21 | + if (!$exprClass instanceof BetweenExpr) { |
|
22 | 22 | return false; |
23 | 23 | } |
24 | 24 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | */ |
22 | 22 | public function enqueue($exprClass): self |
23 | 23 | { |
24 | - if (! $exprClass instanceof ExprInterface) { |
|
24 | + if (!$exprClass instanceof ExprInterface) { |
|
25 | 25 | throw new ExpressionException(sprintf( |
26 | 26 | 'The $exprClass variable is not an instance of %s.', |
27 | 27 | ExprInterface::class |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * @var SpecInterface[] |
17 | 17 | */ |
18 | - protected $applicableSpecs = []; |
|
18 | + protected $applicableSpecs = [ ]; |
|
19 | 19 | |
20 | 20 | /** |
21 | 21 | * {@inheritdoc} |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function register(string $filterStrategy): self |
36 | 36 | { |
37 | - $this->applicableSpecs[] = new $filterStrategy(); |
|
37 | + $this->applicableSpecs[ ] = new $filterStrategy(); |
|
38 | 38 | |
39 | 39 | return $this; |
40 | 40 | } |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function isSatisfiedBy(ProcessorInterface $processor, ExprInterface $exprClass): bool |
21 | 21 | { |
22 | - if (! \in_array($exprClass->getExpression(), ['$in', '$notIn', '$between'], true)) { |
|
22 | + if (!\in_array($exprClass->getExpression(), [ '$in', '$notIn', '$between' ], true)) { |
|
23 | 23 | return false; |
24 | 24 | } |
25 | 25 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | public function apply(ProcessorInterface $processor, ExprInterface $exprClass): Builder |
33 | 33 | { |
34 | 34 | /** @var EloquentProcessor $processor */ |
35 | - $method = $processor::getMethodMap()[$exprClass->getExpression()]; |
|
35 | + $method = $processor::getMethodMap()[ $exprClass->getExpression() ]; |
|
36 | 36 | |
37 | 37 | return $processor->getBuilder()->{$method}( |
38 | 38 | $exprClass->getColumn(), |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function isSatisfiedBy(ProcessorInterface $processor, ExprInterface $exprClass): bool |
22 | 22 | { |
23 | - if (! $exprClass instanceof OrExpr) { |
|
23 | + if (!$exprClass instanceof OrExpr) { |
|
24 | 24 | return false; |
25 | 25 | } |
26 | 26 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | public function apply(ProcessorInterface $processor, ExprInterface $exprClass): Builder |
34 | 34 | { |
35 | 35 | /* @var EloquentProcessor $processor */ |
36 | - return $processor->getBuilder()->where(function (Builder $builder) use ($exprClass) { |
|
36 | + return $processor->getBuilder()->where(function(Builder $builder) use ($exprClass) { |
|
37 | 37 | $values = $exprClass->getValue(); |
38 | 38 | |
39 | 39 | foreach ($values as $value) { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | public function isSatisfiedBy(ProcessorInterface $processor, ExprInterface $exprClass): bool |
21 | 21 | { |
22 | 22 | /** @var EloquentProcessor $processor */ |
23 | - if (! \in_array($exprClass->getExpression(), $processor::getComparisonMethods(), false)) { |
|
23 | + if (!\in_array($exprClass->getExpression(), $processor::getComparisonMethods(), false)) { |
|
24 | 24 | return false; |
25 | 25 | } |
26 | 26 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | public function apply(ProcessorInterface $processor, ExprInterface $exprClass): Builder |
34 | 34 | { |
35 | 35 | /** @var EloquentProcessor $processor */ |
36 | - $method = $processor::getMethodMap()[$exprClass->getExpression()]; |
|
36 | + $method = $processor::getMethodMap()[ $exprClass->getExpression() ]; |
|
37 | 37 | |
38 | 38 | return $processor->getBuilder()->{$method}( |
39 | 39 | $exprClass->getColumn(), |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | $publishPath = base_path('config/rql.php'); |
46 | 46 | } |
47 | 47 | |
48 | - $this->publishes([$configPath => $publishPath], 'config'); |
|
48 | + $this->publishes([ $configPath => $publishPath ], 'config'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | protected function registerConfig(): void |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | protected function bindProcessor(): void |
70 | 70 | { |
71 | - $this->app->bind(ProcessorInterface::class, function () { |
|
71 | + $this->app->bind(ProcessorInterface::class, function() { |
|
72 | 72 | return rql()->getProcessor(); |
73 | 73 | }); |
74 | 74 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | use Noitran\RQL\Exceptions\RuntimeException; |
7 | 7 | use Noitran\RQL\Services\RQLService; |
8 | 8 | |
9 | - if (! \function_exists('rql')) { |
|
9 | + if (!\function_exists('rql')) { |
|
10 | 10 | /** |
11 | 11 | * Get default RQL service. |
12 | 12 | * |