public function edit($user, $repo, $pullId, $title = null, $body = null, $state = null)
	{
		// Build the request path.
		$path = '/repos/' . $user . '/' . $repo . '/pulls/' . (int) $pullId;

		// Craete the data object.
		$data = new \stdClass;

		// If a title is set add it to the data object.
		if (isset($title))
		{
			$data->title = $title;
		}

		// If a body is set add it to the data object.
		if (isset($body))
		{
			$data->body = $body;
		}

		// If a state is set add it to the data object.
		if (isset($state))
		{
			$data->state = $state;
		}

		// Encode the request data.
		$data = json_encode($data);

		// Send the request.
		$response = $this->client->patch($this->fetchUrl($path), $data);

		// Validate the response code.
		if ($response->code != 200)
		{
			// Decode the error response and throw an exception.
			$error = json_decode($response->body);
			throw new \DomainException($error->message, $response->code);
		}

		return json_decode($response->body);
	}
public function edit($user, $repo, $pullId, $title = null, $body = null, $state = null)
	{
		// Build the request path.
		$path = '/repos/' . $user . '/' . $repo . '/pulls/' . (int) $pullId;

		// Craete the data object.
		$data = new \stdClass;

		// If a title is set add it to the data object.
		if (isset($title))
		{
			$data->title = $title;
		}

		// If a body is set add it to the data object.
		if (isset($body))
		{
			$data->body = $body;
		}

		// If a state is set add it to the data object.
		if (isset($state))
		{
			$data->state = $state;
		}

		// Encode the request data.
		$data = json_encode($data);

		// Send the request.
		$response = $this->client->patch($this->fetchUrl($path), $data);

		// Validate the response code.
		if ($response->code != 200)
		{
			// Decode the error response and throw an exception.
			$error = json_decode($response->body);
			throw new \DomainException($error->message, $response->code);
		}

		return json_decode($response->body);
	}
public function edit ( $ user , $ repo , $ pullId , $ title = null , $ body = null , $ state = null ) { // Build the request path. $ path = '/repos/' . $ user . '/' . $ repo . '/pulls/' . ( int ) $ pullId ; // Craete the data object. $ data = new \ stdClass ; // If a title is set add it to the data object. if ( isset ( $ title ) ) { $ data -> title = $ title ; } // If a body is set add it to the data object. if ( isset ( $ body ) ) { $ data -> body = $ body ; } // If a state is set add it to the data object. if ( isset ( $ state ) ) { $ data -> state = $ state ; } // Encode the request data. $ data = json_encode ( $ data ) ; // Send the request. $ response = $ this -> client -> patch ( $ this -> fetchUrl ( $ path ) , $ data ) ; // Validate the response code. if ( $ response -> code != 200 ) { // Decode the error response and throw an exception. $ error = json_decode ( $ response -> body ) ; throw new \ DomainException ( $ error -> message , $ response -> code ) ; } return json_decode ( $ response -> body ) ; }
Method to update a pull request.

@param   string   $user    The name of the owner of the GitHub repository.
@param   string   $repo    The name of the GitHub repository.
@param   integer  $pullId  The pull request number.
@param   string   $title   The optional new title for the pull request.
@param   string   $body    The optional new body text for the pull request.
@param   string   $state   The optional new state for the pull request. [open, closed]

@return  object

@since   1.0
@throws  \DomainException
Method to update a pull request .