public function get($name)
    {
        if (!$paramConfig = $this->methodRequirements[$name]) {
            return;
        }

        $config = new Credential($name, $paramConfig);

        if (true === $config->required && !($this->getRequest()->request->has($name))) {
            throw new BadRequestUserException(
                $this->formatError($name, false, 'The parameter must be set')
            );
        }

        $param = $this->getRequest()->request->get($name);

        if (false === $config->nullable && !$param) {
            throw new BadRequestUserException(
                $this->formatError($name, $param, 'The parameter cannot be null')
            );
        }

        if (($config->default && $param === $config->default
        || ($param === null && true === $config->nullable)
        || (null === $config->requirements))) {
            return $param;
        }

        $this->validateParam($config, $param);

        return $param;
    }
public function get($name)
    {
        if (!$paramConfig = $this->methodRequirements[$name]) {
            return;
        }

        $config = new Credential($name, $paramConfig);

        if (true === $config->required && !($this->getRequest()->request->has($name))) {
            throw new BadRequestUserException(
                $this->formatError($name, false, 'The parameter must be set')
            );
        }

        $param = $this->getRequest()->request->get($name);

        if (false === $config->nullable && !$param) {
            throw new BadRequestUserException(
                $this->formatError($name, $param, 'The parameter cannot be null')
            );
        }

        if (($config->default && $param === $config->default
        || ($param === null && true === $config->nullable)
        || (null === $config->requirements))) {
            return $param;
        }

        $this->validateParam($config, $param);

        return $param;
    }
public function get ( $ name ) { if ( ! $ paramConfig = $ this -> methodRequirements [ $ name ] ) { return ; } $ config = new Credential ( $ name , $ paramConfig ) ; if ( true === $ config -> required && ! ( $ this -> getRequest ( ) -> request -> has ( $ name ) ) ) { throw new BadRequestUserException ( $ this -> formatError ( $ name , false , 'The parameter must be set' ) ) ; } $ param = $ this -> getRequest ( ) -> request -> get ( $ name ) ; if ( false === $ config -> nullable && ! $ param ) { throw new BadRequestUserException ( $ this -> formatError ( $ name , $ param , 'The parameter cannot be null' ) ) ; } if ( ( $ config -> default && $ param === $ config -> default || ( $ param === null && true === $ config -> nullable ) || ( null === $ config -> requirements ) ) ) { return $ param ; } $ this -> validateParam ( $ config , $ param ) ; return $ param ; }
Fetches a given parameter from the current Request body.

@param string $name The parameter key

@return mixed The parameter value
Fetches a given parameter from the current Request body .