Get an instance of the types singleton
@param Function $instance (optional) A potentially descendant instance to use
@return SchemaTypes
553265
public static function &getInstance( $instance = null )
	{
		if ( parent::hasInstance() )
		{
			return parent::getInstance();
		}

		$instance = parent::getInstance( new self() );
		$instance->fromFile();
		return $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;
    }
344489
public static function getInstance()
    {
        if (null === self::$instance) {
            $class          = new \ReflectionClass(__CLASS__);
            self::$instance = $class->newInstanceArgs(func_get_args());
        }

        return self::$instance;
    }
584215
public function getDependencyInstances($instance)
    {
        $calls = array();

        foreach ($this->tracedCalls as $call) {
            $oid = spl_object_hash($call['instance']);

            $calls[$oid] = $call;
        }

        $dependencies = array();

        foreach ($calls as $call) {
            $dependingServices = $this->getDependingInstances($call['instance']);

            foreach ($dependingServices as $depending) {
                if ($depending['instance'] === $instance) {
                    $dependencies[] = $call;
                }
            }
        }

        return $dependencies;
    }
1175297
public static function getInstance($name=null) {
		if( !$name ) {
			$name = 'default';
		}
		if( !isset(static::$instances[$name]) ) {
			static::make($name);
		}
		return static::$instances[$name];
	}
427122
public static function getInstance()
	{
		if ( is_null( self::$instance ) )
		{
			self::$instance = new self();
			self::$instance->types = XBRL_Types::getInstance();
		}
		return self::$instance;
	}
424487
public static function getInstance(...$args)
    {
        $class = static::class;

        if (empty(static::$instances[$class])) {
            static::$instances[$class] = Ioc::getContainer()->newInstance($class, ...$args);
        }

        return static::$instances[$class];
    }
55153
public static function getInstance($type)
    {
        if (!isset(self::$_instances[$type])) {
            static $config;
            if (!isset($config)) $config = Kwf_Registry::get('config')->caches->toArray();
            if (!isset($config[$type])) {
                throw new Kwf_Exception("unknown type '$type'");
            }
            $cls = $config[$type];
            self::$_instances[$type] = new $cls();
        }
        return self::$_instances[$type];
    }
495851
public final static function instance($type = null) {
        global $PAGE;

        if ($type == null) {
            if (!empty(self::$instance)) {
                return self::$instance;
            }
            $type = $PAGE->theme->get_icon_system();
            self::$instance = new $type();
            // Default one is a singleton.
            return self::$instance;
        } else {
            // Not a singleton.
            return new $type();
        }
    }
739487
private static function getInstance()
    {
        if (self::$_instance == null) {
            self::$_instance = new Fabricate();
            self::$_instance->config = new FabricateConfig();
            self::$_instance->registry = new FabricateRegistry('Fabricate', null);
            self::$_instance->traits = [];
        }
        return self::$_instance;
    }
418661
protected function doMethodConfiguration($instance, stdClass $prototype)
    {
        foreach ($prototype as $method => $args) {
            call_user_func_array([$instance, $method], $args);
        }

        return $instance;
    }
331096
public static function GetInstance() : Translator
   {

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

      return self::$_instance;

   }
651729
public function setInstance($instance = 'default')
    {
        $this->get($instance);

        $this->session->put($this->prefix.'.instance', $instance);

        if (!in_array($instance, $this->getInstances())) {
            $this->session->push($this->prefix.'.instances', $instance);
        }
        $this->events->dispatch('laracart.new');

        return $this;
    }
1027585
public static function getInstance( array $aliases = [] )
	{
		if( is_null( static::$instance )) {
			return static::$instance = new static( $aliases );
		}

		$aliases = array_merge( static::$instance->aliases, $aliases );

		static::$instance->aliases = $aliases;

		return static::$instance;
	}
899689
public static function getInstance(string $name = 'default'): self
    {
        if (!isset(self::$instances[$name])) {
            self::setInstance($name, new self());
        }

        return self::$instances[$name];
    }
762347
public function buildObject($instance = null)
    {
        if (is_null($instance)) {
            return (object) $this->fields;
        }
        foreach ($this->fields as $property => $value) {
            $method = 'set' . ucwords($property);
            if (is_callable([$instance, $method])) {
                $instance->{$method}($value);
            }
        }
    }
1102665
public static function getInstance( $name )
    {
        if (! isset( self::$instances[$name] ) )
            self::$instances[$name] = new self( $name );

        return self::$instances[$name];
    }