Dependencies
This commit is contained in:
20
aldarien/contract/app/Definition/Contract.php
Normal file
20
aldarien/contract/app/Definition/Contract.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
namespace App\Definition;
|
||||
|
||||
trait Contract
|
||||
{
|
||||
protected static $instance = null;
|
||||
|
||||
private function __construct() {}
|
||||
|
||||
protected static function getInstance()
|
||||
{
|
||||
if (self::$instance == null) {
|
||||
self::$instance = static::newInstance();
|
||||
}
|
||||
return self::$instance;
|
||||
}
|
||||
|
||||
abstract protected static function newInstance();
|
||||
}
|
||||
?>
|
Reference in New Issue
Block a user