Skip to content

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.

License

Notifications You must be signed in to change notification settings

bariseser/php_decorator_pattern

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

use IceCream\IceCream;
use IceCream\Nutty;

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

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages