Returns true if the given controller parameter is type-hinted as
an instance of ParamFetcher.

@param \ReflectionParameter $controllerParam A parameter of the controller action

@return bool
325126
private function isParamFetcherType(\ReflectionParameter $controllerParam)
    {
        $type = $controllerParam->getClass();
        if (null === $type) {
            return false;
        }

        return $type->implementsInterface(ParamFetcherInterface::class);
    }
414575
public function isCallable()
    {
        if (!method_exists($this->controller, $this->action)) {
            return false;
        }

        $reflection = new \ReflectionMethod($this->controller, $this->action);
        if (!$reflection->isPublic()) {
            return false;
        }

        return true;
    }
1275882
public function getParam($param = null)
    {
        if (null === $param) {
            return $this->params;
        }

        return isset($this->params[$param]) ? $this->params[$param] : null;
    }
644652
public function getParam(string $param)
    {
        $result = $this->getConfig()->get($param);
        return $result ?? null;
    }
931622
final protected function throwIfArray(ReflectionParameter $param, ?string $type): void
    {
        if ($type === 'array') {
            throw new Exception('The parameter `$' . $param->getName() . '` on method ' . $this->getMethodFullName($param->getDeclaringFunction()) . ' is type hinted as `array` and is not overridden via `@API\Argument` annotation. Either change the type hint or specify the type with `@API\Argument` annotation.');
        }
    }
896767
public static function route($param = '')
    {
        $param = parent::route($param);

        switch ($param) {
            case 'types':
                return static::URL . '/' . $param;
        }

        // Otherwise, we may have been sent a longer path, e.g. types/manage/$type/fields
        if (0 == strpos($param, 'types/manage')) {
            // @todo Better checking on these paths.
            return static::URL . '/' . $param;
        }
        throw new RuntimeException('Invalid route parameter passed to AdminStructure PageObject.');
    }
244166
public function bindParam($paramNo, &$param, $type = null, $maxLength = null, $driverData = null)
    {
        $this->bindValue($paramNo, $param, $type);
        return true;
    }
274309
private function getParameterType(\ReflectionParameter $parameter)
    {
        if ( ! $parameter->hasType()) {
            return null;
        }

        return $this->formatType($parameter->getType(), $parameter->getDeclaringFunction(), $parameter);
    }
1136387
function isFunctionParam( $param )
    {
        $isFunction = false;
        if( is_array( $param) && isset( $param['_function'] ) )
            $isFunction = true;

        return $isFunction;
    }
522481
protected function isScopeMethodUsable(ReflectionMethod $method)
    {
        // Scope methods with more or less required parameters than the query, should not be used.
        if ($method->getNumberOfRequiredParameters() != 1) {
            return false;
        }

        // If the required parameter is not the first, don't use it (safeguard)
        if ( ! ($firstParameter = head($method->getParameters())) || $firstParameter->isOptional()) {
            // @codeCoverageIgnoreStart
            return false;
            // @codeCoverageIgnoreEnd
        }

        $scopeName = camel_case(substr($method->name, 5));

        // Ignore scope methods with an explicity ignore cms docblock tag
        $cmsTags = $this->getCmsDocBlockTags($method);

        if (    array_get($cmsTags, 'ignore')
            ||  (   ! array_get($cmsTags, 'scope')
                &&  in_array($scopeName, $this->getIgnoredScopeNames() )
            )
        ) {
            return false;
        }

        return true;
    }
496753
final protected function throwIfNotInputType(ReflectionParameter $param, AbstractAnnotation $annotation): void
    {
        $type = $annotation->getTypeInstance();
        $class = new ReflectionClass($annotation);
        $annotationName = $class->getShortName();

        if (!$type) {
            throw new Exception('Could not find type for parameter `$' . $param->name . '` for method ' . $this->getMethodFullName($param->getDeclaringFunction()) . '. Either type hint the parameter, or specify the type with `@API\\' . $annotationName . '` annotation.');
        }

        if ($type instanceof WrappingType) {
            $type = $type->getWrappedType(true);
        }

        if (!($type instanceof InputType)) {
            throw new Exception('Type for parameter `$' . $param->name . '` for method ' . $this->getMethodFullName($param->getDeclaringFunction()) . ' must be an instance of `' . InputType::class . '`, but was `' . get_class($type) . '`. Use `@API\\' . $annotationName . '` annotation to specify a custom InputType.');
        }
    }
247499
protected function resolvePrimitive(ReflectionParameter $parameter)
    {
        if ($parameter->isDefaultValueAvailable()) {
            return $parameter->getDefaultValue();
        }

        return $this->unresolvablePrimitive($parameter);
    }
1351557
public function hasConstructorParameter($parameterName)
    {
        $hasConstructorParameter = false;

        if (($ctor = $this->getClass()->getConstructor()) !== null) {

            foreach ($ctor->getParameters() as $param) {
                if ($param->getName() === $parameterName && $this->hasProperty($param->getName()) === true) {
                    $hasConstructorParameter = true;
                    break;
                }
            }
        }

        return $hasConstructorParameter;
    }
903303
public function isAllowedParams(?string $controller = null, ?string $action = null, ?string $role = null): bool
    {
        return $this->isAllowed($role, $this->buildResource($controller, $action));
    }
496587
@Override
    protected boolean isForAction(Method actionMethod, Class<?> controllerClazz) {
        for (Class<?> paramType : actionMethod.getParameterTypes()) {
            if (paramType == Portal.class) {
                return true;
            }
        }
        return false;
    }
337309
public function getParam($param = null)
    {
        if (null === $param) {
            return $this->_params;
        }

        return isset($this->_params[$param]) ? $this->_params[$param] : null;
    }
948845
public function isController(string $className) : bool
    {
        $refClass = new \ReflectionClass($className);


        foreach ($refClass->getMethods() as $refMethod) {
            $actionAnnotation = $this->annotationReader->getMethodAnnotation($refMethod, Action::class);
            if ($actionAnnotation) {
                return true;
            }
            $urlAnnotation = $this->annotationReader->getMethodAnnotation($refMethod, URL::class);
            if ($urlAnnotation) {
                return true;
            }
        }

        return false;
    }