public function create($user, $repo, $ref, $sha)
	{
		// Build the request path.
		$path = '/repos/' . $user . '/' . $repo . '/git/refs';

		// Build the request data.
		$data = json_encode(
			array(
				'ref' => $ref,
				'sha' => $sha
			)
		);

		// 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, $ref, $sha)
	{
		// Build the request path.
		$path = '/repos/' . $user . '/' . $repo . '/git/refs';

		// Build the request data.
		$data = json_encode(
			array(
				'ref' => $ref,
				'sha' => $sha
			)
		);

		// 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 , $ ref , $ sha ) { // Build the request path. $ path = '/repos/' . $ user . '/' . $ repo . '/git/refs' ; // Build the request data. $ data = json_encode ( array ( 'ref' => $ ref , 'sha' => $ sha ) ) ; // 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 ref.

@param   string  $user  The name of the owner of the GitHub repository.
@param   string  $repo  The name of the GitHub repository.
@param   string  $ref   The name of the fully qualified reference.
@param   string  $sha   The SHA1 value to set this reference to.

@throws DomainException
@since  1.0

@return  object
Method to create a ref .