public function create($user, $repo, $title, $base, $head, $body = '')
	{
		// Build the request path.
		$path = '/repos/' . $user . '/' . $repo . '/pulls';

		// Build the request data.
		$data = json_encode(
			array(
				'title' => $title,
				'base' => $base,
				'head' => $head,
				'body' => $body
			)
		);

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

		// Validate the response code.
		if ($response->code != 201)
		{
			// 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 create($user, $repo, $title, $base, $head, $body = '')
	{
		// Build the request path.
		$path = '/repos/' . $user . '/' . $repo . '/pulls';

		// Build the request data.
		$data = json_encode(
			array(
				'title' => $title,
				'base' => $base,
				'head' => $head,
				'body' => $body
			)
		);

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

		// Validate the response code.
		if ($response->code != 201)
		{
			// 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 create ( $ user , $ repo , $ title , $ base , $ head , $ body = '' ) { // Build the request path. $ path = '/repos/' . $ user . '/' . $ repo . '/pulls' ; // Build the request data. $ data = json_encode ( array ( 'title' => $ title , 'base' => $ base , 'head' => $ head , 'body' => $ body ) ) ; // Send the request. $ response = $ this -> client -> post ( $ this -> fetchUrl ( $ path ) , $ data ) ; // Validate the response code. if ( $ response -> code != 201 ) { // 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 create 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   string  $title  The title of the new pull request.
@param   string  $base   The branch (or git ref) you want your changes pulled into. This
should be an existing branch on the current repository. You cannot
submit a pull request to one repo that requests a merge to a base
of another repo.
@param   string  $head   The branch (or git ref) where your changes are implemented.
@param   string  $body   The body text for the new pull request.

@return  object

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