kyimyohan/php-design-patterns

Maintainers

Package info

github.com/kyimyohanvov/php-design-patterns

pkg:composer/kyimyohan/php-design-patterns

Statistics

Installs: 5

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

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

This package is auto-updated.

Last update: 2026-02-22 20:01: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();

License

MIT