23 lines
467 B
PHP
23 lines
467 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KupShop\KupShopBundle;
|
|
|
|
use KupShop\KupShopBundle\Util\Compat\ServiceContainer;
|
|
|
|
trait FacadeTrait
|
|
{
|
|
private static self $instance;
|
|
|
|
protected static function getInstance(): static
|
|
{
|
|
return self::$instance ??= ServiceContainer::getService(self::class);
|
|
}
|
|
|
|
public static function __callStatic(string $name, array $arguments)
|
|
{
|
|
return self::getInstance()->$name(...$arguments);
|
|
}
|
|
}
|