public function edit($gistId, $files = null, $public = null, $description = null)
	{
		// Build the request path.
		$path = '/gists/' . (int) $gistId;

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

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

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

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

		// 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($gistId, $files = null, $public = null, $description = null)
	{
		// Build the request path.
		$path = '/gists/' . (int) $gistId;

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

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

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

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

		// 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 ( $ gistId , $ files = null , $ public = null , $ description = null ) { // Build the request path. $ path = '/gists/' . ( int ) $ gistId ; // Craete the data object. $ data = new \ stdClass ; // If a description is set add it to the data object. if ( isset ( $ description ) ) { $ data -> description = $ description ; } // If the public flag is set add it to the data object. if ( isset ( $ public ) ) { $ data -> public = $ public ; } // If a state is set add it to the data object. if ( isset ( $ files ) ) { $ data -> files = $ this -> buildFileData ( ( array ) $ files ) ; } // 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 gist.

@param   integer  $gistId       The gist number.
@param   mixed    $files        Either an array of file paths or a single file path as a string.
@param   boolean  $public       True if the gist should be public.
@param   string   $description  The description of the gist.

@return  object

@since   1.0
@throws  \DomainException
Method to update a gist .