1
0
mirror of https://github.com/DesignPatternsPHP/DesignPatternsPHP.git synced 2025-07-16 12:56:21 +02:00
Files
DesignPatternsPHP/Behavioral/Iterator/Book.php
Mario Simão 56970cc221 style: Adopt PSR12
Dev dependency flyeralarm/php-code-validator has been removed.

Closes 
2021-10-01 10:26:04 -03:00

28 lines
475 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();
}
}