mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-31 20:20:15 +02:00
update deps & install rector
This commit is contained in:
@@ -4,15 +4,8 @@ namespace DesignPatterns\Behavioral\Iterator;
|
||||
|
||||
class Book
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $author;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $title;
|
||||
private string $author;
|
||||
private string $title;
|
||||
|
||||
public function __construct(string $title, string $author)
|
||||
{
|
||||
|
@@ -2,17 +2,16 @@
|
||||
|
||||
namespace DesignPatterns\Behavioral\Iterator;
|
||||
|
||||
class BookList implements \Countable, \Iterator
|
||||
use Countable;
|
||||
use Iterator;
|
||||
|
||||
class BookList implements Countable, Iterator
|
||||
{
|
||||
/**
|
||||
* @var Book[]
|
||||
*/
|
||||
private $books = [];
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $currentIndex = 0;
|
||||
private array $books = [];
|
||||
private int $currentIndex = 0;
|
||||
|
||||
public function addBook(Book $book)
|
||||
{
|
||||
|
Reference in New Issue
Block a user