Skip to content

Commit e747ad6

Browse files
authored
Merge pull request #1679 from deguif/fix-cs
Fix CS
2 parents 00c3995 + 26df7c5 commit e747ad6

File tree

4 files changed

+41
-8
lines changed

4 files changed

+41
-8
lines changed

src/Message/AsyncPersistPage.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
<?php
2-
declare(strict_types=1);
2+
3+
/*
4+
* This file is part of the FOSElasticaBundle package.
5+
*
6+
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
311

412
namespace FOS\ElasticaBundle\Message;
513

src/Message/Handler/AsyncPersistPageHandler.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
<?php
2-
declare(strict_types=1);
2+
3+
/*
4+
* This file is part of the FOSElasticaBundle package.
5+
*
6+
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
311

412
namespace FOS\ElasticaBundle\Message\Handler;
513

@@ -10,7 +18,7 @@
1018
class AsyncPersistPageHandler implements MessageHandlerInterface
1119
{
1220
/**
13-
* var AsyncMessagePersister
21+
* @var AsyncPagerPersister
1422
*/
1523
private $persister;
1624

src/Persister/AsyncPagerPersister.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
<?php
2-
declare(strict_types=1);
2+
3+
/*
4+
* This file is part of the FOSElasticaBundle package.
5+
*
6+
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
311

412
namespace FOS\ElasticaBundle\Persister;
513

@@ -10,8 +18,8 @@
1018

1119
final class AsyncPagerPersister implements PagerPersisterInterface
1220
{
13-
const NAME = 'async';
14-
const DEFAULT_PAGE_SIZE = 100;
21+
public const NAME = 'async';
22+
private const DEFAULT_PAGE_SIZE = 100;
1523

1624
/**
1725
* @var PagerPersisterRegistry
@@ -41,7 +49,7 @@ public function __construct(
4149
/**
4250
* {@inheritdoc}
4351
*/
44-
public function insert(PagerInterface $pager, array $options = array()): void
52+
public function insert(PagerInterface $pager, array $options = []): void
4553
{
4654
$pager->setMaxPerPage(empty($options['max_per_page']) ? self::DEFAULT_PAGE_SIZE : $options['max_per_page']);
4755

@@ -58,7 +66,7 @@ public function insert(PagerInterface $pager, array $options = array()): void
5866
do {
5967
$this->messageBus->dispatch(new AsyncPersistPage($page, $options));
6068

61-
$page++;
69+
++$page;
6270
} while ($page <= $lastPage);
6371
}
6472

tests/Unit/Persister/AsyncPagerPersisterTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
declare(strict_types=1);
44

5+
/*
6+
* This file is part of the FOSElasticaBundle package.
7+
*
8+
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
9+
*
10+
* For the full copyright and license information, please view the LICENSE
11+
* file that was distributed with this source code.
12+
*/
13+
514
namespace FOS\ElasticaBundle\Tests\Unit\Persister;
615

716
use FOS\ElasticaBundle\Message\AsyncPersistPage;

0 commit comments

Comments
 (0)