Ensure that a referenced class _or interface_ exists.

@throws FatalErrorException

@param string $name
@param Stmt   $stmt
338000
protected function ensureClassOrInterfaceExists($name, $stmt)
    {
        if (!$this->classExists($name) && !$this->interfaceExists($name)) {
            throw $this->createError(\sprintf('Class \'%s\' not found', $name), $stmt);
        }
    }
266460
public static function addType(string $name, string $className) : void
    {
        if (isset(self::$typesMap[$name])) {
            throw MappingException::typeExists($name);
        }

        self::$typesMap[$name] = $className;
    }
840565
protected function validateClassConstFetchExpression(ClassConstFetch $stmt)
    {
        // there is no need to check exists for ::class const for php 5.5 or newer
        if (\strtolower($stmt->name) === 'class' && $this->atLeastPhp55) {
            return;
        }

        // if class name is an expression, give it a pass for now
        if (!$stmt->class instanceof Expr) {
            $this->ensureClassOrInterfaceExists($this->getFullyQualifiedName($stmt->class), $stmt);
        }
    }
611439
protected function resolve_flash_errors( $name ) {
		if ( ! $this->session ) {
			return;
		}

		if ( ! $this->session->get( $name ) instanceof WP_Error ) {
			return;
		}

		$this->errors = new WP_Error;

		/* @var $errors \WP_Error */
		$errors = $this->session->get( $name );

		foreach ( $errors->errors as $key => $error ) {
			$this->add_error( $key, $error );
		}
	}
1109767
public function setError($name, $value)
    {
        $name = (string)$name;
        $this->errors[$name] = $value;
    }
17017
final protected function assertClassExists(string $className): void
    {
        self::assertTrue(\class_exists($className), \sprintf(
            'Failed asserting that a class "%s" exists.',
            $className
        ));
    }
156718
public function hasMethod($name)
    {
        if ($name === $this->methodName) {
            return is_callable([$this, $name]);
        }

        return parent::hasMethod($name);
    }
974163
protected function checkNameIsNotBlacklisted(string $name): void
    {
        if (Str::contains($name, $this->blacklisted)) {
            throw new InvalidArgumentException("Invalid character in driver name [{$name}].");
        }
    }
652984
protected function fatalExceptionFromError(array $error, $traceOffset = null)
    {
        return new FatalErrorException(
            $error['message'], $error['type'], 0, $error['file'], $error['line'], $traceOffset
        );
    }
303273
public function checkVisibility(array $visibility, $name, array $original = null)
    {
        if (\count($visibility) > 1) {
            if (\in_array('public', $visibility) && \in_array('protected', $visibility)) {
                throw new CompilerException("Method '$name' cannot be 'public' and 'protected' at the same time", $original);
            }

            if (\in_array('public', $visibility) && \in_array('private', $visibility)) {
                throw new CompilerException("Method '$name' cannot be 'public' and 'private' at the same time", $original);
            }

            if (\in_array('private', $visibility) && \in_array('protected', $visibility)) {
                throw new CompilerException("Method '$name' cannot be 'protected' and 'private' at the same time", $original);
            }

            if (\in_array('private', $visibility) && \in_array('internal', $visibility)) {
                throw new CompilerException("Method '$name' cannot be 'internal' and 'private' at the same time", $original);
            }

            if (\in_array('protected', $visibility) && \in_array('internal', $visibility)) {
                throw new CompilerException("Method '$name' cannot be 'internal' and 'protected' at the same time", $original);
            }

            if (\in_array('public', $visibility) && \in_array('internal', $visibility)) {
                throw new CompilerException("Method '$name' cannot be 'internal' and 'public' at the same time", $original);
            }
        }

        if ('__construct' == $name) {
            if (\in_array('static', $visibility)) {
                throw new CompilerException("Constructors cannot be 'static'", $original);
            }
        } else {
            if ('__destruct' == $name) {
                if (\in_array('static', $visibility)) {
                    throw new CompilerException("Destructors cannot be 'static'", $original);
                }
            }
        }

        if (\is_array($visibility)) {
            $this->isAbstract = \in_array('abstract', $visibility);
            $this->isStatic = \in_array('static', $visibility);
            $this->isFinal = \in_array('final', $visibility);
            $this->isPublic = \in_array('public', $visibility);
            $this->isInternal = \in_array('internal', $visibility);
        }
    }
1099245
private function bindParam($stmt)
    {
        // Bind parameters
        for ($i = 1; $i <= count($this->bindings); $i++) {
            $stmt->bindParam($i, $this->bindings[$i - 1]);
        }
    }
1139911
protected function hasInternalMethod(string $name) : bool
    {
        static $methods = [];

        $class = get_class($this);
        if (isset($methods[$class][$name])) {
            return $methods[$class][$name];
        }

        $hasMethod = (new ReflectionClass($this))->hasMethod($name);
        $methods[$class][$name] = $hasMethod;

        return $hasMethod;
    }
1009996
public function addStmt($stmt)
    {
        if (method_exists($stmt, 'isMixinCode')) {
            $name = strval($stmt->getName());
        } else {
            $stmt = self::getStmtNode($stmt);
            $name = isset($stmt->name) ? strval($stmt->name) : null;
        }
        $type = $stmt->getType();
        switch ($type) {
            case 'Stmt_Namespace':
                $this->namespaces[$name] = $this->offset;
                break;
            case 'Stmt_Class':
            case 'Stmt_Interface':
            case 'Stmt_Trait':
                $stmt = new Code\ClassCode($stmt);
                // no break
            case 'ClassCode':
                $this->classes[$name] = $this->offset;
                break;
            case 'Stmt_Function':
                $stmt = new Code\FunctionCode($stmt);
                // no break
            case 'FunctionCode':
                $name = strtolower($name);
                $this->functions[$name] = $this->offset;
                break;
        }
        $this->stmts[$this->offset++] = $stmt;
        return $this;
    }
700281
public function addDiscriminatorMapClass($name, string $className) : void
    {
        $this->discriminatorMap[$name] = $className;

        if ($this->className === $className) {
            $this->discriminatorValue = $name;

            return;
        }

        if (! (class_exists($className) || interface_exists($className))) {
            throw MappingException::invalidClassInDiscriminatorMap($className, $this->className);
        }

        if (is_subclass_of($className, $this->className) && ! in_array($className, $this->subClasses, true)) {
            $this->subClasses[] = $className;
        }
    }
440547
public static function hasAdapter(string $name): bool
    {
        return isset(static::$adapters[$name]) && static::$adapters[$name] instanceof AbstractAdapter;
    }
387451
public static function ExistsClassSession ($name = null, $class_path = null) {
		return Session::Exists(static::_GetSeesionClassLayerPath($name, $class_path ?: static::class));
	}
507512
public function referenceBegin($name): void
    {
        $this->client->sendBuffer .= $this->client->preparedToSendBuffer;
        $this->client->preparedToSendBuffer = null;
        $signature = sprintf('<H p="1" v="%s">', $name);
        $this->write($signature);
        $signature[6] = '2';
        $this->client->currentArgumentsFormat = $signature;
    }