Perform detection based on class interfaces.

@param string $className

@return DetectionInterface|null
427410
private function doDetectByInterfaces($className)
    {
        $interfaces = $this->getOrderedInterfaces($className);
        foreach ($interfaces as $interface) {
            $candidate = $this->doDetectByRoutes($interface);
            if ($candidate) {
                return $candidate;
            }
        }

        return;
    }
1016716
public function find($className)
    {
        if (empty($className)) {
            return BaseMock::class;
        }

        /** @var ClassReflection[] $result */
        $result = [];
        foreach ($this->_classes as $class) {
            if ($class->matchClassName($className)) {
                $result[] = $class;
            }
        }
        $result = SortUtils::sortReflections($result);

        if (count($result)) {
            return $result[0]->getName();
        }
        return BaseMock::class;
    }
284414
public function getUrlByClassName($className)
    {
        if (is_object($className)) $className = get_class($className);
        if (isset($this->known[$className]['config']['mount'])) {
            return $this->known[$className]['config']['mount'];
        } else {
            return null;
        }
    }
787163
public final function get($className, CacheInterface $cache = null)
   {
       try {
           return $this->resolve($className, $cache);
       } catch (NotFoundException $e) {
           throw $e;
       } catch (ContainerException $e) {
           throw $e;
       }
   }
72131
public static function classImplements($className, $interfaceName)
    {
        $lowerClassName = strtolower($className);
        $implementors = self::implementorsOf($interfaceName);
        return isset($implementors[$lowerClassName]);
    }
1275663
public function getTagByClassName($className)
    {
        if (is_object($className)) $className = get_class($className);
        if (isset($this->known[$className]['tagName'])) {
            return $this->known[$className]['tagName'];
        } else {
            return null;
        }
    }
438016
protected function getClassShortName(?string $className = null): string
	{
		$class = $className ?? static::class;

		$pos = strrpos($class, '\\');

		if($pos === false)
		{
			return $class;
		}

		return substr($class, $pos + 1);
	}
75797
public function resolve($classname)
    {
        // Resolve from container if possible
        if ($this->container->has($classname)) {
            return $this->container->get($classname);
        }

        // Add namespace prefix
        $class = '\\' . $classname;

        // Create class
        $object = new $class();

        // If class needs container inject it
        if ($object instanceof ContainerAwareInterface) {
            $object->setContainer($this->container);
        }
        return $object;
    }
1076873
public function getByClassname(string $classname)
    {
        foreach ($this->container as $value) {
            if (is_object($value) && $value instanceof $classname) {
                return $value;
            }
        }

        return null;
    }
939493
public static function getByClassName($className)
    {
        $bind = self::getInstance()->bind;

        foreach ($bind as $abstract => $abstractClassName) {
            if ($className == $abstractClassName) {
                return self::get($abstract);
            }
        }

        throw new ContainerException('Cannot find "' . $className . '" in container');
    }
349907
public function handlerIdByClassName($className)
    {
        foreach ($this->handlers() as $id => $class) {
            if ($class->className() === $className) {
                return $id;
            }
        }

        throw new Exception("Handler with classname {$className} not found.");
    }
964699
public function hasInterfaceUsageByClass($className)
    {
        if (!isset($this->interfaceUsages[$className])) {
            return false;
        }

        return count($this->interfaceUsages[$className]) > 0;
    }
777368
public function loadClass($className)
	{
		if (class_exists($className, false) || interface_exists($className, false))
		{
			return false;
		}

		if($classFile = $this->classFile($className))
		{
			require $classFile;
			return true;
		}

		return false;
	}
1367030
public function get($className) {
		try {
			return $this->container->get($className);
		} catch (ContainerException $e) {
			throw ExceptionHelper::buildException($e, '\\Ioc\\Exceptions\\DefinitionNotFoundException');
		} catch (Exception $e) {
			throw ExceptionHelper::buildException($e, '\\Exception');
		}
	}
1371822
public function getInstance($className)
    {
        switch ($className) {
            case '\\Zepi\\Api\\AccessControl\\Manager\\TokenManager':
                if ($this->tokenManager === null) {
                    $this->tokenManager = $this->framework->initiateObject($className);
                }
                
                return $this->tokenManager;
            break;
            
            default: 
                return $this->framework->initiateObject($className);
            break;
        }
    }
1132570
public function isTransient($className)
    {
        return
            !$this->mappers->hasMapperFor($className) ||
            $this->mappers->getMapperFor($className)->isTransient();
    }
1204356
private function findTraced($className = null)
    {
        $traces     = debug_backtrace();
        $reflection = new ReflectionClass($className);
        $filename   = $reflection->getFileName();
        $traced     = null;


        foreach ($traces as $trace) {
            if (isset($trace['file']) and $filename == $trace['file']) {
                $traced = $trace;
                break;
            }
        }
        return $traced;
    }