mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-19 05:01:15 +02:00
#232 removed Iterator classes
This commit is contained in:
@@ -4,27 +4,33 @@ namespace DesignPatterns\Behavioral\Iterator;
|
||||
|
||||
class Book
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $author;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $title;
|
||||
|
||||
public function __construct($title, $author)
|
||||
public function __construct(string $title, string $author)
|
||||
{
|
||||
$this->author = $author;
|
||||
$this->title = $title;
|
||||
}
|
||||
|
||||
public function getAuthor()
|
||||
public function getAuthor(): string
|
||||
{
|
||||
return $this->author;
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
public function getTitle(): string
|
||||
{
|
||||
return $this->title;
|
||||
}
|
||||
|
||||
public function getAuthorAndTitle()
|
||||
public function getAuthorAndTitle(): string
|
||||
{
|
||||
return $this->getTitle().' by '.$this->getAuthor();
|
||||
}
|
||||
|
Reference in New Issue
Block a user