diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..874d226 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,3 @@ +FROM php:8.3-cli-alpine3.22 + +ENTRYPOINT ["php", "-S", "localhost:8008", "-t", "public/"] \ No newline at end of file diff --git a/code/decorator.php b/code/decorator.php new file mode 100644 index 0000000..ae4e1ec --- /dev/null +++ b/code/decorator.php @@ -0,0 +1,12 @@ +Adapter DEsign Pattern Diagram trace(), @@ -36,7 +36,8 @@ function clientCode(): void dump($output, $output['s1']->getValue(), $output['s2']->getValue()); } -clientCode(); +?>Adapter DEsign Pattern DiagramsetValue('value set from Single::class')->childish(); diff --git a/composer.json b/composer.json index d2c834f..f3b6eaa 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,7 @@ ], "require": { "php": "8.3.*", - "ext-simplexml": "*", - "ext-yaml": "*" + "ext-simplexml": "*" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.76" diff --git a/composer.lock b/composer.lock index f80d22f..33e17b1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8d4ed5a63e8da7821980256ec54097f7", + "content-hash": "15fcc4c375fa23daddd63652d90fdeab", "packages": [], "packages-dev": [ { @@ -2544,7 +2544,10 @@ "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, - "platform": {}, + "platform": { + "php": "8.3.*", + "ext-simplexml": "*" + }, "platform-dev": {}, "plugin-api-version": "2.6.0" } diff --git a/public/assets/img/diagrams/prototype.png b/public/assets/img/diagrams/prototype.png new file mode 100644 index 0000000..dead9b3 Binary files /dev/null and b/public/assets/img/diagrams/prototype.png differ diff --git a/public/assets/img/diagrams/singleton.png b/public/assets/img/diagrams/singleton.png new file mode 100644 index 0000000..f353122 Binary files /dev/null and b/public/assets/img/diagrams/singleton.png differ diff --git a/public/index.php b/public/index.php index 028f73b..a8659ac 100644 --- a/public/index.php +++ b/public/index.php @@ -41,25 +41,28 @@ require '../src/helpers.php'; transform: translate(-50%, -50%); max-height: 92dvh; overflow-y: auto; - background-color: attr(data-color type(), #eef0f0); + background-color: attr(data-color type(< color >), #eef0f0); } pre, code { font-family: Consolas, monospace; font-size: 1.125rem; } + pre { align-self: center; } img.diagram { + display: block; max-width: 100%; + margin: 0 auto 1rem; } .et { position: absolute; - top: .5rem; - left: .5rem; + bottom: .5rem; + right: .5rem; font-size: small; font-weight: 500; color: #333; @@ -68,12 +71,10 @@ require '../src/helpers.php';
- +
ET: secs
- - - - + \ No newline at end of file diff --git a/src/Pattern/Structural/Decorator/BorderDecorator.php b/src/Pattern/Structural/Decorator/BorderDecorator.php new file mode 100644 index 0000000..b679bf9 --- /dev/null +++ b/src/Pattern/Structural/Decorator/BorderDecorator.php @@ -0,0 +1,22 @@ +'; + } +} \ No newline at end of file diff --git a/src/Pattern/Structural/Decorator/Circle.php b/src/Pattern/Structural/Decorator/Circle.php new file mode 100644 index 0000000..6bb7562 --- /dev/null +++ b/src/Pattern/Structural/Decorator/Circle.php @@ -0,0 +1,20 @@ +