Returns the singleton instance for the derived class. If the singleton instance
has not been created, this method will create it.

@return static
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];
    }
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;
    }
476544
public static function getInstance()
    {
        if (!static::$instance instanceof self) {
            static::$instance = $session = new self();
            if (!$session->isStarted()) {
                $session->start();
            }
        }

        return static::$instance;
    }
210359
static public function instance() {
		$f3 = \Base::instance();
		$dir = $f3->split($f3->get('UI'));
		$localFS = new \FAL\LocalFS($dir[0]);
		return new self($localFS);
	}
580933
public static function getInstance() {

		if( !isset( self::$instance ) ) {

			self::$instance	= new CacheProperties();

			self::$instance->init( CoreGlobal::CONFIG_CACHE );
		}

		return self::$instance;
	}
831250
private function getInstance()
    {
        if (is_null($this->instance)) {
            $this->instance = \RegexGuard\Factory::getGuard();
        }
        
        return $this->instance;
    }
1240630
final public static function instance() {
        $c = get_called_class();
       
        if( ! isset( self::$instances[$c] ) )
        {
            self::$instances[$c] = new $c;
        }
       
        return self::$instances[$c];
    }
109258
public static function singleton()
    {
        $returnValue = null;

        
        if (is_null(self::$instance)) {
        	self::$instance = new common_log_Dispatcher();
        }
        $returnValue = self::$instance;
        

        return $returnValue;
    }
1245953
final public static function getInstance()
    {
        // This attribute has to be an array because it is shared across all
        // classes using this trait. Without an array, the first time an
        // instance is created and stored in this variable, all other calls
        // to the method getInstance() would return the same instance, no matter
        // what class is invoked.
        static $instances = [];

        // Get the name of the calling class. The calling class is the concrete
        // class using this trait.
        $className = \get_called_class();

        if (false === isset($instances[$className])) {
            $arguments = \func_get_args();
            $instances[$className] = ReflectionUtils::createNewInstanceWithoutConstructor(
                $className,
                $arguments
            );
        }

        return $instances[$className];
    }
882762
public static function singleton() {
        $returnValue = null;

        
        $serviceName = get_called_class();
        if (!isset(self::$instances[$serviceName])) {
            self::$instances[$serviceName] = new $serviceName();
        }

        $returnValue = self::$instances[$serviceName];
        

        return $returnValue;
    }
1003826
public static function getInstance()
	{
		$calledClass = get_called_class();
		$registry = Registry::getInstance();

		return isset($registry[$calledClass]) ?
			$registry[$calledClass] :
			($registry[$calledClass] = new $calledClass());
	}
406171
public function getEngineInstance()
	{
		if (!isset($this->_engineInstance)) {
			$this->_engineInstance = new static::$engines[$this->options['engine']];
		}
		return $this->_engineInstance;
	}
666271
final public static function getInstance()
    {
        $cls = static::class;
        if (isset(static::$instances[$cls])) {
            return static::$instances[$cls];
        }

        if ($cls === self::class) {
            throw new \LogicException("$cls cannot be used directly. Please subclass in your project.");
        }

        return static::$instances[$cls] = static::create();
    }
486745
public static function getInstance()
    {
        $class = new ReflectionClass(get_called_class());
        $className = $class->getName();
        if (isset(self::$instances[$className]) === false || $class->isInstance(self::$instances[$className]) === false) {
            self::$instances[$className] = $class->newInstanceWithoutConstructor();

            if (($constructorMethod = $class->getConstructor()) instanceof ReflectionMethod) {
                call_user_func_array(array(self::$instances[$className], '__construct'), func_get_args());

                if ($constructorMethod->isPublic() === true) {
                    trigger_error($className . '::__construct is public and could be instantiated as non-singleton.', E_USER_NOTICE);
                    // @codeCoverageIgnoreStart
                } // @codeCoverageIgnoreEnd
            }
        }

        return self::$instances[$className];
    }
811004
public static function &getInstance()
    {
        $classname = get_called_class();
        if (!isset(self::$_instances[ $classname ])) {
            self::createInstance($classname, func_get_args());
        }
        $instance = self::$_instances[ $classname ];
        return $instance;
    }
11137
private static function getInstance()
    {
        if (self::$converter === null) {
            self::$converter = new AnsiToHtmlConverter(null, false);
        }

        return self::$converter;
    }
285831
public function getModelInstance()
    {
        if ($this->instance !== null) {
            return $this->instance;
        }
        $model = $this->getModel();
        if ($model === false) {
            return false;
        }
        $instance = new $model();

        return $instance;
    }