Returns the class to throw exception

@param string $className The desired class to use
@return string
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;
  }
81084
public function getMetadataForClass($className)
    {
        if (!class_exists($className)) {
            throw new \Exception("Class $className does not exist!");
        }
        if (isset($this->loadedMetadatas[$className])) {
            return $this->loadedMetadatas[$className];
        }

        return $this->loadedMetadatas[$className] = $this->loadMetadataForClass($className, $this->annotationReader);
    }
889375
public function loadClass($className) {
        $classFound = $this->composerClassLoader->loadClass($className);
        if (!$classFound && !$this->caseSensitiveClassLoading) {
            $classFound = $this->composerClassLoader->loadClass(strtolower($className));
        }
        return $classFound;
    }
229628
public function getTableClass($className) {
        $tableClass= null;
        if ($className= $this->loadClass($className)) {
            if (isset ($this->map[$className]['table'])) {
                $tableClass= $className;
            }
            if (!$tableClass && $ancestry= $this->getAncestry($className, false)) {
                foreach ($ancestry as $ancestor) {
                    if (isset ($this->map[$ancestor]['table'])) {
                        $tableClass= $ancestor;
                        break;
                    }
                }
            }
        }
        if ($tableClass) {
            if ($this->getDebug() === true) {
                $this->log(xPDO::LOG_LEVEL_DEBUG, 'Returning table class: ' . $tableClass . ' for class: ' . $className);
            }
        } else {
            $this->log(xPDO::LOG_LEVEL_ERROR, 'Could not get table class for class: ' . $className);
        }
        return $tableClass;
    }
1046034
public static function getConfigFromDomainClass($className) {
		$definition = ClassHelper::normalizeComponentConfig($className);
		/** @var Domain $domain */
		$domain = Yii::createObject($definition);
		$config = $domain->config();
		return $config;
	}
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;
    }
477887
protected function getClassName($className = null)
    {
        $parts = explode('\\', $className ?: $this->className);

        return $parts[count($parts) - 1];
    }
315579
public function removeClass($classname)
    {
        $classArr = array_diff($this->getClassArray(), [$classname]);
        return $this->setClassArray($classArr);
    }
79005
public function loadClass ($className)
    {
        // Run the parser only for the first time
        if (!$this->nsDataPopulated) {
            $this->nsDataPopulated = true;
            $this->parseComposerJsonFiles();
        }

        // Check all namespaces
        foreach ($this->nsData as $ns => $nsData) {

            // Skip non-matching namespaces
            $nsRegex = "@^". str_replace("\\", "[\\\\\\\\]", $ns) ."(.+)$@";
            if (!preg_match($nsRegex, $className, $m)) {
                continue;
            }
            $classNameWithoutNs = $m[1];

            $filePathWithoutNs  = str_replace("\\", "/", $classNameWithoutNs);
            $filePathFull       = $nsData['absPath'] .'/'. $filePathWithoutNs .'.php';

            if (file_exists($filePathFull)) {
                require_once $filePathFull;
                if (!class_exists($className, false) && !interface_exists($className, false) && !trait_exists($className, false)) {
                    throw new \Exception("Class '$className' not found in file '$filePathFull', this is probably a bug.");
                    return false;
                }
                return true;
            }
        }

        // File not encountered
        return false;
    }
441476
public function getObjectManagerNameByClassName($className)
    {
        $realClass = ClassUtils::getRealClass($className);
        if (false === $this->hasObjectManagerNameByClassName($realClass)) {
            $errMsg = sprintf('Failed to get the manager\'s name for class %s', $realClass);
            throw new Exception\ErrorBuildObjectManagerNameException($errMsg);
        }

        return $this->classNameToObjectManagerName[$realClass];
    }
58410
public static function getClassName($className)
    {
        if (is_object($className)) {
            $className = get_class($className);
        }
        $className = array_slice(explode('\\', $className), - 1);
        return $className[0];
    }
461238
public static function getInstance($className = '')
    {
        if ($className !== '') {
            try {
                $ref = new \ReflectionClass($className);
                if ($ref->isSubclassOf('\MehrAlsNix\Notifier\Notification')) {
                    self::$instance = $ref->newInstance();
                }
            } catch (\ReflectionException $re) {
                throw new \RuntimeException($re->getMessage());
            }
        } elseif (!self::$instance instanceof Notification) {
            self::$instance = self::fetch();
        }

        return self::$instance;
    }
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);
	}
1180844
protected function getReflectionClass($className) {
		if (isset($this->reflectionClasses[$className])) {
			return $this->reflectionClasses[$className];
		}

		try {
			$reflectionClass = new ReflectionClass($className);
		} catch (ReflectionException $e) {
			throw new NotFoundException("Class $className is not found");
		}

		if (!$reflectionClass->isInstantiable()) {
			throw new NotInstantiableException("$className is not an instantiable class");
		}

		$this->reflectionClasses[$className] = $reflectionClass;

		return $reflectionClass;
	}
1319500
public static function getShortClassname($classname)
    {
        if (is_array($classname)) {
            return  array_map(['BackBee\ClassContent\AbstractContent', 'getShortClassname'], $classname);
        }

        if (in_array($classname, ['scalar', 'array'])) {
            return $classname;
        }

        $isExcluded = self::isExcludedClassname($classname);

        try {
            if (!is_subclass_of($classname, 'BackBee\ClassContent\AbstractClassContent')) {
                throw new ClassNotFoundException();
            }
        } catch (ClassNotFoundException $ex) {
            return self::onUnknownClassname(
                sprintf('Given classname %s is not a subclass of AbstractClassContent.', $classname),
                $ex
            );
        }

        return ($isExcluded ? '!' : '').str_replace(self::CLASSCONTENT_BASE_NAMESPACE, '', $classname);
    }
737639
public function getCommandLastExceptionClassName()
    {
        $exception = $this->command->getLastException();

        if (!is_null($exception)) {
            return get_class($exception);
        }

        return null;
    }
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;
        }
    }