mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-11 01:14:01 +02:00
PHP7 Adapter
This commit is contained in:
@@ -2,22 +2,25 @@
|
||||
|
||||
namespace DesignPatterns\Structural\Adapter;
|
||||
|
||||
/**
|
||||
* Book is a concrete and standard paper book.
|
||||
*/
|
||||
class Book implements PaperBookInterface
|
||||
class Book implements BookInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
* @var int
|
||||
*/
|
||||
private $page;
|
||||
|
||||
public function open()
|
||||
{
|
||||
$this->page = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function turnPage()
|
||||
{
|
||||
$this->page++;
|
||||
}
|
||||
|
||||
public function getPage(): int
|
||||
{
|
||||
return $this->page;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user