@@ -18,7 +18,7 @@ |
||
| 18 | 18 | public static function fromSnakeCasePropertyName(string $propertyName): self |
| 19 | 19 | { |
| 20 | 20 | return new self( |
| 21 | - 'set' . str_replace( |
|
| 21 | + 'set'.str_replace( |
|
| 22 | 22 | ' ', |
| 23 | 23 | '', |
| 24 | 24 | mb_convert_case( |
@@ -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 | } |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | /** @return array<int, string> */ |
| 10 | 10 | public static function generate(string $key, string $query, array $params = []): array |
| 11 | 11 | { |
| 12 | - $realCacheKey = $key . 'query=' . $query . '¶ms=' . hash('sha256', serialize($params)); |
|
| 12 | + $realCacheKey = $key.'query='.$query.'¶ms='.hash('sha256', serialize($params)); |
|
| 13 | 13 | |
| 14 | 14 | return [sha1($realCacheKey), $realCacheKey]; |
| 15 | 15 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | public function create(QueryBuilder $qb, string $tableAliasAndColumnName, string $expr): Condition |
| 20 | 20 | { |
| 21 | - [$cacheKey,] = CacheKeyGenerator::generate(self::CACHE_KEY, $tableAliasAndColumnName, ['expr' => $expr]); |
|
| 21 | + [$cacheKey, ] = CacheKeyGenerator::generate(self::CACHE_KEY, $tableAliasAndColumnName, ['expr' => $expr]); |
|
| 22 | 22 | /** @var Condition|null $condition */ |
| 23 | 23 | $condition = $this->cache?->get($cacheKey); |
| 24 | 24 | |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | foreach ($this->getTableAliases($qb) as $tableName => $alias) { |
| 30 | - if (0 === strncasecmp($tableAliasAndColumnName, $alias . '_', mb_strlen($alias . '_'))) { |
|
| 31 | - $columnName = mb_substr($tableAliasAndColumnName, mb_strlen($alias . '_')); |
|
| 30 | + if (0 === strncasecmp($tableAliasAndColumnName, $alias.'_', mb_strlen($alias.'_'))) { |
|
| 31 | + $columnName = mb_substr($tableAliasAndColumnName, mb_strlen($alias.'_')); |
|
| 32 | 32 | $columns = $this->getColumnsNamesByTable($qb, $tableName); |
| 33 | 33 | if (!\in_array($columnName, $columns, true)) { |
| 34 | 34 | throw new \InvalidArgumentException(sprintf('%s not exist in %s.', $columnName, $tableName)); |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - throw new \InvalidArgumentException($tableAliasAndColumnName . ' not allowed'); |
|
| 44 | + throw new \InvalidArgumentException($tableAliasAndColumnName.' not allowed'); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | /** |