Get one parameter from last response

@return mixed  Exception on error, string otherwise
@access public
@throws \Exception
424195
public function getParameter($parameter)
    {
        $param_array = $this->getParameters();

        if (!empty($param_array) && array_key_exists($parameter, $param_array)) {
            return $param_array[$parameter];
        } else {
            throw new \Exception('UNKNOWN_PARAMETER');
        }
    }
718369
public function val() {
		if (isset($_POST[$this->paramName])) {
			$value = $_POST[$this->paramName];
			if (get_magic_quotes_gpc()==1)
			{
				// we check first for arrays
				if (is_array($value)){
					if (!array_walk_recursive($value, "stripslashes")) {
						throw new \Exception('<b>Error!</b> An error occured while walking GET array "'.$this->paramName.'".');
					}
						
					return $value;
				}
				
				return stripslashes($value);
			}
			else
			{
				return $value;
			}
		} else {
			if ($this->defaultValue instanceof ValueInterface) {
				return $this->defaultValue->val();
			} else {
				return $this->defaultValue;
			}
		}
	}
108515
public function last()
    {
        $this->generatorToArray();

        $key_last = \array_key_last($this->array);

        if ($key_last === null) {
            return null;
        }

        return $this->get($key_last);
    }
865363
public function getLast()
    {
        $count = $this->count();
        if ($count == 0) {
            return null;
        } else {
            $this->getInternalIterator()->seek($count - 1);

            return $this->getCurrent();
        }
    }
669768
protected function _exec() {
        $response = curl_exec($this->_ch);
        $this->_last_info = curl_getinfo($this->_ch);
        $error = curl_error( $this->_ch );
        if ( $error ) {
            throw new \Exception($error);
        }

        return $response;
    }
964731
public function takeLast()
    {
        if (count($this->list) <= 0) {
            return null;
        }

        $value = $this->last();

        unset($this->list[$this->count() - 1]);

        return $value;
    }
1025948
public function getLastErrorMessage()
    {
        end($this->errors_messages);
        $value = current($this->errors_messages);
        reset($this->errors_messages);

        return $value;
    }
325638
public function getRateReset()
    {
        if (!$this->lastResponse) {
            return null;
        }

        /** @var Header $limit */
        $limit = $this->lastResponse->getHeader('X-Rate-Reset');

        return $limit ? $limit->normalize() : null;
    }
1191409
public function get_last_error() {
        $retErrors = sqlsrv_errors(SQLSRV_ERR_ALL);
        $errorMessage = 'No errors found';

        if ($retErrors != null) {
            $errorMessage = '';

            foreach ($retErrors as $arrError) {
                $errorMessage .= "SQLState: ".$arrError['SQLSTATE']."<br>\n";
                $errorMessage .= "Error Code: ".$arrError['code']."<br>\n";
                $errorMessage .= "Message: ".$arrError['message']."<br>\n";
            }
        }

        return $errorMessage;
    }
564307
public function lastRunAt()
    {
        if ($this->cache->has($this->cacheKey)) {
            $executedAt = $this->cache->get($this->cacheKey);
            
            return $executedAt;
        } else {
            return null;
        }
    }
598675
protected function getExceptionCode()
    {
        $exception = $this->getException();

        if ($exception instanceof HttpException) {
            return $exception->statusCode;
        }

        return $exception->getCode();
    }
449000
public function getLastErrno() {

		if(true === $this -> connection instanceof \mysqli) {
			$this -> connect();
		}

		return $this -> connection -> errno;
	}
753657
protected function getResponse()
	{
		$response = trim($this->connection->readLine());

		switch(substr($response, 0, 1))
		{
			case '-': // error reply
				return $this->handleErrorResponse($response);
				break;
			case '+': // status reply
				return $this->handleStatusResponse($response);
				break;
			case ':': // integer reply
				return $this->handleIntegerResponse($response);
				break;
			case '$': // bulk reply
				return $this->handleBulkResponse($response);
				break;
			case '*': // multi-bulk reply
				return $this->handleMultiBulkResponse($response);
				break;
			default:
				throw new RedisException(vsprintf('Unable to handle server response [ %s ].', [$response]));
		}
	}
367957
public function end() {
    $c = $this->fqn;
    $this->exception = new $c($this->msg, $this->code, $this->previous);
    foreach ($this->vars as $var => $value) {
      $this->exception->$var = $value;
    }
   
    return $this->exception;
  }
993296
public function json()
    {
        $json = json_decode($this->getBody(), true);
        if ($json === null) {
            throw new RuntimeException(sprintf(
                "Can't decode response as JSON: %s",
                function_exists('json_last_error_msg')?
                    json_last_error_msg():
                    'Error code '.json_last_error()
            ));
        }
        return $json;
    }
1039965
public function parse() {
        global $argv;

        $options = array();
        $parameters = array();
        $argc = count( $argv );
        $paramCount = count( $this->parameters );
        
        //get parameters
        if( $argc - 1 < $paramCount ) {
            throw new \Exception("The command requires $paramCount parameters.");
        }
        
        //last items are the params
        for( $i = $paramCount - 1; $i >= 0; $i-- ) {
            $this->abstractParameters[$this->parameters[$i]] = $argv[$argc - $i - 1];
        }
        
        //go through each arg
        for( $i = 1; $i < $argc - $paramCount; $i++ ) {
            $arg = $argv[$i];
            
            //cannot start without a switch
            if( !$this->isOption( $arg ) ) {
                throw new \Exception("Invalid argument \"$arg\".");
            }
            
            //check if it's a valid option
            $option = $arg[1];

            if( $this->isParam( $option ) ) {
                //the arg stands on its own, such as -f, not -ffile.txt
                //set next as its value, move $i ahead
                if( $this->isSolitary( $arg ) ) {
                    //last item
                    if( $i == $argc - $paramCount - 1 ) {
                        throw new \Exception("Parameter does not follow the option \"$option\".");
                    }
                    
                    $this->abstractOptions[$option] = $argv[$i+1];
                    $i++;
                } else {
                    $this->abstractOptions[$option] = substr( $arg, 2 );
                }
            } else if( $this->isSwitch( $option ) ) {
                //loop through all switches in the param
                for( $i = 1; $i < strlen( $param ) - 1; $i++ ) {
                    $s = $arg[$i];
                    
                    //not a switch
                    if( !$this->isSwitch( $arg[$i] ) ) {
                        throw new \Exception("An invalid switch \"$s\" was provided.");
                    }
                    
                    $this->abstractOptions[$s] = true;
                }
            }
        }
    }
650576
public function last()
    {
        $this->executeBeforeCallback();

        return count($this->items) > 0 ? end($this->items) : null;
    }