Check whether a FQCN or an object implements the Prefixable interface.

@since 0.1.0

@param OptionRepository|string $objectOrClassName Object instance or FQCN.

@return bool Whether the passed-in argument is prefixable.
350745
protected function isPrefixable($objectOrClassName): bool
    {
        if (is_string($objectOrClassName)) {
            return in_array(Prefixable::class, class_implements($objectOrClassName), true);
        }

        if (is_object($objectOrClassName)) {
            return $objectOrClassName instanceof Prefixable;
        }

        return false;
    }
1208134
public function hasParser($className, $priority)
    {
        if (empty($this->parsers[$priority])) {
            return false;
        }

        return $this->parsers[$priority] === $className;
    }
1060604
protected function isValidApplicationClass(string $className): bool
    {
        $reflectionClass = new ReflectionClass($className);

        return
            $reflectionClass->isInstantiable() === true &&
            $reflectionClass->implementsInterface(ApplicationInterface::class) === true;
    }
86902
public function isInstanceOf($className)
    {
        $this->doCheck(function ($value) use ($className) {
            $this->throwExceptionIfFalse(
                $value instanceof $className,
                'Failed assertion that %s is an instance of %s', $value, $className
            );
        });

        return $this;
    }
1011243
private function checkClassHasValidSuffix($className, $classSuffix = null)
    {
        if ($classSuffix === '*') {
            return true;
        }
        $classSuffixPos = strrpos($className, $classSuffix);
        return $classSuffixPos === (strlen($className) - strlen($classSuffix));
    }
198992
public function isClassAbstract($className)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        return isset($this->classReflectionData[$className][self::DATA_CLASS_ABSTRACT]);
    }
450408
public function validateReflectionClassForAccessorVisibility($classFQN, $accessor)
    {
        $reflectionClass = $this->getReflectionClass($classFQN);
        if ($reflectionClass instanceof CoverFishMessageError) {
            return $reflectionClass;
        }

        $accessorResult = null;

        switch ($accessor) {
            case 'public':
                $accessorResult = $this->validateReflectionClassForAccessorPublic($reflectionClass);
                break;

            case 'protected':
                $accessorResult = $this->validateReflectionClassForAccessorProtected($reflectionClass);
                break;

            case 'private':
                $accessorResult = $this->validateReflectionClassForAccessorPrivate($reflectionClass);
                break;

            case '!public':
                $accessorResult = $this->validateReflectionClassForAccessorNotPublic($reflectionClass);
                break;

            case '!protected':
                $accessorResult = $this->validateReflectionClassForAccessorNotProtected($reflectionClass);
                break;

            case '!private':
                $accessorResult = $this->validateReflectionClassForAccessorNotPrivate($reflectionClass);
                break;

            default:
                return false;
        }

        if ($accessorResult instanceof CoverFishMessageError) {
            return $accessorResult;
        }

        return true;
    }
1370035
private function doesImplementEventInterface(string $classOrInterface): bool
    {
        $isClass     = class_exists($classOrInterface, true);
        $isInterface = interface_exists($classOrInterface, true);
        assert($isClass xor $isInterface);

        $isEvent = in_array(EventInterface::class, class_implements($classOrInterface));

        return $isEvent;
    }
1056994
public function canCallMethod($methodName, $options)
    {
        return (null !== ($options = $this->getMethodParameters($methodName, $options, false)));
    }
388626
public function isInstanceOf(Interfaces\JavaObject $javaObject, $className): bool
    {
        try {
            return $this->pjbProxyClient->isInstanceOf($javaObject, $className);
        } catch (Pjb62BrokenConnectionException | Exception\InvalidUsageException $e) {
            PjbProxyClient::unregisterInstance();
            throw new BrokenConnectionException($e->getMessage(), $e->getCode(), $e);
        }
    }
625894
final public function hasclass($classname)
    {
        return !!$this->hasattr('class')?in_array($classname, explode(' ', $this->attrs->class)):FALSE;
    }
1132570
public function isTransient($className)
    {
        return
            !$this->mappers->hasMapperFor($className) ||
            $this->mappers->getMapperFor($className)->isTransient();
    }
923849
public function isRegistered($objectName)
    {
        if (isset($this->objects[$objectName])) {
            return true;
        }

        if ($objectName[0] === '\\') {
            throw new \InvalidArgumentException('Object names must not start with a backslash ("' . $objectName . '")', 1270827335);
        }
        return false;
    }
1065336
public function hasObjectManagerNameByClassName($className)
    {
        $realClass = ClassUtils::getRealClass($className);

        if (array_key_exists($realClass, $this->classNameToObjectManagerName)) {
            return false !== $this->classNameToObjectManagerName[$realClass];
        }

        $moduleOptionsManager =  $this->getModuleOptionsManager();
        if (!$moduleOptionsManager->hasOptionsByClassName($realClass)) {
            $this->classNameToObjectManagerName[$realClass] = false;
            return false;
        }

        $moduleOptions = $moduleOptionsManager->getOptionsByClassName($realClass);

        if (!$moduleOptions instanceof ObjectManagerNameProviderInterface) {
            $this->classNameToObjectManagerName[$realClass] = false;
            return false;
        }

        $objectManagerName = $moduleOptions->getObjectManagerName();

        if (!is_string($objectManagerName)) {
            $this->classNameToObjectManagerName[$realClass] = false;
            return false;
        }
        $this->classNameToObjectManagerName[$realClass] = $objectManagerName;

        return false !== $this->classNameToObjectManagerName[$realClass];
    }
1114257
protected function compileStaticMethods($className, ProxyClass $proxyClass)
    {
        $methodNames = $this->reflectionService->getMethodsAnnotatedWith($className, Flow\CompileStatic::class);
        foreach ($methodNames as $methodName) {
            if (!$this->reflectionService->isMethodStatic($className, $methodName)) {
                throw new ObjectException(sprintf('The method %s:%s() is annotated CompileStatic so it must be static', $className, $methodName), 1476348303);
            }
            if ($this->reflectionService->isMethodPrivate($className, $methodName)) {
                throw new ObjectException(sprintf('The method %s:%s() is annotated CompileStatic so it must not be private', $className, $methodName), 1476348306);
            }
            $reflectedMethod = new MethodReflection($className, $methodName);
            $reflectedMethod->setAccessible(true);
            $value = $reflectedMethod->invoke(null, $this->objectManager);
            $compiledResult = var_export($value, true);

            $compiledMethod = $proxyClass->getMethod($methodName);
            $compiledMethod->setMethodBody('return ' . $compiledResult . ';');
        }
    }
1216996
private function exists($className, $functionName)
    {
        return
            function_exists($this->getFullFunctionName($className, $functionName))
            || method_exists($className, $functionName);
    }
699773
public function canLoadClass($className)
    {
        if ($this->namespace !== null && strpos($className, $this->namespace.$this->namespaceSeparator) !== 0) {
            return false;
        }

        $file = str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $className) . $this->fileExtension;

        if ($this->includePath !== null) {
            return file_exists($this->includePath . DIRECTORY_SEPARATOR . $file);
        }

        return (false !== stream_resolve_include_path($file));
    }