Validates if the given class is a valid console controller class.
@param string $controllerClass
@return bool
965085
protected function validateControllerClass($controllerClass)
    {
        if (class_exists($controllerClass)) {
            $class = new \ReflectionClass($controllerClass);
            return !$class->isAbstract() && $class->isSubclassOf(Controller::class);
        }

        return false;
    }
544642
public function isValid(string $returnTypeClass, $instance): bool
    {
        if (array_key_exists($returnTypeClass, $this->getRequiredFields()) === false) {
            return false;
        }
        foreach ($this->getRequiredFields()[$returnTypeClass] as $property) {
            if (is_array($instance)) {
                foreach ($instance as $item) {
                    if ($item->{$property} === null) {
                        return false;
                    }
                }
            } elseif ($instance->{$property} === null) {
                return false;
            }
        }
        return true;
    }
646193
public function isValidListener(FilterControllerEvent $event)
    {
        $controller = $event->getController();
        if (!is_array($controller)) {
            return false;
        }

        $controller = $controller[0];
        if (!$controller instanceof ConfigurationAwareInterface) {
            return false;
        }

        $this->controller = $controller;

        return true;
    }
240545
private function shouldBeController($className) : bool
    {
        if (strpos($className, 'Controller') !== false) {
            return true;
        }

        $reflectionClass = new \ReflectionClass($className);
        $file = $reflectionClass->getFileName();

        $content = file_get_contents($file);

        if (strpos($content, '@URL') !== false) {
            return true;
        }
        return false;
    }
15621
private function validatePluginClass($pluginClass)
    {
        if (!class_exists($pluginClass)) {
            throw new InvalidConfigException(sprintf(
                'The plugin class %s does not exist.',
                $pluginClass
            ));
        }

        if (!in_array('Puli\Manager\Api\PuliPlugin', class_implements($pluginClass))) {
            throw new InvalidConfigException(sprintf(
                'The plugin class %s must implement PuliPlugin.',
                $pluginClass
            ));
        }
    }
39276
private function isValidObjectClass($className)
    {
        //====================================================================//
        // Safety Check => Object Type is String
        if (!is_string($className)) {
            return "Object Type is Not a String";
        }
        //====================================================================//
        // Safety Check => Class Exists
        if (!class_exists($className)) {
            return "Object Class Not Found";
        }
        //====================================================================//
        // Safety Check => Class Extends
        if (!is_subclass_of($className, AbstractObject::class)) {
            return "Object Class MUST extends ".AbstractObject::class;
        }

        return true;
    }
68970
public function hasClassProperty($class)
    {
        if (! is_array($class)) {
            $class = func_get_args();
        }

        if (isset($this->htmlAttributes['class']) && is_array($this->htmlAttributes['class'])) {
            foreach ($this->htmlAttributes['class'] as $i => $string) {
                foreach ($class as $className) {
                    if (strpos($string, $className) !== false) {
                        return true;
                    }
                }
            }
        }

        return false;
    }
423793
protected function hasControllerAnnotation(\ReflectionFunctionAbstract $controller, string $annotationClass) : bool
    {
        return $this->getControllerAnnotation($controller, $annotationClass) !== null;
    }
233034
private function getServiceFromFolder($controllerClass)
    {
        foreach ($this->get(self::KEY_FOLDERS) as $folder) {
            $path = $this->findFileInFolderRecursively($controllerClass.'.php', $folder);
            if (false !== $path) {
                require_once $path;
                return new $controllerClass();
            }
        }
        throw new Exception('Controller class '.$controllerClass.' not found in any listed folder.');
    }
38477
public static function registerModulesClass(string $class): bool
    {
        if (class_exists($class) === false) {
            return false;
        }
        $check = new ReflectionClass($class);
        if ($check->implementsInterface("TheCMSThread\\Classes\\Modules") === true) {
            self::$modules_class = $class;
            return true;
        } else {
            return false;
        }
    }
1293680
protected function hasNodeParser(string $class): bool
    {
        if (Validator::key($class, Validator::instance(NodeParserInterface::class))
            ->validate($this->nodeParsers)) {
            return true;
        }
        return false;
    }
1060604
protected function isValidApplicationClass(string $className): bool
    {
        $reflectionClass = new ReflectionClass($className);

        return
            $reflectionClass->isInstantiable() === true &&
            $reflectionClass->implementsInterface(ApplicationInterface::class) === true;
    }
834364
public static function registerCoreClass(string $class): bool
    {
        if (class_exists($class) === false) {
            return false;
        }
        $check = new ReflectionClass($class);
        if ($check->implementsInterface("TheCMSThread\\Classes\\Core") === true) {
            self::$core_class = $class;
            return true;
        } else {
            return false;
        }
    }
200354
public function hasClass($class)
    {
        $classes = explode(' ', strtolower($this->extraClass()));
        return in_array(strtolower(trim($class)), $classes);
    }
319495
protected function instantiateController($class)
    {
        $controller = parent::instantiateController($class);

        if ($controller instanceof ServiceLocatorAwareInterface) {
            $controller->setServiceLocator($this->serviceManager);
        }

        if($controller instanceof ContainerAwareInterface) {
            $controller->setContainer($this->serviceManager->get('SymfonyContainer'));
        }

        return $controller;
    }
773286
public static function validateControllerClassBasename($controllerClassBasename)
    {
        $controllerClassBasename = str_replace('/', '\\', $controllerClassBasename);

        if (false !== strpos($controllerClassBasename, ':')) {
            throw new \InvalidArgumentException(sprintf(
                'The controller class name must not contain a ":" (colon sign) ("%s" given, '
                .'expecting something like PostAdminController")',
                $controllerClassBasename
            ));
        }

        if ('Controller' !== substr($controllerClassBasename, -10)) {
            throw new \InvalidArgumentException('The controller class name must end with "Controller".');
        }

        return $controllerClassBasename;
    }
1338440
public function setClass($pClass)
    {
        if (is_string($pClass)) {
            $this->createControllerClass($pClass);
        } elseif (is_object($pClass)) {
            $this->controller = $pClass;
        } else {
            $this->controller = $this;
        }
    }