first commit
This commit is contained in:
22
bundles/KupShop/KupShopBundle/FacadeTrait.php
Normal file
22
bundles/KupShop/KupShopBundle/FacadeTrait.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user