Decorator
Purpose: To dynamically add new functionality to class instance. Booking.php <?php namespace DesignPatterns\Structural\Decorator; interface Booking { public function calculatePrice(): int; public function getDescription(): string; } BookingDecorator.php <?php namespace DesignPatterns\Structural\Decorator; abstract class BookingDecorator implements Booking { /** * @var Booking */ protected $booking; public function __construct(Booking $booking) { $this->booking = $booking; } } DoubleRoomBooking.php <?php namespace DesignPatterns\Structural\Decorator; class DoubleRoomBooking implements