Resolve singularity instance from the class name.

@param  string $class

@return void
183777
public function resolveSingularity($singularity)
    {
        $class = $this->app->make($singularity);

        $this->app->instance($singularity, $class->make($this->app));
    }
1137156
public function Identify($name, $class)
    {
        $method = 'make'.lcfirst($name);
        if(method_exists($this, $method))
            $this->{$name}($class);
    }
21263
public function loadClass( $class ) {

		if ( ! isset( $this->class_map[ $class ] ) )
			return FALSE;

		return $this->loader->loadFile( $this->class_map[ $class ] );
	}
709122
public static function initializeClass($class)
    {
        try
        {
            // Get a static method named 'initialize'. If not found,
            // ReflectionMethod() will throw a ReflectionException.
            $ref = new \ReflectionMethod($class, 'initialize');

            // The 'initialize' method is probably 'private'.
            // Make it accessible before calling 'invoke'.
            // Note that 'setAccessible' is not available
            // before PHP version 5.3.2.
            $ref->setAccessible(true);

            // Execute the 'initialize' method.
            $ref->invoke(null);
        }
        catch (Exception $e)
        {
        }
    }
81585
public function autoload($class)
    {
        if (!static::$initialized) {
            $this->initialize();
            if ($this->classExists($class)) {
                return TRUE;
            }
        }
        if (\Staq\Util::isStack($class)) {
            $this->loadStackClass($class);
        } else if (\Staq\Util::isParentStack($class)) {
            $this->loadStackParentClass($class);
        }
    }
1246662
protected function loadInstanceFromClass($class) {
        $arguments = $this->getConfiguration() [ AbstractFileConfiguration::SERVICE_INIT_ARGUMENTS ] ?? NULL;
        $config = $this->getConfiguration() [ AbstractFileConfiguration::SERVICE_INIT_CONFIGURATION ] ?? NULL;

        $this->instance = $this->serviceManager->makeServiceInstance($class, $arguments, $config);
    }
423347
private function resolveResource($class)
    {
        if (array_key_exists($class, $this->cache)) {
            return $this->cache[$class];
        }

        $found = null;

        foreach ($this->resourceRegistry as $resource) {
            if ($resource->getModel() === $class) {
                $found = $resource;

                break;
            }
        }

        return $this->cache[$class] = $found;
    }
719023
public function loadClass(string $class)
    {
        if (strpos($class, 'Proxy\__Transactional__\\') !== 0) {
            return null;
        }

        if ($file = $this->findProxyFile($class)) {
            require_once $file;

            return true;
        }

        return null;
    }
467135
public function removeClass(?string $class): void
  {
    // If class is empty or no classes are set return immediately.
    if ($class===null || $class==='' || !isset($this->attributes['class'])) return;

    // Remove the class from the list of classes.
    $this->attributes['class'] = implode(' ', array_diff(explode(' ', $this->attributes['class']), [$class]));
  }
642408
public function loadClass($class)
    {
        if (strpos($class, self::ANNOTATION_NAMESPACE) === 0) {
            $class = str_replace(self::ANNOTATION_NAMESPACE, '', $class);

            $file = __DIR__ . '/' . $class . '.php';
            if (file_exists($file)) {
                require_once $file;

                return true;
            }
        }
    }
141023
public function getNewInstance($class) {
		if (isset($this->aliases[$class])) {
			$class = $this->aliases[$class];
		}

		$args = $this->resolveArgs($class, '__construct', " when constructing $class");
		if ($args) {
			$instance = new $class(...$args);
		} else {
			$instance = new $class;
		}

		return $instance;
	}
203065
public function isSingleton(string $class): bool
	{
		$class = $this->resolveAlias($class);

		return isset($this->instances[$class]) || (isset($this->hints[$class]) && $this->hints[$class]['singleton'] === true);
	}
753818
public function removeClass($class)
    {
        if (isset($this->attr['class'])) {
            $classes = explode(' ', $this->attr['class']);
            if (in_array($class, $classes)) {
                $classes = array_diff($classes, [$class]);
            }

            if (empty($classes)) {
                unset($this->attr['class']);
            } else {
                $this->attr['class'] = implode(' ', $classes);
            }
        }
    }
1118012
static public function from($class)
        {
            if (is_object($class)) {
                $class = get_class($class);
            }

            if (empty(self::$prototypes[$class])) {
                self::$prototypes[$class] = new static($class);
            }

            return self::$prototypes[$class];
        }
1081173
public function instantiate( $class ) {
		$this->verifyBootstrap();

		$instance = $this->resolve( $class );

		if ( $instance === null ) {
			if ( ! class_exists( $class ) ) {
				throw new ClassNotFoundException( 'Class not found: ' . $class );
			}

			$instance = new $class();
		}

		return $instance;
	}
887621
public static function loadAliases($class)
	{
		$aliases = static::$aliases;

		if (array_key_exists($class, $aliases))
		{
			return class_alias($aliases[$class], $class);
		}

		// Allow calling facade in namespaced class 
		// without resetting to the root namespace
		$classPieces = explode('\\', $class);
		$classAlt    = array_pop($classPieces);
		if (array_key_exists($classAlt, $aliases))
		{
			return class_alias($aliases[$classAlt], $class);
		}
	}
117982
private function doResolveClass($class)
    {
        foreach ($this->map as $mapClass => $value) {
            if (!$value) {
                continue;
            }

            if ($class === $mapClass || is_subclass_of($class, $mapClass)) {
                return $value;
            }
        }

        return false;
    }