mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-06-08 06:55:10 +02:00
21 lines
390 B
PHP
21 lines
390 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';
|
|
}
|
|
}
|