first commit
This commit is contained in:
17
includes/Traits/SingletonTrait.php
Normal file
17
includes/Traits/SingletonTrait.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
namespace Formipay\Traits;
|
||||
|
||||
trait SingletonTrait {
|
||||
private static $instance = null;
|
||||
|
||||
public static function get_instance() {
|
||||
if (null === static::$instance) {
|
||||
static::$instance = new static();
|
||||
}
|
||||
return static::$instance;
|
||||
}
|
||||
|
||||
private function __clone() {}
|
||||
public function __wakeup() {}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user