kyimyohan/php-design-patterns

Installs: 5

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/kyimyohan/php-design-patterns

v1.0.0 2023-01-08 11:44 UTC

This package is auto-updated.

Last update: 2025-09-22 18:46:54 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();

License

MIT