Files
DesignPatternsPHP/Behavioral/Iterator/Book.php
Dominik Liebler 4678b5d86f PHP8
2021-04-12 14:04:45 +02:00

26 lines
470 B
PHP

<?php declare(strict_types=1);
namespace DesignPatterns\Behavioral\Iterator;
class Book
{
public function __construct(private string $title, private string $author)
{
}
public function getAuthor(): string
{
return $this->author;
}
public function getTitle(): string
{
return $this->title;
}
public function getAuthorAndTitle(): string
{
return $this->getTitle().' by '.$this->getAuthor();
}
}