@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | public function __construct(QueryBuilder $qb, callable $countModifier = null) |
| 20 | 20 | { |
| 21 | 21 | $this->qb = $qb; |
| 22 | - $this->countModifier = $countModifier ?: function (QueryBuilder $qb) { |
|
| 22 | + $this->countModifier = $countModifier ?: function(QueryBuilder $qb) { |
|
| 23 | 23 | return $qb->select('COUNT(*)'); |
| 24 | 24 | }; |
| 25 | 25 | } |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | public function take(int $offset, int $limit): Page |
| 28 | 28 | { |
| 29 | 29 | $qb = clone $this->qb; |
| 30 | - $results = function ($offset, $limit) use ($qb) { |
|
| 30 | + $results = function($offset, $limit) use ($qb) { |
|
| 31 | 31 | return $qb |
| 32 | 32 | ->setFirstResult($offset) |
| 33 | 33 | ->setMaxResults($limit) |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | public function take(int $offset, int $limit): Page |
| 32 | 32 | { |
| 33 | 33 | return new CallbackPage( |
| 34 | - function ($offset, $limit) { |
|
| 34 | + function($offset, $limit) { |
|
| 35 | 35 | return \iterator_to_array($this->createPaginator($offset, $limit)); |
| 36 | 36 | }, |
| 37 | 37 | [$this, 'count'], |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | public function can_batch_update_results() |
| 21 | 21 | { |
| 22 | 22 | $result = $this->createResultWithItems(2); |
| 23 | - $values = \array_map(function (ORMEntity $entity) { return $entity->value; }, \iterator_to_array($result)); |
|
| 23 | + $values = \array_map(function(ORMEntity $entity) { return $entity->value; }, \iterator_to_array($result)); |
|
| 24 | 24 | |
| 25 | 25 | $this->assertSame(['value 1', 'value 2'], $values); |
| 26 | 26 | |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $values = \array_map( |
| 36 | - function (ORMEntity $entity) { return $entity->value; }, |
|
| 36 | + function(ORMEntity $entity) { return $entity->value; }, |
|
| 37 | 37 | $this->em->getRepository(ORMEntity::class)->findAll() |
| 38 | 38 | ); |
| 39 | 39 | |
@@ -102,7 +102,7 @@ |
||
| 102 | 102 | */ |
| 103 | 103 | public function results_must_be_countable() |
| 104 | 104 | { |
| 105 | - $iterator = function () { |
|
| 105 | + $iterator = function() { |
|
| 106 | 106 | yield 'foo'; |
| 107 | 107 | }; |
| 108 | 108 | |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | */ |
| 94 | 94 | public function results_do_not_have_to_be_countable() |
| 95 | 95 | { |
| 96 | - $iterator = function () { |
|
| 96 | + $iterator = function() { |
|
| 97 | 97 | yield 'foo'; |
| 98 | 98 | }; |
| 99 | 99 | $batchProcessor = new ORMBatchProcessor($iterator(), $this->em); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | */ |
| 19 | 19 | public function __construct(iterable $results, EntityManagerInterface $em, int $batchSize = 100) |
| 20 | 20 | { |
| 21 | - if (!\is_countable($results)) { |
|
| 21 | + if ( ! \is_countable($results)) { |
|
| 22 | 22 | throw new \InvalidArgumentException('$results must be countable.'); |
| 23 | 23 | } |
| 24 | 24 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | public function can_batch_update_results() |
| 24 | 24 | { |
| 25 | 25 | $result = $this->createResultWithItems(2); |
| 26 | - $values = \array_map(function (array $row) { return $row[0]->value; }, \iterator_to_array($result)); |
|
| 26 | + $values = \array_map(function(array $row) { return $row[0]->value; }, \iterator_to_array($result)); |
|
| 27 | 27 | |
| 28 | 28 | $this->assertSame(['value 1', 'value 2'], $values); |
| 29 | 29 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | $values = \array_map( |
| 39 | - function (ORMEntity $entity) { return $entity->value; }, |
|
| 39 | + function(ORMEntity $entity) { return $entity->value; }, |
|
| 40 | 40 | $this->em->getRepository(ORMEntity::class)->findAll() |
| 41 | 41 | ); |
| 42 | 42 | |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | public static function normalize($result) |
| 18 | 18 | { |
| 19 | - if (!\is_array($result)) { |
|
| 19 | + if ( ! \is_array($result)) { |
|
| 20 | 20 | return $result; |
| 21 | 21 | } |
| 22 | 22 | |