Get the static instance of this manager.

@return FunctionHookManager The static manager.
187538
public static function instance(): self
    {
        if (!self::$instance) {
            self::$instance = new self(
                InvocableInspector::instance(),
                FunctionSignatureInspector::instance(),
                FunctionHookGenerator::instance()
            );
        }

        return self::$instance;
    }
760924
public static function getInstance()
    {
        $class = get_called_class();

        if (!isset(self::$instances[$class])) {
            $container = StaticContainer::getContainer();

            $refl = new \ReflectionClass($class);

            if (!$refl->getConstructor() || $refl->getConstructor()->isPublic()) {
                self::$instances[$class] = $container->get($class);
            } else {
                /** @var LoggerInterface $logger */
                $logger = $container->get('Psr\Log\LoggerInterface');

                // BC with API defining a protected constructor
                $logger->notice('The API class {class} defines a protected constructor which is deprecated, make the constructor public instead', array('class' => $class));
                self::$instances[$class] = new $class;
            }
        }

        return self::$instances[$class];
    }
1089506
public static function getInstance(): ConnectionManager
	{
		if (self::$instance === NULL)
		{
			self::$instance = new self();
		}

		return self::$instance;
	}
195654
private function staticScalar() {
    if ($this->currentType === T_ARRAY) {
      $node = new ArrayNode();
      $this->mustMatch(T_ARRAY, $node);
      $this->mustMatch('(', $node, 'openParen');
      $this->staticArrayPairList($node, ')');
      $this->mustMatch(')', $node, 'closeParen', TRUE);
      return $node;
    }
    elseif ($this->currentType === '[') {
      $node = new ArrayNode();
      $this->mustMatch('[', $node);
      $this->staticArrayPairList($node, ']');
      $this->mustMatch(']', $node, NULL, TRUE);
      return $node;
    }
    else {
      return $this->expr(TRUE);
    }
  }
620506
public static function & GetInstance () {
		// get `"ClassName"` string from this call: `ClassName::GetInstance();`
		$staticClassName = version_compare(PHP_VERSION, '5.5', '>') ? static::class : get_called_class();
		$args = func_get_args();
		$instanceIndex = str_replace('\\', '_', $staticClassName) . '#' . serialize($args);
		if (!isset(self::$instances[$instanceIndex])) {
			$reflectionClass = new \ReflectionClass($staticClassName);
			$instance = $reflectionClass->newInstanceArgs($args);
			self::$instances[$instanceIndex] = $instance;
		}
		return self::$instances[$instanceIndex];
	}
1188512
protected static function getInstance()
    {
        if (is_callable(static::$instance)) {
            $callable = static::$instance;

            static::$instance = $callable();
        }

        if (!static::$instance instanceof ScriptManager) {
            throw new \LogicException('Instance of ScriptManager should be ' . ScriptManager::class);
        }

        return static::$instance;
    }
265063
public function getListenerInstance()
    {
        if (null !== $this->_listener && null === $this->listenerInstance) {
            $this->listenerInstance = new $this->_listener();
        }

        return $this->listenerInstance;
    }
1286531
public static function getLogger()
    {
        if (self::$logger === null)
        {
            try
            {
                $result = Hook::execute(
                    "Wedeto.Util.GetLogger", 
                    ["logger" => null, "class" => static::class]
                );
            }
            catch (RecursionException $e)
            {
                // Apparently the hook is calling getLogger which is failing, so
                // use an emergency logger to log anyway.
                $result = ['logger' => new EmergencyLogger];
            }

            self::$logger = $result['logger'] ?? new NullLogger();
        }
        return self::$logger;
    }
26361
public function getCallbackFunction()
    {
        if ($this->callbackFunction)
            return $this->callbackFunction;
        if ($this->getParent())
            return $this->getParent()->getCallbackFunction();
        return null;
    }
997322
public function getCallbackResolver()
    {
        if (! $this->callbackResolver instanceof CallbackResolverInterface) {
            $this->callbackResolver = new CallbackResolver($this);
        }

        return $this->callbackResolver;
    }
1162234
public static function getInstance()
    {
        // set strict to false
        // -> meaning: no matter which parameter given we return the same instance
        self::$strict = false;

        // get possible parameter passed to this class
        $arguments = func_get_args();

        // decide call-type by given parameter
        if (empty($arguments)) {
            $instance = parent::getInstance();
        } else {
            $instance = parent::getInstance($arguments);
        }

        // return instance
        return $instance;
    }
112727
public static function &GetInstance()
    {
        static $oInstance = null;
        if (is_null($oInstance)) {
            $oInstance = new self();
            TPkgCmsEventManager::GetInstance()->RegisterObserver(TPkgCmsEvent::CONTEXT_CORE, TPkgCmsEvent::NAME_PRE_OUTPUT_CALLBACK_FUNCTION, $oInstance);
        }

        return $oInstance;
    }
412
public static function getInstance ()
    {
        // If this class is used for multiple singletons, we need to keep
        // track of multiple singleton objects, one for each class name
        static $instances = array();

        // Get class name to use. Use late static binding here,
        // if method is overriden by derived classes.
        $singletonClassName = static::_getInstanceClassName();

        // If already instantiated, use that
        if (isset($instances[$singletonClassName])) {
            return $instances[$singletonClassName];
        }

        // Otherwise create new instance
        $instances[$singletonClassName] = new $singletonClassName (static::_getInstanceFuseValue());

        return $instances[$singletonClassName];
    }
766334
static public function instance()
    {
        $key = get_called_class();
        if (!isset(static::$instances[$key])) {
            $object = new static();
            $object->setCache(Ioc::cache('widget'));
            static::$instances[$key] = $object;
        }
        return static::$instances[$key];
    }
165605
public function getHandlerStack(): HandlerStack
    {
        if ($this->handlerStack) {
            return $this->handlerStack;
        }

        $this->handlerStack = HandlerStack::create($this->getGuzzleHandler());

        foreach ($this->middlewares as $name => $middleware) {
            $this->handlerStack->push($middleware, $name);
        }

        return $this->handlerStack;
    }
111159
private function getCloneablesMap()
    {
        $cachedInstantiators = $this->getInstantiatorsMap();
        $that                = $this;

        return self::$cachedCloneables = self::$cachedCloneables
            ?: new CallbackLazyMap(function ($className) use ($cachedInstantiators, $that) {
                /* @var $factory Closure */
                $factory    = $cachedInstantiators->$className;
                $instance   = $factory();

                if (! $that->isSafeToClone(new ReflectionClass($className))) {
                    return null;
                }

                return $instance;
            });
    }
1257397
private static function instance()
    {
        $currentClass = get_called_class();
        $instanceName = empty( self::$instance ) ? '' : new \ReflectionClass(self::$instance);
        if( empty( self::$instance ) || ( $instanceName->name != $currentClass ) ) {
            self::$instance = new static();
        }
        return self::$instance;
    }