Last active
March 23, 2019 20:28
-
-
Save kanian/432abe4d20e426df2f7b30888fb29b48 to your computer and use it in GitHub Desktop.
Singleton use example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require "./vendor/autoload.php"; | |
use Assoa\Yo\Yo; | |
use Assoa\Loader\Loader; | |
use Assoa\PatternFactories\SingletonFactory; | |
Loader::setLoader(require ("./vendor/autoload.php")); | |
$singletonClass = SingletonFactory::get(new Yo, true); | |
$single = new $singletonClass(); | |
$single->hein("Yedi!"); | |
$single->what(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment