Checks if the function/method has a specific required parameter.

@param mixed $parameter
Either the name of the parameter (with or without leading $), or a
ParameterNode.
@param string $type
Optional type hint to check.

@return boolean
190449
public function hasRequiredParameter($parameter, $type = NULL) {
    return $this->hasParameter($parameter, $type) && $this->getParameterByName($parameter)->isRequired();
  }
279911
public static function validateType($type)
    {
        if (!in_array($type, [self::TYPE_INFO, self::TYPE_SUCCESS, self::TYPE_WARNING, self::TYPE_ERROR])) {
            throw new \InvalidArgumentException('Invalid resource message type "%s".', $type);
        }
    }
668484
public function addParameter($parameter)
    {
        if ($parameter instanceof Zend_Server_Method_Parameter) {
            $this->_parameters[] = $parameter;
            if (null !== ($name = $parameter->getName())) {
                $this->_parameterNameMap[$name] = count($this->_parameters) - 1;
            }
        } else {
            require_once 'Zend/Server/Method/Parameter.php';
            $parameter = new Zend_Server_Method_Parameter(array(
                'type' => (string) $parameter,
            ));
            $this->_parameters[] = $parameter;
        }
        return $this;
    }
849214
public function delete($parameter = null) {

        if ( is_null($parameter) ) {

            $this->parameters = [];

            return true;

        } else if ( array_key_exists($parameter, $this->parameters) ) {

            unset($this->parameters[$parameter]);

            return true;

        } else {

            return false;

        }

    }
1022503
public function parameterTypeCheck($param, string $type = 'string'): bool
    {
        $type = 'is_'.$type;

        return (bool) ($type($param) && ! empty($param));
    }
810644
static function checkAnyRequiredParameter(array $given, array $required)
    {
        try {
            
            foreach ($required as $key) {
                if (!empty($given[$key])) {
                    throw new RequiredParameterFound();
                }
            }
            
            $parameters = implode(', ', $required);
            throw new MissingRequiredParameterException(
                    "At least one parameter required: $parameters"
            );
            
        } catch (RequiredParameterFound $ex) {
            // we have one required parameter, thats all we need
        }
    }
754978
public function has($type = null)
    {
        if ($type === null) {
            return !empty($this->session[$this->prefix]);
        }

        foreach ($this->session[$this->prefix] as $message) {
            if ($message['type'] === $type) {
                return true;
            }
        }

        return false;
    }
255968
public function getType($parameter='')
	{
		$parameterType = null;
		switch (gettype($parameter)) {
			case 'string':
				$parameterType = 's';
				break;
			case 'numeric':
			case 'integer':
				$parameterType = 'i';
				break;
			case 'double':
				$parameterType = 'd';
				break;
			default:
				$parameterType = null;
				break;
		}

		return $parameterType;
	}
575097
public function hasReplacedParameter(array $parameter)
    {
        foreach ($this->replacedParameters as $replacedParameter) {
            if ($replacedParameter['column'] === $parameter['column'] &&
                $replacedParameter['value']  === $parameter['value']
            ) {
                return true;
            }
        }

        return false;
    }
449003
public function getParameter($parameter)
    {
        return isset($this->getParameters()[$parameter]) ? $this->getParameters()[$parameter] : null;
    }
702045
public function get($parameter = null) {

        if ( empty($parameter) ) {

            $return = $this->parameters;

        } else if ( array_key_exists($parameter, $this->parameters) ) {

            $return = $this->parameters[$parameter];

        } else {

            $return = null;

        }

        return $return;

    }
963281
protected function renderParameterTypeHint($parameter)
    {
        $typeHint = $parameter->hasType() ? (string) $parameter->getType() : '';

        $typeHint = trim($typeHint);

        if ($typeHint) {
            // If the type is not a built in types, we should add a leading slash
            // in the type hint be make the class name not confusing.
            if (
                ! in_array($typeHint, [
                    'self', 'array', 'callable', 'bool', 'float', 'int', 'string',
                    'object', 'iterable', 'void'
                ])
            ) {
                $typeHint = '\\'.$typeHint;
            }

            if ($parameter->allowsNull()) {
                $typeHint = '?'.$typeHint;
            }

            $typeHint .= ' ';
        }

        return $typeHint;
    }
752120
private function checkQueryResourceId(array $parameters, string $type): void
    {
        if (!$this->resourceId && $parameters['resource_id']) {
            throw new \InvalidArgumentException(\sprintf(
                'Trying to query with a resource ID, but the repository %s does not provide support for them',
                $this->name
            ));
        }
        if (self::ENDPOINT_SINGLE === $type && !$parameters['resource_id']) {
            throw new \InvalidArgumentException(\sprintf(
                'Trying to query a single element without providing a resource ID for repository %s',
                $this->name
            ));
        }
        if (self::ENPOINT_COLLECTION === $type && $parameters['resource_id']) {
            throw new \InvalidArgumentException(\sprintf(
                'Trying to query a collection element by providing a resource ID for repository %s',
                $this->name
            ));
        }
    }
866599
private function determineParamValue(\ReflectionParameter $parameter)
    {
        $class = $parameter->getClass();

        if (!empty($class)) {
            // If this is a object we may be able to map it to something in our context
            $className = $class->getName();

            // Determine strong type-based link
            if (isset($this->instances[$className])) {
                return $this->instances[$className];
            }

            // Determine weak type-based link
            if (isset($this->weakLinks[$className])) {
                $lowerClassName = $this->weakLinks[$className];
                return $this->instances[$lowerClassName];
            }
        } else {
            // If this is a primitive type, attempt to determine it by its name
            $varName = $parameter->getName();

            if (isset($this->variablesByName[$varName])) {
                return $this->variablesByName[$varName];
            }
        }

        // We were unable to determine a suitable value based on this context. Pass back its default value if possible.
        if ($parameter->isDefaultValueAvailable()) {
            return $parameter->getDefaultValue();
        }

        // As a final fallback we will primitive pass NULL and let the function deal with it.
        return null;
    }
373742
public static function isKnownType(string $type): bool
    {
        return self::isInternalPhpType($type) || self::isClassType($type);
    }
1283059
public function hasType( string $type ): bool
	{
		if( substr($type, 0, 2) !== "#/" )
		{
			$type = "#/{$type}";
		}
		return $this->getType() === $type;
	}
483233
private static function paramValidator($param, $type)
    {
        $allowedTypes = explode('|', $type);

        foreach ($allowedTypes as $allowedType) {
            $validationFunction = 'is_' . $allowedType;
            if ($validationFunction($param)) {
                return true;
            }
        }

        return false;
    }