getInstance

Returns an AbstractSingleton instance

@access public
@param  mixed ...
@return AbstractSingleton
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];
    }
995710
public static function instance(): self
    {
        if (!self::$instance) {
            self::$instance = new self(
                1,
                Sequencer::sequence('exporter-object-id'),
                InvocableInspector::instance()
            );
        }

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

        if (! isset(self::$instance[$model])) {
            self::$instance[$model] = new $model;

            if (is_null(self::$instance[$model]->db)) {
                self::$instance[$model]->getDatabaseInstance();
            }
        }

        return self::$instance[$model];
    }
45094
public static function getInstance()
    {
        static $_instance;

        if (!$_instance) {
            $_instance = new self(new AnConfig(array('service_container' => AnService::getInstance())));
            AnService::set('plg:contentfilter.chain', $_instance);
            AnService::get('com:plugins.helper')->import('contentfilter');
        }

        return $_instance;
    }
1334691
private static function initInstance(): Instance
    {
        $instance = new Instance();
        $instance->setOptions(Config::get('translator'));
        $instance->init();
        return $instance;
    }
177052
public static function getInstance()
    {
        if (self::$_instance === null) {
            self::$_instance = new Config();
            if (self::$_instance->_store === null) {
                self::$_instance->_store = self::$_instance->_setStore();
            }
        }

        return self::$_instance;
    }
712326
public static function getInstance()
    {
        if (is_null(self::$_instance)) {
            $c = self::getComponentClass();
            if ($c) {
                self::$_instance = new self(array('componentClass' => $c));
            } else {
                self::$_instance = false;
            }
        }
        return self::$_instance;
    }
872969
public function newInstance()
    {
        if ($this->prototype === null) {
            $this->prototype = unserialize(sprintf('O:%d:"%s":0:{}', strlen($this->name), $this->name));
        }

        return clone $this->prototype;
    }
821093
public static function instance()
    {
        if (null === self::$_instance) {
            $capsule = new Capsule;
            $capsule->addConnection(self::getConfig());
            $capsule->setEventDispatcher(new Dispatcher(new Container));
            $capsule->setAsGlobal();

            self::$_instance = $capsule;
        }
        return self::$_instance;
    }
819749
public static function instance($newInstance = null)
    {
        static $instance;

        if ($newInstance instanceof self) {
            $instance = $newInstance;
        }

        if (!($instance instanceof self)) {
            $instance = new self();
        }

        return $instance;
    }
120350
public function CloneInstance()
	{
		$result = new InstanceFactsIterator( $this->context );
		$result->nonNilOnly = $this->nonNilOnly;
		$result->iterator = $this->iterator->CloneInstance();
		$result->substitutionGroups = $this->substitutionGroups;
		$result->Reset();
		return $result;
	}
1003826
public static function getInstance()
	{
		$calledClass = get_called_class();
		$registry = Registry::getInstance();

		return isset($registry[$calledClass]) ?
			$registry[$calledClass] :
			($registry[$calledClass] = new $calledClass());
	}
514307
final public static function getInstance()
    {
        $className = get_called_class();
        if (!isset(self::$_instances[$className])) {
            $instance = new $className();
            /* @var SingleTon $instance */
            $instance->init();
            self::$_instances[$className] = $instance;
        }
        return self::$_instances[$className];
    }
331096
public static function GetInstance() : Translator
   {

      if ( null === self::$_instance )
      {
         self::$_instance = new Translator();
      }

      return self::$_instance;

   }
250673
public function newInstance()
    {
        if (!$this->instantiator instanceof InstantiatorInterface) {
            $this->instantiator = new Instantiator();
        }

        return $this->instantiator->instantiate($this->name);
    }
1081130
public static function getInstance($loggerName = __CLASS__)
    {
        if (array_key_exists($loggerName, LoggingManager::$instances)) {
            return LoggingManager::$instances[$loggerName];
        }
        $instance = new self($loggerName);
        LoggingManager::$instances[$loggerName] = $instance;
        return $instance;
    }
488862
public static function getInstance()
    {
        if (empty(self::$instances[static::class])) {
            $instance = new static();
            self::$instances[static::class] = $instance;
        } else {
            $instance = self::$instances[static::class];
        }
        return ($instance);
    }