@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | return $entity; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - throw new EntityNotFoundException('Cannot resolve entity identifier "'.implode('", "', (array)$id).'"'); |
|
| 145 | + throw new EntityNotFoundException('Cannot resolve entity identifier "'.implode('", "', (array) $id).'"'); |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | /** |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | if (!$query instanceof Whereable) { |
| 190 | - throw new BadMethodCallException('The query must implement ' . Whereable::class . ' to use filter with a closure.'); |
|
| 190 | + throw new BadMethodCallException('The query must implement '.Whereable::class.' to use filter with a closure.'); |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | return $query->where($this->closureCompiler->compile($predicate)); |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | */ |
| 217 | 217 | public function with(ReadCommandInterface $query, $relations) |
| 218 | 218 | { |
| 219 | - $this->withRelations = Relation::sanitizeRelations((array)$relations); |
|
| 219 | + $this->withRelations = Relation::sanitizeRelations((array) $relations); |
|
| 220 | 220 | |
| 221 | 221 | return $query; |
| 222 | 222 | } |
@@ -231,7 +231,7 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public function without(ReadCommandInterface $query, $relations) |
| 233 | 233 | { |
| 234 | - $this->withoutRelations = Relation::sanitizeWithoutRelations((array)$relations); |
|
| 234 | + $this->withoutRelations = Relation::sanitizeWithoutRelations((array) $relations); |
|
| 235 | 235 | |
| 236 | 236 | return $query; |
| 237 | 237 | } |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | $scopes = $this->repository->scopes(); |
| 335 | 335 | |
| 336 | 336 | if (!isset($scopes[$name])) { |
| 337 | - throw new BadMethodCallException('Scope "' . get_class($this->mapper) . '::' . $name . '" not found'); |
|
| 337 | + throw new BadMethodCallException('Scope "'.get_class($this->mapper).'::'.$name.'" not found'); |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | return $scopes[$name](...$arguments); |
@@ -83,7 +83,7 @@ |
||
| 83 | 83 | private function load(ReflectionFunction $reflection): AndFilter |
| 84 | 84 | { |
| 85 | 85 | if ($this->cache) { |
| 86 | - $key = 'prime.closure.' . md5($reflection->getFileName() . $reflection->getStartLine()); |
|
| 86 | + $key = 'prime.closure.'.md5($reflection->getFileName().$reflection->getStartLine()); |
|
| 87 | 87 | |
| 88 | 88 | if ($filters = $this->cache->get($key)) { |
| 89 | 89 | return $filters; |
@@ -30,13 +30,13 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function get(ReflectionFunction $reflection) |
| 32 | 32 | { |
| 33 | - return $this->prefix . addcslashes($this->value->get($reflection), '%_') . $this->suffix; |
|
| 33 | + return $this->prefix.addcslashes($this->value->get($reflection), '%_').$this->suffix; |
|
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | public static function create(ComparisonValueInterface $value, string $prefix, string $suffix): ComparisonValueInterface |
| 37 | 37 | { |
| 38 | 38 | if ($value instanceof ConstantValue) { |
| 39 | - return new ConstantValue($prefix . addcslashes($value->value(), '%_') . $suffix); |
|
| 39 | + return new ConstantValue($prefix.addcslashes($value->value(), '%_').$suffix); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | return new self($value, $prefix, $suffix); |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | if ($this->namespace) { |
| 57 | - return $this->namespace . '\\' . $nameStr; |
|
| 57 | + return $this->namespace.'\\'.$nameStr; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | return $name; |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | try { |
| 72 | 72 | return new AndFilter($this->parseUnaryBooleanExpression($expr)); |
| 73 | 73 | } catch (Exception $e) { |
| 74 | - throw new RuntimeException('Unsupported expression ' . $expr->getType() . ' in filters. Supported expressions are: binary operations, function calls getter for a boolean, and not expression.'); |
|
| 74 | + throw new RuntimeException('Unsupported expression '.$expr->getType().' in filters. Supported expressions are: binary operations, function calls getter for a boolean, and not expression.'); |
|
| 75 | 75 | } |
| 76 | 76 | } |
| 77 | 77 | |
@@ -55,14 +55,14 @@ |
||
| 55 | 55 | $function = $expr->name->toString(); |
| 56 | 56 | |
| 57 | 57 | if (!isset($this->functions[$function])) { |
| 58 | - throw new RuntimeException('Unsupported function call ' . $function . ' in filters. Supported functions are: ' . implode(', ', array_keys($this->functions)) . '.'); |
|
| 58 | + throw new RuntimeException('Unsupported function call '.$function.' in filters. Supported functions are: '.implode(', ', array_keys($this->functions)).'.'); |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | $args = $expr->args; |
| 62 | 62 | |
| 63 | 63 | foreach ($args as $arg) { |
| 64 | 64 | if ($arg instanceof VariadicPlaceholder || $arg->unpack) { |
| 65 | - throw new RuntimeException('Unsupported unpacking in function call ' . $function . ' in filters.'); |
|
| 65 | + throw new RuntimeException('Unsupported unpacking in function call '.$function.' in filters.'); |
|
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | return $this->parseGetter($expr); |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - throw new RuntimeException('Invalid comparison value ' . $expr->getType() . '. Only scalar values, constants, and arrays can be used in filters.'); |
|
| 84 | + throw new RuntimeException('Invalid comparison value '.$expr->getType().'. Only scalar values, constants, and arrays can be used in filters.'); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | private function parseArray(Expr\Array_ $array): ArrayValue |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | $className = $this->resolver->resolve($expr->class); |
| 114 | - return new ConstantValue(constant($className . '::' . $expr->name->toString())); |
|
| 114 | + return new ConstantValue(constant($className.'::'.$expr->name->toString())); |
|
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | private function parsePropertyFetch(Expr\PropertyFetch $expr): PropertyValue |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | return $this->parseGetterCall($expr); |
| 46 | 46 | |
| 47 | 47 | default: |
| 48 | - throw new RuntimeException('Invalid entity accessor ' . $expr->getType() . '. Only properties and getters can be used in filters.'); |
|
| 48 | + throw new RuntimeException('Invalid entity accessor '.$expr->getType().'. Only properties and getters can be used in filters.'); |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | return $name; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - return $this->parse($propertyFetch->var) . '.' . $name; |
|
| 66 | + return $this->parse($propertyFetch->var).'.'.$name; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | private function parseGetterCall(Expr\MethodCall $expr): string |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | return $name; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | - return $this->parse($expr->var) . '.' . $name; |
|
| 91 | + return $this->parse($expr->var).'.'.$name; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | private function checkLeftOperandVariable(Expr\Variable $variable): void |