mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-28 04:03:02 +02:00
19 lines
389 B
PHP
19 lines
389 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace DesignPatterns\Structural\Decorator;
|
|
|
|
class WiFi extends BookingDecorator
|
|
{
|
|
private const PRICE = 2;
|
|
|
|
public function calculatePrice(): int
|
|
{
|
|
return $this->booking->calculatePrice() + self::PRICE;
|
|
}
|
|
|
|
public function getDescription(): string
|
|
{
|
|
return $this->booking->getDescription() . ' with wifi';
|
|
}
|
|
}
|