This function uses woodoo magic to resolve package class name

@param string $name
@throws \Exception
@return string
438560
public function resolvePackage($name)
	{
		$packages = $this->getPackages();

		//most commonly we have Foobar or SupraPackageFoobar, which maps directly to package class
		//the other options is "foobar", which is mapped to AbstractPackage::getName
		foreach ($packages as $instance) {
			$class = get_class($instance);
			$classParts = explode('\\', $class);
			$className = $classParts[count($classParts) - 1];

			if ($name == $className || 'SupraPackage' . $name == $className) {
				return $class;
			}

			if ($name == $instance->getName()) {
				return $class;
			}
		}

		throw new \Exception(sprintf('Package "%s" can not be resolved', $name));
	}
694857
function &classNamed($name)
    {
        $class = NULL;
        $pos = strrpos($name, '\\');
        if ($pos != FALSE) {
            $package = substr($name, 0, $pos);
            $name = substr($name, $pos + 1);
        }
        if (isset($package)) {
            if (isset($this->_packages[$package])) {
                $class =& $this->_packages[$package]->findClass($name);
            }
        } else {
            $packages = $this->_packages; // we do this copy so as not to upset the internal pointer of the array outside this scope
            foreach ($packages as $packageName => $package) {
                $class =& $package->findClass($name);
                if ($class != NULL) break;
            }
        }

        return $class;
    }
1370402
public function getPackage($name = null)
    {
        $key = 'package.' . strtolower($name);

        if ($this->container->exists($key)) {
            return $this->container->get($key);
        }

        return null;
    }
291293
protected function resolve($name)
    {
        try {
            return parent::resolve($name);
        } catch (Exception $e) {
            if ($newDriver = $this->nextDriver($name)) {
                return $this->resolve($newDriver);
            }
            throw $e;
        }
    }
976303
protected function getManipulatorClass(string $name): string
    {
        if (!isset($this->manipulatorMap[$name])) {
            throw new Exception("Unknown manipulator name: {$name}.");
        }

        return $this->manipulatorMap[$name];
    }
727791
private function getCommandClassName($name)
    {
        $name = mb_convert_case($name[0], MB_CASE_UPPER, 'utf-8') . mb_substr($name, 1, mb_strlen($name));
        
        $drivername = $this->getDriverName();
        $classnameLocal = sprintf('\Intervention\Image\%s\Commands\%sCommand', $drivername, ucfirst($name));
        $classnameGlobal = sprintf('\Intervention\Image\Commands\%sCommand', ucfirst($name));

        if (class_exists($classnameLocal)) {
            return $classnameLocal;
        } elseif (class_exists($classnameGlobal)) {
            return $classnameGlobal;
        }

        throw new \Intervention\Image\Exception\NotSupportedException(
            "Command ({$name}) is not available for driver ({$drivername})."
        );
    }
433270
private function getTypeName($name)
    {
        if (!$name) {
            return null;
        }

        if (is_string($name)) {
            return $name;
        }

        $prefix = '';
        if ($name instanceof NullableType) {
            $name   = $name->type;
            $prefix = '?';
        }

        return $prefix . $this->getFullClassName($name);
    }
398402
protected function resolve($name)
    {
        if (strpos($name, '\\') === false) {

            if (strpos($name, '/') === false) {
                $app = '';
            } else {
                list($app, $name) = explode('/', $name, 2);
            }

            $name = ($this->app->config->get('app.app_namespace') ?: 'app\\') . ($app ? strtolower($app) . '\\' : '') . 'job\\' . $name;
        }

        return $this->app->make($name);
    }
829891
public function searchPackages($name)
    {
        try {
            $url = $this->config->getBasePackagesUrl() . 'search/' . $name;
            $response = $this->githubClient->getHttpClient()->get($url);

            return json_decode($response->getBody(true), true);
        } catch (RequestException $e) {
            throw new RuntimeException(sprintf('Cannot get package list from %s.', str_replace('/packages/', '', $this->config->getBasePackagesUrl())));
        }
    }
757988
public function findPackageAsset($name)
    {
        if (str_contains($name, '::'))
        {
            list($namespace, $name) = explode('::', $name);

            if ( ! isset($this->hints[$namespace]))
            {
                return;
            }

            $path = $this->prefixPublicPath('packages/'.$this->hints[$namespace].'/'.$name);

            if ($this->files->exists($path))
            {
                return $path;
            }
        }
    }
748559
protected function get($name)
    {
        if ($this->modified === null) {
            $this->load();
        }

        if (false === array_key_exists($name, $this->properties)) {
            throw new Exception('Unknown property "' . $name . '"');
        }

        return $this->resolve($this->properties[$name], $name);
    }
1273255
protected function resolveKey($name)
    {
        if (false !== $pos = strrpos($name, $this->namespaceCharacter)) {
            $name = substr($name, $pos + 1);
        }

        return $name;
    }
785312
protected function getEndpointClassName(string $name) : string {
        $className = sprintf(
            '%s\\%s',
            str_replace('Section', 'Endpoint', get_class($this)),
            ucfirst($name)
        );

        if (! class_exists($className)) {
            throw new \RuntimeException(
                sprintf(
                    'Invalid endpoint name "%s" (%s)',
                    $name,
                    $className
                )
            );
        }

        return $className;
    }
858975
protected static function resolveFacadeInstance($name)
    {
        if (is_object($name)) {
            return $name;
        }

        if (isset(static::$resolvedInstance[$name])) {
            return static::$resolvedInstance[$name];
        }

        return static::$resolvedInstance[$name] = Zilf::$container->getShare($name);
    }
639763
protected function package($name)
    {
        $package = $this->obtainPackage($name);

        if ($package == -1) {
            return;
        }

        list($name, $providers, $aliases, $after) = array_fill(0, 4, null);
        extract($package, EXTR_IF_EXISTS);

        $this->requireComposerPackage($name);

        if ($this->setupLaravelConfigFile($providers, $aliases) == -1) {
            return -1;
        }

        $this->executeScriptAfterPackageInstallation($after);
    }
1083423
protected function resolveUnknown(/*# string */ $name)
    {
        // warn if reference unknown
        $this->throwError(
            Message::get(Message::CONFIG_REFERENCE_UNKNOWN, $name),
            Message::CONFIG_REFERENCE_UNKNOWN
        );

        return null;
    }
156986
public function resolve(string $name, ?array $parameters = null)
    {
        if (isset($this->service[$name])) {
            return $this->service[$name];
        }

        if ($this->config->has($name)) {
            return $this->wrapService($name, $parameters);
        }

        if (null !== $this->parent_service) {
            $parents = array_merge([$name], class_implements($this->parent_service), class_parents($this->parent_service));

            if (in_array($name, $parents, true) && $this->parent_service instanceof $name) {
                return $this->parent_service;
            }
        }

        if (null !== $this->parent) {
            return $this->parent->resolve($name, $parameters);
        }

        throw new Exception\ServiceNotFound("service $name was not found in service tree");
    }