Files
auth/app/Contract/Auth.php

32 lines
670 B
PHP
Raw Normal View History

2019-12-26 14:13:01 -03:00
<?php
namespace App\Contract;
use App\Service\Auth as AuthService;
class Auth
{
protected static function newInstance()
{
return new AuthService();
}
2021-02-09 17:37:58 -03:00
protected static $instance;
protected static function getInstance() {
if (self::$instance === null) {
self::$instance = self::newInstance();
}
return self::$instance;
}
2019-12-26 14:13:01 -03:00
public static function __callStatic($name, $params)
{
if (!method_exists(Response::class, $name)) {
$instance = self::getInstance();
if (method_exists($instance, $name)) {
return call_user_func_array([$instance, $name], $params);
}
return null;
}
return call_user_func_array([self, $name], $params);
}
}
?>