Validate Widget Class Name

@param mixed $className

@return string|true
163671
private function isValidWidgetClass($className)
    {
        //====================================================================//
        // Safety Check => Widget Type is String
        if (!is_string($className)) {
            return "Widget Type is Not a String";
        }
        //====================================================================//
        // Safety Check => Class Exists
        if (!class_exists($className)) {
            return "Widget Class Not Found";
        }
        //====================================================================//
        // Safety Check => Class Extends
        if (!is_subclass_of($className, AbstractWidget::class)) {
            return "Widget Class MUST extends ".AbstractWidget::class;
        }

        return true;
    }
1115166
private function extractClass(string $className): string
    {
        // If class name contain ":" symbol
        if (strpos($className, ':') !== false) {
            $classArray = explode(':', $className);
            $className = $classArray[0];
        }
        return $className;
    }
1104655
protected function checkClassUsesParentsTrait($className)
    {
        $flag = false;
        $classes = array_merge([$className], class_parents($className));

        foreach ($classes as $class) {
            $traits = class_uses($class);
            $flag = $flag || (true === isset($traits[ParentsTrait::class]));
        }

        return $flag;
    }
189626
public function supports($className)
    {
        return (strpos($className, ucfirst($this->classSuffix)) === strlen($className) - strlen($this->classSuffix));
    }
1341405
public function classname($classname = null)
    {
        if ($classname === null) {
            return $this->classname;
        }

        $this->classname = $classname;
    }
58410
public static function getClassName($className)
    {
        if (is_object($className)) {
            $className = get_class($className);
        }
        $className = array_slice(explode('\\', $className), - 1);
        return $className[0];
    }
835766
public function getClassDefinition($className)
    {
        foreach ($this->definitions as $key => $value) {
            if (!strcasecmp($key, $className)) {
                return $value;
            }
        }

        return false;
    }
477887
protected function getClassName($className = null)
    {
        $parts = explode('\\', $className ?: $this->className);

        return $parts[count($parts) - 1];
    }
172424
public function getClassMetadata($className)
    {
        if (!$this->initialized) {
            $this->initialize();
        }
        if (array_key_exists($className, $this->metadata)) {
            return $this->metadata[$className];
        }

        return false;
    }
1011232
protected static function getClassName($className) {
		if (class_exists($className)) {
			while (class_exists('ux_' . $className, FALSE)) {
				$className = 'ux_' . $className;
			}
		}

		return $className;
	}
114535
public static function isLoaded($className)
    {
        return (class_exists($className, false)
            || interface_exists($className, false)
            || (function_exists('trait_exists') && trait_exists($className, false)));
    }
969143
public function hasClass($className)
    {
        if ($this->hasAttribute('class')) {
            return in_array($className, preg_split('/\s+/', $this->getAttribute('class')));
        }

        return false;
    }
315579
public function removeClass($classname)
    {
        $classArr = array_diff($this->getClassArray(), [$classname]);
        return $this->setClassArray($classArr);
    }
577794
public function autoDetectModuleNameByClassName($className)
    {
        if (array_key_exists($className, $this->classNameToModuleName)) {
            $resultModuleName =  $this->classNameToModuleName[$className];
        } else {
            $index = $this->getModulesIndex();
            $classNameLength = strlen($className);

            $resultModuleName = null;
            foreach ($index as $moduleName => $moduleNameLength) {
                if ($classNameLength > $moduleNameLength && 0 === strrpos($className, $moduleName)) {
                    $resultModuleName = $moduleName;
                    break;
                }
            }
            $this->classNameToModuleName[$className] = $resultModuleName;
        }

        return $resultModuleName;
    }
332519
public function load(string $className): bool
   {
       if (($fileName = $this->fileName($className))) {
           require $fileName;
           return true;
       } 
       return false;
   }
467099
public static function getClassBaseName($className): string
    {
        $className = ToString::toString($className);
        if (\preg_match('~\\\(?<basename>[^\\\]+)$~u', $className, $matches) === 0) {
            return $className; // no namespace at all
        }

        return $matches['basename']; // without namespace
    }
947406
public function isValidConfigurator($className)
    {
        //====================================================================//
        // Verify Class Exists
        if (false == class_exists($className)) {
            return Splash::log()->err('Configurator Class Not Found: '.$className);
        }

        //====================================================================//
        // Verify Configurator Class Extends ConfiguratorInterface
        try {
            $class = new $className();
            if (!($class instanceof ConfiguratorInterface)) {
                return Splash::log()->err(Splash::trans('ErrLocalInterface', $className, ConfiguratorInterface::class));
            }
        } catch (Exception $exc) {
            echo $exc->getMessage();

            return Splash::log()->err($exc->getMessage());
        }

        return true;
    }