Verifies that provided $class exists

@param string $class Name of the class to verify
@param string $message Error message to display when class don't exists
8757
protected function classExists(string $class, string $message): void
    {
        if (!class_exists($class)) {
            $this->log($message, Project::MSG_ERR);
            throw new BuildException($message);
        }
    }
263923
public static function registerAdminClass(string $name, string $class): bool
    {
        if (class_exists($class) === false) {
            return false;
        }
        if (self::$admin_classes === null) {
            self::$admin_classes = [];
        }
        $check = new ReflectionClass($class);
        if ($check->implementsInterface("TheCMSThread\\Classes\\Admin") === true) {
            self::$admin_classes[$name] = $class;
            return true;
        } else {
            return false;
        }
    }
276758
static public function register($event, $method, $class = null)
    {
        if (!empty($class) && class_exists($class, false) && method_exists($class, $method)) {
            self::$callback[$event] = array($class, $method);
        } else {
            self::$callback[$event] = $method;
        }
    }
200709
public static function generateDeprecatedMessage($class, string $oldStuff, string $newStuff): void
    {
        if (is_object($class)) {
            $class = get_class($class);
        }

        user_error(sprintf('%1$s::%2$s is deprecated, use %1$s::%3$s instead!',
            $class, $oldStuff, $newStuff), E_USER_DEPRECATED);
    }
1345363
public static function checkImplement($class, string $interface){
            $ref = new \ReflectionClass($class);
            $names = $ref->getInterfaceNames();
            if(in_array($interface, $names)){
                return true;
            }else{
                return false;
            }
        }
1283242
public function message($message)
    {
        if(trim($message))
        {
            $msg = new stdClass();
            $msg->type = 'text';
            $msg->message = $message;
            $this->messages[] = $msg;
        }        
    }
1264348
protected static function classImplements(string $class, string $interface): bool
    {
        assert(class_exists($class));
        assert(interface_exists($interface));

        $implements = array_key_exists($interface, class_implements($class));

        return $implements;
    }
1158964
public function load( $class ) {

		foreach ( $this->rules as $rule )
			if ( $rule->loadClass( (string) $class ) )
				return TRUE;

		return FALSE;
	}
656937
public function setClass($class = '')
    {
        if (is_string($class) && (empty($class) === true || Format::isClass($class) === true)) {
            $class = trim($class);
            $this->class = $class;
        } else {
            $msg = "The 'class' argument must be a valid class name, '" . $class . "' given";
            throw new InvalidArgumentException($msg);
        }
    }
1334401
private static function isValidManager(ObjectManager $manager, $class)
    {
        $meta = $manager->getClassMetadata($class);

        return !$meta instanceof OrmClassMetadata || !$meta->isMappedSuperclass;
    }
705219
public function add_message($message, $class="notifyproblem", $align='center') {
        global $SESSION;

        if (empty($SESSION->lesson_messages) || !is_array($SESSION->lesson_messages)) {
            $SESSION->lesson_messages = array();
            $SESSION->lesson_messages[$this->properties->id] = array();
        } else if (!array_key_exists($this->properties->id, $SESSION->lesson_messages)) {
            $SESSION->lesson_messages[$this->properties->id] = array();
        }

        $SESSION->lesson_messages[$this->properties->id][] = array($message, $class, $align);

        return true;
    }
519995
public function isAccessibleFrom(string $class = null) : bool
    {
        switch ($this->accessibility) {
            case self::ACCESS_PUBLIC:
                return true;

            case self::ACCESS_PROTECTED:
                return $class && (is_a($class, $this->declaredClass, true) || is_a($this->declaredClass, $class, true));

            case self::ACCESS_PRIVATE:
                return $class === $this->declaredClass;
        }
    }
473611
public static function classHasMethod($method, $class) {
        $methods = self::classMethods($class);

        if (!in_array($method, $methods)) {
          return false;
        }

        return true;
    }
674010
public function classExists()
    {
        if (!class_exists($this->className)) {
            $message = Yii::t('yuncms', "Unknown class '{class}'", ['class' => $this->className]);
            $this->addError('className', $message);
            return;
        }
        if (!is_subclass_of($this->className, Rule::class)) {
            $message = Yii::t('yuncms', "'{class}' must extend from 'yii\\rbac\\Rule' or its child class", [
                'class' => $this->className]);
            $this->addError('className', $message);
        }
    }
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);
    }
882153
private static function ensurePropertyExists($class, $name)
    {
        if (!array_key_exists($name, self::$properties[$class])) {
            throw new Exceptions\UnknownPropertyException(get_called_class(), $name);
        }
    }