mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-12 01:44:09 +02:00
refactored Decorator pattern
This commit is contained in:
16
Structural/Decorator/DoubleRoomBooking.php
Normal file
16
Structural/Decorator/DoubleRoomBooking.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace DesignPatterns\Structural\Decorator;
|
||||
|
||||
class DoubleRoomBooking implements Booking
|
||||
{
|
||||
public function calculatePrice(): int
|
||||
{
|
||||
return 40;
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'double room';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user