Add Litlab
This commit is contained in:
@@ -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