public function create($user, $repo, $title, $body = null, $assignee = null, $milestone = null, array $labels = null)
	{
		// Build the request path.
		$path = '/repos/' . $user . '/' . $repo . '/issues';

		// Ensure that we have a non-associative array.
		if (isset($labels))
		{
			$labels = array_values($labels);
		}

		// Build the request data.
		$data = json_encode(
			array(
				'title'     => $title,
				'assignee'  => $assignee,
				'milestone' => $milestone,
				'labels'    => $labels,
				'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, $body = null, $assignee = null, $milestone = null, array $labels = null)
	{
		// Build the request path.
		$path = '/repos/' . $user . '/' . $repo . '/issues';

		// Ensure that we have a non-associative array.
		if (isset($labels))
		{
			$labels = array_values($labels);
		}

		// Build the request data.
		$data = json_encode(
			array(
				'title'     => $title,
				'assignee'  => $assignee,
				'milestone' => $milestone,
				'labels'    => $labels,
				'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 , $ body = null , $ assignee = null , $ milestone = null , array $ labels = null ) { // Build the request path. $ path = '/repos/' . $ user . '/' . $ repo . '/issues' ; // Ensure that we have a non-associative array. if ( isset ( $ labels ) ) { $ labels = array_values ( $ labels ) ; } // Build the request data. $ data = json_encode ( array ( 'title' => $ title , 'assignee' => $ assignee , 'milestone' => $ milestone , 'labels' => $ labels , '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 an issue.

@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 issue.
@param   string   $body       The body text for the new issue.
@param   string   $assignee   The login for the GitHub user that this issue should be assigned to.
@param   integer  $milestone  The milestone to associate this issue with.
@param   array    $labels     The labels to associate with this issue.

@return  object

@since   1.0
@throws  \DomainException
Method to create an issue .