mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-09 00:16:32 +02:00
update deps & install rector
This commit is contained in:
@@ -8,14 +8,8 @@ namespace DesignPatterns\Structural\Adapter;
|
||||
*/
|
||||
class EBookAdapter implements Book
|
||||
{
|
||||
/**
|
||||
* @var EBook
|
||||
*/
|
||||
protected $eBook;
|
||||
protected EBook $eBook;
|
||||
|
||||
/**
|
||||
* @param EBook $eBook
|
||||
*/
|
||||
public function __construct(EBook $eBook)
|
||||
{
|
||||
$this->eBook = $eBook;
|
||||
@@ -37,8 +31,6 @@ class EBookAdapter implements Book
|
||||
/**
|
||||
* notice the adapted behavior here: EBook::getPage() will return two integers, but Book
|
||||
* supports only a current page getter, so we adapt the behavior here
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function getPage(): int
|
||||
{
|
||||
|
@@ -8,15 +8,8 @@ namespace DesignPatterns\Structural\Adapter;
|
||||
*/
|
||||
class Kindle implements EBook
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $page = 1;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $totalPages = 100;
|
||||
private int $page = 1;
|
||||
private int $totalPages = 100;
|
||||
|
||||
public function pressNext()
|
||||
{
|
||||
|
@@ -4,10 +4,7 @@ namespace DesignPatterns\Structural\Adapter;
|
||||
|
||||
class PaperBook implements Book
|
||||
{
|
||||
/**
|
||||
* @var int
|
||||
*/
|
||||
private $page;
|
||||
private int $page;
|
||||
|
||||
public function open()
|
||||
{
|
||||
|
Reference in New Issue
Block a user