Google\Cloud\Storage\StorageObject::delete PHP Method

delete() public method

Example: $object->delete();
See also: https://cloud.google.com/storage/docs/json_api/v1/objects/delete Objects delete API documentation.
public delete ( array $options = [] ) : void
$options array [optional] { Configuration options. @type string $ifGenerationMatch Makes the operation conditional on whether the object's current generation matches the given value. @type string $ifGenerationNotMatch Makes the operation conditional on whether the object's current generation does not match the given value. @type string $ifMetagenerationMatch Makes the operation conditional on whether the object's current metageneration matches the given value. @type string $ifMetagenerationNotMatch Makes the operation conditional on whether the object's current metageneration does not match the given value. }
return void
    public function delete(array $options = [])
    {
        $this->connection->deleteObject($options + $this->identity);
    }

Usage Example

 public function testDelete()
 {
     $object = new StorageObject($this->connection->reveal(), 'object.txt', 'bucket');
     $this->assertNull($object->delete());
 }