@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Artprima\QueryFilterBundle\Request; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Artprima\QueryFilterBundle\QueryFilter; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Artprima\QueryFilterBundle\QueryFilter\Config; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Artprima\QueryFilterBundle\QueryFilter\Config; |
| 6 | 6 | |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | * |
| 113 | 113 | * @return callable |
| 114 | 114 | */ |
| 115 | - public function getRepositoryCallback(): callable ; |
|
| 115 | + public function getRepositoryCallback(): callable; |
|
| 116 | 116 | |
| 117 | 117 | /** |
| 118 | 118 | * @param array $allowedLimits allowed pagination limits (eg. [5, 10, 25, 50, 100]) |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Artprima\QueryFilterBundle\Response; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Artprima\QueryFilterBundle\Query\Mysql; |
| 6 | 6 | |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Artprima\QueryFilterBundle\Query; |
| 6 | 6 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | $expr = $qb->expr()->eq($field, '?'.$i); |
| 51 | 51 | $qb->setParameter($i, $value); |
| 52 | 52 | } elseif ($condition === 'not eq') { |
| 53 | - $expr = $qb->expr()->not($qb->expr()->eq($field, '?' . $i)); |
|
| 53 | + $expr = $qb->expr()->not($qb->expr()->eq($field, '?'.$i)); |
|
| 54 | 54 | $qb->setParameter($i, $value); |
| 55 | 55 | } elseif ($condition === 'like') { |
| 56 | 56 | $expr = $qb->expr()->like($field, '?'.$i); |
@@ -72,26 +72,26 @@ discard block |
||
| 72 | 72 | } elseif ($condition === 'not in') { |
| 73 | 73 | $values = explode(',', $value); |
| 74 | 74 | $values = array_map('trim', $values); |
| 75 | - $expr = $qb->expr()->notIn($field, '?' . $i); |
|
| 75 | + $expr = $qb->expr()->notIn($field, '?'.$i); |
|
| 76 | 76 | $qb->setParameter($i, $values); |
| 77 | 77 | } elseif ($condition === 'is null') { |
| 78 | 78 | $expr = $qb->expr()->isNull($field); |
| 79 | 79 | } elseif ($condition === 'is not null') { |
| 80 | 80 | $expr = $qb->expr()->isNotNull($field); |
| 81 | 81 | } elseif ($condition === 'member of') { |
| 82 | - $expr = new DoctrineQuery\Expr\Comparison('?' . $i, 'MEMBER OF', $field); |
|
| 82 | + $expr = new DoctrineQuery\Expr\Comparison('?'.$i, 'MEMBER OF', $field); |
|
| 83 | 83 | $qb->setParameter($i, $value); |
| 84 | 84 | } elseif ($condition === 'gte') { |
| 85 | - $expr = $qb->expr()->gte($field, '?' . $i); |
|
| 85 | + $expr = $qb->expr()->gte($field, '?'.$i); |
|
| 86 | 86 | $qb->setParameter($i, $value); |
| 87 | 87 | } elseif ($condition === 'gt') { |
| 88 | - $expr = $qb->expr()->gt($field, '?' . $i); |
|
| 88 | + $expr = $qb->expr()->gt($field, '?'.$i); |
|
| 89 | 89 | $qb->setParameter($i, $value); |
| 90 | 90 | } elseif ($condition === 'lte') { |
| 91 | - $expr = $qb->expr()->lte($field, '?' . $i); |
|
| 91 | + $expr = $qb->expr()->lte($field, '?'.$i); |
|
| 92 | 92 | $qb->setParameter($i, $value); |
| 93 | 93 | } elseif ($condition === 'lt') { |
| 94 | - $expr = $qb->expr()->lt($field, '?' . $i); |
|
| 94 | + $expr = $qb->expr()->lt($field, '?'.$i); |
|
| 95 | 95 | $qb->setParameter($i, $value); |
| 96 | 96 | } else { |
| 97 | 97 | // it can be possible in future to extend to further expressions if needed, otherwise throw exception |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Artprima\QueryFilterBundle\ParamConverter; |
| 6 | 6 | |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | if (!$result instanceof EntityManager) { |
| 46 | - throw new InvalidArgumentException(self::class. ': expected EntityManager instance. Wrong configuration?'); |
|
| 46 | + throw new InvalidArgumentException(self::class.': expected EntityManager instance. Wrong configuration?'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | return $result; |
@@ -63,18 +63,18 @@ discard block |
||
| 63 | 63 | $options = $this->getOptions($configuration); |
| 64 | 64 | |
| 65 | 65 | if (!isset($options['entity_class'])) { |
| 66 | - throw new InvalidArgumentException(self::class. ': entity_class not provided. Wrong configuration?'); |
|
| 66 | + throw new InvalidArgumentException(self::class.': entity_class not provided. Wrong configuration?'); |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | if (!isset($options['repository_method'])) { |
| 70 | - throw new InvalidArgumentException(self::class. ': repository_method not provided. Wrong configuration?'); |
|
| 70 | + throw new InvalidArgumentException(self::class.': repository_method not provided. Wrong configuration?'); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | $configClassName = $configuration->getClass(); |
| 74 | 74 | $config = new $configClassName(); |
| 75 | 75 | |
| 76 | 76 | if (!$config instanceof ConfigInterface) { |
| 77 | - throw new InvalidArgumentException(self::class. ': config is not QueryFilterConfig descendant. Wrong configuration?'); |
|
| 77 | + throw new InvalidArgumentException(self::class.': config is not QueryFilterConfig descendant. Wrong configuration?'); |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | $config->setRequest(new Request($request)); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $repo = $manager->getRepository($options['entity_class']); |
| 84 | 84 | |
| 85 | 85 | if (!is_callable(array($repo, $options['repository_method']))) { |
| 86 | - throw new InvalidArgumentException(self::class. ': repository_method is not callable. Wrong configuration?'); |
|
| 86 | + throw new InvalidArgumentException(self::class.': repository_method is not callable. Wrong configuration?'); |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | $config->setRepositoryCallback(array($repo, $options['repository_method'])); |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Tests\Artprima\QueryFilterBundle\Fixtures\Response; |
| 6 | 6 | |