mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-06 06:44:59 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,21 +1,30 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Pagination;
|
||||
|
||||
use Iterator;
|
||||
|
||||
/**
|
||||
* PageGenerator associated with a Paginator.
|
||||
*/
|
||||
class PageGenerator implements \Iterator
|
||||
class PageGenerator implements Iterator
|
||||
{
|
||||
protected Paginator $paginator;
|
||||
|
||||
protected int $current = 1;
|
||||
|
||||
protected Paginator $paginator;
|
||||
|
||||
public function __construct(Paginator $paginator)
|
||||
{
|
||||
$this->paginator = $paginator;;
|
||||
$this->paginator = $paginator;
|
||||
}
|
||||
|
||||
public function current()
|
||||
@@ -30,7 +39,7 @@ class PageGenerator implements \Iterator
|
||||
|
||||
public function next()
|
||||
{
|
||||
$this->current++;
|
||||
++$this->current;
|
||||
}
|
||||
|
||||
public function rewind()
|
||||
@@ -40,7 +49,7 @@ class PageGenerator implements \Iterator
|
||||
|
||||
public function valid()
|
||||
{
|
||||
return $this->current > 0
|
||||
&& $this->current <= $this->paginator->countPages();
|
||||
return 0 < $this->current
|
||||
&& $this->paginator->countPages() >= $this->current;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user