An open API service indexing awesome lists of open source software.

https://github.com/bariseser/php_decorator_pattern

Decorator is a structural design pattern that lets you attach new behaviors to objects by placing these objects inside special wrapper objects that contain the behaviors.
https://github.com/bariseser/php_decorator_pattern

decorator-pattern decorators design-architecture design-patterns php-design-pattern

Last synced: about 1 year ago
JSON representation

Decorator is a structural design pattern that lets you attach new behaviors to objects by placing these objects inside special wrapper objects that contain the behaviors.

Awesome Lists containing this project

README

          

# php_decorator_pattern
Decorator is a structural design pattern that lets you attach new behaviors to objects by placing these objects inside special wrapper objects that contain the behaviors.

```php
use IceCream\IceCream;
use IceCream\Nutty;

$iceCream = new IceCream();
$nutty = new Nutty($iceCream);
echo $nutty->makeIceCream() . PHP_EOL;
echo $nutty->getPrice() . PHP_EOL;
```