Perform detection based on class name and routes registered for this class.

@param string $className

@return ClassDetection|null
439202
private function doDetectByRoutes($className)
    {
        //If we have entry for a command class, we should always return it, as it is most specific.
        if (!empty($this->simpleRoutes[$className])) {
            return new ClassDetection($this->simpleRoutes[$className]);
        }
        //Now, we should check, if we have 'regexp' entry for class
        foreach ($this->regexpRoutes as $regexpRoute => $poolName) {
            if (preg_match($regexpRoute, $className)) {
                return new ClassDetection($poolName);
            }
        }
    }
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');
    }
242539
public function getInstance($className)
    {
        switch ($className) {
            case '\\Zepi\\Web\\UserInterface\\Frontend\\FrontendHelper':
                return $this->framework->initiateObject($className, array(), true);
            break;
            
            default: 
                return $this->framework->initiateObject($className);
            break;
        }
    }
1283888
public function hasClass($className)
    {
        foreach ($this->meta['classes'] as $classInMeta) {
            if ($classInMeta === $className) {
                return true;
            }
        }

        return false;
    }
328410
public function getInstance($className)
    {
        switch ($className) {
            case '\\Zepi\\Api\\Rest\\Helper\\FrontendHelper':
                if ($this->frontendHelper === null) {
                    $this->frontendHelper = $this->framework->initiateObject($className);
                }
            
                return $this->frontendHelper;
            break;

            default: 
                return $this->framework->initiateObject($className);
            break;
        }
    }
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;
    }
984576
public function getMethodDeprecation($methodName, $className)
    {
        return $this->hasMethodDeprecation($methodName, $className)
            ? $this->methodDeprecations[$className][$methodName]
            : null;
    }
1216977
public static function getMailerClassName($className)
    {
        if (class_exists($className)) {
            return $className;
        }

        // replace underscores with namespace marker, PSR-0 style
        $fullyQualified = '\\Omnimail\\' . str_replace('_', '\\', $className);
        if (!class_exists($fullyQualified)) {
            $fullyQualified = $fullyQualified . '\\Mailer';
            if (!class_exists($fullyQualified)) {
                throw new \Exception("Class '${className}' not found");
            }
        }

        return $fullyQualified;
    }
1206213
public function loadClass($className)
    {
        $className = ltrim($className, '\\');

        $namespaceParts = explode('\\', $className);
        // Workaround for Doctrine's annotation parser which does a class_exists() for annotations like "@param" and so on:
        if (isset($this->ignoredClassNames[$className]) || isset($this->ignoredClassNames[end($namespaceParts)])) {
            return false;
        }

        // Loads any known proxied class:
        if ($this->classesCache !== null && ($this->availableProxyClasses === null || isset($this->availableProxyClasses[implode('_', $namespaceParts)])) && $this->classesCache->requireOnce(implode('_', $namespaceParts)) !== false) {
            return true;
        }

        return false;
    }
633236
public function reflectClassLike($className): ReflectionClassLike
    {
        $className = ClassName::fromUnknown($className);

        $source = $this->sourceLocator->locate($className);
        $classes = $this->reflectClassesIn($source);

        if (false === $classes->has((string) $className)) {
            throw new ClassNotFound(sprintf(
                'Unable to locate class "%s"',
                $className->full()
            ));
        }

        $class = $classes->get((string) $className);

        return $class;
    }
832180
public function loadClass($className)
    {
        if ($filePath = $this->resolveFileName($className)) {
            if ($this->getFailureFlag() & self::FAIL_GRACEFULLY) {
                if ($this->classFileExists($filePath)) {
                    require_once $filePath;
                }
            } else {
                require_once $filePath;
            }
        }
    }
162990
protected function getCompatibleClass( $className )
  {
    if( ! $className || ! is_string( $className )){
      $className = get_class( $this );
    }
    $class = $className;

    if( ! $this->checkClassForCompability( $class )){
      $class = $this->checkClassForCompability( $class .'Exception' );
    }

    if( ! $class ) {
      if( $parent = get_parent_class( $className ) ) {
        $class = $this->getCompatibleClass( $parent );
      } else {
        $class = __NAMESPACE__ .'\DeferredExceptionsException';
      }
    }

    return $class;
  }
684235
public static function getClassName($className) {
    if (is_object($className)) $className = self::getClass($className);
    
    $c = $className;
    if (mb_strpos($className,'\\') !== FALSE) {
      $p = explode('\\',$className);
      $c = array_pop($p);
    }
    return $c;
  }
831738
private function extractActionFromClass(string $className)
    {
        // If class contain method name
        if (strpos($className, ':') !== false) {
            $classArray = explode(':', $className);
            $classAction = end($classArray);
        } else {
            $classAction = null;
        }
        return $classAction;
    }
969143
public function hasClass($className)
    {
        if ($this->hasAttribute('class')) {
            return in_array($className, preg_split('/\s+/', $this->getAttribute('class')));
        }

        return false;
    }
762612
public static function getTypeIdByClass($className)
    {
        if (null === self::$typesByClass) {
            self::$typesByClass = array_flip(self::$types);
        }

        if (!isset(self::$typesByClass[$className])) {
            throw new UnknownMessageException('Class not registered: '.$className.'.');
        }

        return self::$typesByClass[$className];
    }
1036858
private function readMapping($className)
    {
        $file = $this->getMappingFile($className);

        return $file ? $this->parse($file) : null;
    }