Add Litlab

This commit is contained in:
2025-07-04 13:35:51 +03:00
parent 1cf6e3d7d2
commit dabbf541dc
17 changed files with 159 additions and 17 deletions

12
code/decorator.php Normal file
View File

@@ -0,0 +1,12 @@
<?php
/**
* @package: patterns
* @author: Yevhen Odynets
* @date: 2025-07-04
* @time: 10:39
*/
declare(strict_types = 1);
dump('Decorator');

View File

@@ -36,5 +36,5 @@ function client(): void
/** @noinspection ForgottenDebugOutputInspection */
dump($draft);
}
?><img class="diagram" src="/assets/img/diagrams/prototype.png" alt="Adapter DEsign Pattern Diagram"><?php
client();

View File

@@ -16,7 +16,7 @@ use Pattern\Creational\{Singleton\Single, Singleton\Singleton};
*
* @noinspection ForgottenDebugOutputInspection
*/
function clientCode(): void
function client(): void
{
$output = [
'where' => trace(),
@@ -36,7 +36,8 @@ function clientCode(): void
dump($output, $output['s1']->getValue(), $output['s2']->getValue());
}
clientCode();
?><img class="diagram" src="/assets/img/diagrams/singleton.png" alt="Adapter DEsign Pattern Diagram"><?php
client();
$single = Single::getInstance('from subclass');
$single->setValue('value set from Single::class')->childish();