@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Noitran\RQL\Services\RQLService; |
| 6 | 6 | |
| 7 | - if (! function_exists('rql')) { |
|
| 7 | + if (!function_exists('rql')) { |
|
| 8 | 8 | /** |
| 9 | 9 | * Get default RQL service |
| 10 | 10 | * |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function supports(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 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | public function supports(ProcessorInterface $processor, ExprInterface $exprClass): bool |
| 19 | 19 | { |
| 20 | 20 | /** @var EloquentProcessor $processor */ |
| 21 | - if (! in_array($exprClass->getExpression(), $processor::getComparisonMethods(), false)) { |
|
| 21 | + if (!in_array($exprClass->getExpression(), $processor::getComparisonMethods(), false)) { |
|
| 22 | 22 | return false; |
| 23 | 23 | } |
| 24 | 24 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | public function apply(ProcessorInterface $processor, ExprInterface $exprClass): Builder |
| 32 | 32 | { |
| 33 | 33 | /** @var EloquentProcessor $processor */ |
| 34 | - $method = $processor::getMethodMap()[$exprClass->getExpression()]; |
|
| 34 | + $method = $processor::getMethodMap()[ $exprClass->getExpression() ]; |
|
| 35 | 35 | |
| 36 | 36 | return $processor->getBuilder()->{$method}( |
| 37 | 37 | $exprClass->getColumn(), |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | */ |
| 18 | 18 | public function supports(ProcessorInterface $processor, ExprInterface $exprClass): bool |
| 19 | 19 | { |
| 20 | - if (! in_array($exprClass->getExpression(), ['$in', '$notIn', '$between'], true)) { |
|
| 20 | + if (!in_array($exprClass->getExpression(), [ '$in', '$notIn', '$between' ], true)) { |
|
| 21 | 21 | return false; |
| 22 | 22 | } |
| 23 | 23 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | public function apply(ProcessorInterface $processor, ExprInterface $exprClass): Builder |
| 31 | 31 | { |
| 32 | 32 | /** @var EloquentProcessor $processor */ |
| 33 | - $method = $processor::getMethodMap()[$exprClass->getExpression()]; |
|
| 33 | + $method = $processor::getMethodMap()[ $exprClass->getExpression() ]; |
|
| 34 | 34 | |
| 35 | 35 | return $processor->getBuilder()->{$method}( |
| 36 | 36 | $exprClass->getColumn(), |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public function supports(ProcessorInterface $processor, ExprInterface $exprClass): bool |
| 20 | 20 | { |
| 21 | - if (! $exprClass instanceof OrExpr) { |
|
| 21 | + if (!$exprClass instanceof OrExpr) { |
|
| 22 | 22 | return false; |
| 23 | 23 | } |
| 24 | 24 | |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | public function apply(ProcessorInterface $processor, ExprInterface $exprClass): Builder |
| 32 | 32 | { |
| 33 | 33 | /** @var EloquentProcessor $processor */ |
| 34 | - return $processor->getBuilder()->where(function (Builder $builder) use ($exprClass) { |
|
| 34 | + return $processor->getBuilder()->where(function(Builder $builder) use ($exprClass) { |
|
| 35 | 35 | $values = $exprClass->getValue(); |
| 36 | 36 | |
| 37 | 37 | foreach ($values as $value) { |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | /** |
| 14 | 14 | * @var ApplicableInterface[] |
| 15 | 15 | */ |
| 16 | - protected $applicableStrategies = []; |
|
| 16 | + protected $applicableStrategies = [ ]; |
|
| 17 | 17 | |
| 18 | 18 | /** |
| 19 | 19 | * @inheritdoc |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function register(string $filterStrategy): self |
| 34 | 34 | { |
| 35 | - $this->applicableStrategies[] = new $filterStrategy(); |
|
| 35 | + $this->applicableStrategies[ ] = new $filterStrategy(); |
|
| 36 | 36 | |
| 37 | 37 | return $this; |
| 38 | 38 | } |
@@ -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 createFilterStrategyResolver(array $config): ResolverInterface |
| 71 | 71 | { |
| 72 | 72 | return (new FilterStrategyResolver()) |
| 73 | - ->registerAll($config['filter_strategies']); |
|
| 73 | + ->registerAll($config[ 'filter_strategies' ]); |
|
| 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 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $publishPath = base_path('config/rql.php'); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | - $this->publishes([$configPath => $publishPath], 'config'); |
|
| 57 | + $this->publishes([ $configPath => $publishPath ], 'config'); |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | /** |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | */ |
| 74 | 74 | protected function registerFactory(): void |
| 75 | 75 | { |
| 76 | - $this->app->singleton(Factory::class, function (Application $app) { |
|
| 76 | + $this->app->singleton(Factory::class, function(Application $app) { |
|
| 77 | 77 | return new Factory($app); |
| 78 | 78 | }); |
| 79 | 79 | } |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | */ |
| 97 | 97 | protected function bindProcessor(): void |
| 98 | 98 | { |
| 99 | - $this->app->bind(ProcessorInterface::class, function () { |
|
| 99 | + $this->app->bind(ProcessorInterface::class, function() { |
|
| 100 | 100 | return rql()->getProcessor(); |
| 101 | 101 | }); |
| 102 | 102 | } |