get instance

@return static
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];
    }
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;
    }
394891
public function get_current_instance() {
        if ($this->get_status() == self::INSTANCE_STATUS_ACTIVE || $this->get_status() == self::INSTANCE_STATUS_NEEDUPDATE) {
            return $this;
        }
        return $this->get_controller()->get_current_instance($this->data->raterid, $this->data->itemid);
    }
835451
public static function getInstance()
  {
    if (!isset(self::$instance)) {
      self::$instance = new self;
    }
    self::$instance->startSession();
    return self::$instance;
  }
549300
public static function getInstance()
    {
        $controller = get_called_class();

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

        if (is_null(self::$instance[$controller]->view)) {
            self::getViewInstance(self::$instance[$controller]);
        }

        self::getModelInstance(self::$instance[$controller], $controller);

        return self::$instance[$controller];
    }
1003826
public static function getInstance()
	{
		$calledClass = get_called_class();
		$registry = Registry::getInstance();

		return isset($registry[$calledClass]) ?
			$registry[$calledClass] :
			($registry[$calledClass] = new $calledClass());
	}
5065
public static function getInstance() {

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

			self::$instance	= new CoreProperties();

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

		return self::$instance;
	}
812653
private static function getInstance()
	{
		$accessor = static::getContainerAccessor();

		if (!isset(static::$instances[$accessor])) {
			$container = static::getContainer();
			static::$instances[$accessor] = $container[$accessor];
		}

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

        return static::$instance;
    }
344489
public static function getInstance()
    {
        if (null === self::$instance) {
            $class          = new \ReflectionClass(__CLASS__);
            self::$instance = $class->newInstanceArgs(func_get_args());
        }

        return self::$instance;
    }
626880
public static function getInstance()
    {
        if (null === self::$instance) {
            self::$instance = new static();

            $loader = new YamlFileLoader(self::$instance, new FileLocator(__DIR__.'/../Resources/config'));
            $loader->load('config.yml');
            $loader->load('services.yml');

            self::$instance->setParameter('phantomjs.cache_dir', sys_get_temp_dir());
            self::$instance->setParameter('phantomjs.resource_dir', __DIR__.'/../Resources');
        }

        return self::$instance;
    }
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;
    }
1115029
public static function getInstance(string $name)
    {
        if (!isset(self::$instances[$name]) || empty(self::$instances[$name])) {
            new static($name);
        }
        return (self::$instances[$name]);
    }
230585
public function getInstance() {
        if(!$this->isInstanceLoaded()) {
            $inst = $this->loadInstance();
            if(!$this->instance)
                $this->instance = $inst;
        }
		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];
    }
58954
public static function instance()
    {
        if (null === self::$_instance) {
            $logger = new Monolog(Config::read('app.id'));
            $file_handler = new StreamHandler(self::getFilepath());
            $logger->pushHandler($file_handler);

            self::$_instance = $logger;
        }
        return self::$_instance;
    }