Add Litlab
This commit is contained in:
12
code/decorator.php
Normal file
12
code/decorator.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @package: patterns
|
||||
* @author: Yevhen Odynets
|
||||
* @date: 2025-07-04
|
||||
* @time: 10:39
|
||||
*/
|
||||
|
||||
declare(strict_types = 1);
|
||||
|
||||
dump('Decorator');
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user