kyimyohan / php-design-patterns
v1.0.0
2023-01-08 11:44 UTC
Requires (Dev)
- phpunit/phpunit: ^9.5
This package is auto-updated.
Last update: 2024-09-22 16:50:49 UTC
README
Installation
Use the package manager composer to install
composer require kyimyohan/php-design-patterns
Usage
###Decorator Pattern
<?php use Kyimyohan\PhpDesignPatterns\DecoratorPattern\Decorator; use Kyimyohan\PhpDesignPatterns\DecoratorPattern\BubbleTea; use Kyimyohan\PhpDesignPatterns\DecoratorPattern\Jelly; use Kyimyohan\PhpDesignPatterns\DecoratorPattern\Pudding; $decorator = new Decorator(new Pudding(new Jelly(new BubbleTea))); echo $decorator->getDescription(); echo $decorator->getPrice();