Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@ language: php

sudo: false

dist: bionic

cache:
directories:
- $HOME/.composer/cache

matrix:
include:
- php: 7.0
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
- php: nightly
allow_failures:
- php: nightly
Expand Down
4 changes: 1 addition & 3 deletions src/BlockStorage/v2/Models/Snapshot.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
namespace OpenStack\BlockStorage\v2\Models;

use OpenStack\Common\Resource\Alias;
use OpenStack\Common\Resource\OperatorResource;
use OpenStack\Common\Resource\Creatable;
use OpenStack\Common\Resource\Deletable;
use OpenStack\Common\Resource\HasMetadata;
use OpenStack\Common\Resource\HasWaiterTrait;
use OpenStack\Common\Resource\Listable;
use OpenStack\Common\Resource\OperatorResource;
use OpenStack\Common\Resource\Retrievable;
use OpenStack\Common\Resource\Updateable;
use OpenStack\Common\Transport\Utils;
Expand Down Expand Up @@ -85,8 +85,6 @@ public function retrieve()

/**
* @param array $userOptions {@see \OpenStack\BlockStorage\v2\Api::postSnapshots}
*
* @return Creatable
*/
public function create(array $userOptions): Creatable
{
Expand Down
8 changes: 1 addition & 7 deletions src/BlockStorage/v2/Models/Volume.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
namespace OpenStack\BlockStorage\v2\Models;

use OpenStack\Common\Resource\Alias;
use OpenStack\Common\Resource\OperatorResource;
use OpenStack\Common\Resource\Creatable;
use OpenStack\Common\Resource\Deletable;
use OpenStack\Common\Resource\HasMetadata;
use OpenStack\Common\Resource\HasWaiterTrait;
use OpenStack\Common\Resource\Listable;
use OpenStack\Common\Resource\OperatorResource;
use OpenStack\Common\Resource\Retrievable;
use OpenStack\Common\Resource\Updateable;
use OpenStack\Common\Transport\Utils;
Expand Down Expand Up @@ -111,8 +111,6 @@ public function retrieve()

/**
* @param array $userOptions {@see \OpenStack\BlockStorage\v2\Api::postVolumes}
*
* @return Creatable
*/
public function create(array $userOptions): Creatable
{
Expand Down Expand Up @@ -162,8 +160,6 @@ public function parseMetadata(ResponseInterface $response): array

/**
* Update the bootable status for a volume, mark it as a bootable volume.
*
* @param bool $bootable
*/
public function setBootable(bool $bootable = true)
{
Expand All @@ -172,8 +168,6 @@ public function setBootable(bool $bootable = true)

/**
* Sets the image metadata for a volume.
*
* @param array $metadata
*/
public function setImageMetadata(array $metadata)
{
Expand Down
4 changes: 1 addition & 3 deletions src/BlockStorage/v2/Models/VolumeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace OpenStack\BlockStorage\v2\Models;

use OpenStack\Common\Resource\OperatorResource;
use OpenStack\Common\Resource\Creatable;
use OpenStack\Common\Resource\Deletable;
use OpenStack\Common\Resource\Listable;
use OpenStack\Common\Resource\OperatorResource;
use OpenStack\Common\Resource\Updateable;

/**
Expand All @@ -26,8 +26,6 @@ class VolumeType extends OperatorResource implements Listable, Creatable, Update

/**
* @param array $userOptions {@see \OpenStack\BlockStorage\v2\Api::postTypes}
*
* @return Creatable
*/
public function create(array $userOptions): Creatable
{
Expand Down
30 changes: 0 additions & 30 deletions src/BlockStorage/v2/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class Service extends AbstractService
* You must have enough volume storage quota remaining to create a volume of size requested.
*
* @param array $userOptions {@see Api::postVolumes}
*
* @return Volume
*/
public function createVolume(array $userOptions): Volume
{
Expand All @@ -33,8 +31,6 @@ public function createVolume(array $userOptions): Volume
*
* @param bool $detail if set to TRUE, more information will be returned
* @param array $userOptions {@see Api::getVolumes}
*
* @return \Generator
*/
public function listVolumes(bool $detail = false, array $userOptions = []): \Generator
{
Expand All @@ -45,8 +41,6 @@ public function listVolumes(bool $detail = false, array $userOptions = []): \Gen

/**
* @param string $volumeId the UUID of the volume being retrieved
*
* @return Volume
*/
public function getVolume(string $volumeId): Volume
{
Expand All @@ -58,27 +52,17 @@ public function getVolume(string $volumeId): Volume

/**
* @param array $userOptions {@see Api::postTypes}
*
* @return VolumeType
*/
public function createVolumeType(array $userOptions): VolumeType
{
return $this->model(VolumeType::class)->create($userOptions);
}

/**
* @return \Generator
*/
public function listVolumeTypes(): \Generator
{
return $this->model(VolumeType::class)->enumerate($this->api->getTypes(), []);
}

/**
* @param string $typeId
*
* @return VolumeType
*/
public function getVolumeType(string $typeId): VolumeType
{
$type = $this->model(VolumeType::class);
Expand All @@ -89,29 +73,19 @@ public function getVolumeType(string $typeId): VolumeType

/**
* @param array $userOptions {@see Api::postSnapshots}
*
* @return Snapshot
*/
public function createSnapshot(array $userOptions): Snapshot
{
return $this->model(Snapshot::class)->create($userOptions);
}

/**
* @return \Generator
*/
public function listSnapshots(bool $detail = false, array $userOptions = []): \Generator
{
$def = (true === $detail) ? $this->api->getSnapshotsDetail() : $this->api->getSnapshots();

return $this->model(Snapshot::class)->enumerate($def, $userOptions);
}

/**
* @param string $snapshotId
*
* @return Snapshot
*/
public function getSnapshot(string $snapshotId): Snapshot
{
$snapshot = $this->model(Snapshot::class);
Expand All @@ -122,10 +96,6 @@ public function getSnapshot(string $snapshotId): Snapshot

/**
* Shows A Quota for a tenant.
*
* @param string $tenantId
*
* @return QuotaSet
*/
public function getQuotaSet(string $tenantId): QuotaSet
{
Expand Down
13 changes: 0 additions & 13 deletions src/Common/Api/Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,11 @@ public function __construct(array $definition)
$this->params = self::toParamArray($definition['params']);
}

/**
* @return string
*/
public function getPath(): string
{
return $this->path;
}

/**
* @return string
*/
public function getMethod(): string
{
return $this->method;
Expand All @@ -64,8 +58,6 @@ public function getMethod(): string
* Indicates whether this operation supports a parameter.
*
* @param $key The name of a parameter
*
* @return bool
*/
public function hasParam(string $key): bool
{
Expand All @@ -82,9 +74,6 @@ public function getParam(string $name)
return isset($this->params[$name]) ? $this->params[$name] : null;
}

/**
* @return string
*/
public function getJsonKey(): string
{
return $this->jsonKey ?: '';
Expand All @@ -95,8 +84,6 @@ public function getJsonKey(): string
* {@see Parameter} objects.
*
* @param array $data A generic data array
*
* @return array
*/
public static function toParamArray(array $data): array
{
Expand Down
8 changes: 0 additions & 8 deletions src/Common/Api/OperatorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ public function __construct(ClientInterface $client, ApiInterface $api);
*
* @param array $definition The data that dictates how the operation works
* @param array $userValues The user-defined values that populate the request
*
* @return \Psr\Http\Message\ResponseInterface
*/
public function execute(array $definition, array $userValues = []): ResponseInterface;

Expand All @@ -38,8 +36,6 @@ public function execute(array $definition, array $userValues = []): ResponseInte
*
* @param array $definition The data that dictates how the operation works
* @param array $userValues The user-defined values that populate the request
*
* @return \GuzzleHttp\Promise\PromiseInterface
*/
public function executeAsync(array $definition, array $userValues = []): PromiseInterface;

Expand All @@ -48,17 +44,13 @@ public function executeAsync(array $definition, array $userValues = []): Promise
* HTTP client is also injected into the object to allow it to communicate with the remote API.
*
* @param array $definition The data that dictates how the operation works
*
* @return Operation
*/
public function getOperation(array $definition): Operation;

/**
* @param string $class the name of the model class
* @param mixed $data either a {@see ResponseInterface} or data array that will populate the newly
* created model class
*
* @return \OpenStack\Common\Resource\ResourceInterface
*/
public function model(string $class, $data = null): ResourceInterface;
}
8 changes: 2 additions & 6 deletions src/Common/Api/OperatorTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace OpenStack\Common\Api;

use GuzzleHttp\Promise\PromiseInterface;
use function GuzzleHttp\uri_template;
use GuzzleHttp\ClientInterface;
use GuzzleHttp\Promise\Promise;
use GuzzleHttp\Promise\PromiseInterface;
use function GuzzleHttp\uri_template;
use OpenStack\Common\Resource\ResourceInterface;
use OpenStack\Common\Transport\RequestSerializer;
use Psr\Http\Message\ResponseInterface;
Expand Down Expand Up @@ -99,10 +99,6 @@ public function getOperation(array $definition): Operation
}

/**
* @param Operation $operation
* @param array $userValues
* @param bool $async
*
* @return mixed
*
* @throws \Exception
Expand Down
Loading