@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | |
19 | 19 | public function create(QueryBuilder $qb, string $tableAliasAndColumnName, string $expr): Condition |
20 | 20 | { |
21 | - [$cacheKey,] = Generator::generate(self::CACHE_KEY, $tableAliasAndColumnName, ['expr' => $expr]); |
|
21 | + [$cacheKey, ] = Generator::generate(self::CACHE_KEY, $tableAliasAndColumnName, ['expr' => $expr]); |
|
22 | 22 | $condition = $this->fromCache($cacheKey); |
23 | 23 | |
24 | 24 | if (null !== $condition) { |
@@ -26,8 +26,8 @@ discard block |
||
26 | 26 | } |
27 | 27 | |
28 | 28 | foreach ($this->getTableAliases($qb) as $tableName => $alias) { |
29 | - if (0 === strncasecmp($tableAliasAndColumnName, $alias . '_', mb_strlen($alias . '_'))) { |
|
30 | - $columnName = mb_substr($tableAliasAndColumnName, mb_strlen($alias . '_')); |
|
29 | + if (0 === strncasecmp($tableAliasAndColumnName, $alias.'_', mb_strlen($alias.'_'))) { |
|
30 | + $columnName = mb_substr($tableAliasAndColumnName, mb_strlen($alias.'_')); |
|
31 | 31 | $columns = $this->getColumnsNamesByTable($qb, $tableName); |
32 | 32 | if (!\in_array($columnName, $columns, true)) { |
33 | 33 | throw new \InvalidArgumentException(sprintf('%s not exist in %s.', $columnName, $tableName)); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | } |
41 | 41 | } |
42 | 42 | |
43 | - throw new \InvalidArgumentException($tableAliasAndColumnName . ' not allowed'); |
|
43 | + throw new \InvalidArgumentException($tableAliasAndColumnName.' not allowed'); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | private function fromCache(string $cacheKey): ?Condition |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | public static function normalize( |
10 | 10 | array $data, |
11 | - int $flags = \JSON_THROW_ON_ERROR | \JSON_NUMERIC_CHECK + \JSON_PRESERVE_ZERO_FRACTION |
|
11 | + int $flags = \JSON_THROW_ON_ERROR | \JSON_NUMERIC_CHECK +\JSON_PRESERVE_ZERO_FRACTION |
|
12 | 12 | ): array { |
13 | 13 | return (array) json_decode((string) json_encode($data, $flags), true, 512, \JSON_THROW_ON_ERROR); |
14 | 14 | } |