From 76510386cfd75ebfa3debc25f5d6d32f2710710f Mon Sep 17 00:00:00 2001 From: Konstantin Babushkin Date: Fri, 5 Jan 2024 13:55:39 +0100 Subject: [PATCH] Chores (#379) * format via php-cs-fixer * add unit tests with the lowest possible dependencies * add unit tests with php 8.2 and 8.3 * add integration tests for 2023.1 antelope and yoga * allow skipping integration, unit or both tests in pull requests --------- Co-authored-by: k0ka --- .github/workflows/format.yml | 50 +++++++++++++++++ .github/workflows/integration_tests.yml | 10 +++- .github/workflows/unit_tests.yml | 23 ++++++-- .php_cs.dist => .php-cs-fixer.dist.php | 2 +- COVERAGE.md | 18 ++++--- README.md | 2 +- composer.json | 53 ++++++++++++------- phpunit.xml.dist | 2 +- src/BlockStorage/v2/Models/QuotaSet.php | 9 ---- src/BlockStorage/v2/Models/Snapshot.php | 5 -- src/BlockStorage/v2/Models/Volume.php | 11 ---- src/BlockStorage/v2/Models/VolumeType.php | 2 - src/BlockStorage/v2/Service.php | 3 +- src/BlockStorage/v3/Api.php | 3 +- src/BlockStorage/v3/Service.php | 3 +- src/Common/Api/AbstractParams.php | 26 ++++----- src/Common/Api/ApiInterface.php | 2 +- src/Common/Api/Operation.php | 2 - src/Common/Api/OperatorTrait.php | 21 +------- src/Common/Api/Parameter.php | 4 +- src/Common/ArrayAccessTrait.php | 1 - src/Common/Error/Builder.php | 5 -- src/Common/JsonPath.php | 11 ---- src/Common/JsonSchema/JsonPatch.php | 6 +-- src/Common/Resource/Alias.php | 5 -- src/Common/Resource/OperatorResource.php | 10 +--- src/Common/Resource/ResourceInterface.php | 6 +-- src/Common/Service/Builder.php | 2 - src/Common/Transport/HandlerStack.php | 2 +- src/Common/Transport/JsonSerializer.php | 3 +- src/Common/Transport/Middleware.php | 3 -- src/Common/Transport/Utils.php | 2 - src/Compute/v2/Enum.php | 14 ++--- src/Compute/v2/Models/Flavor.php | 9 ---- src/Compute/v2/Models/Host.php | 3 -- src/Compute/v2/Models/Hypervisor.php | 3 -- src/Compute/v2/Models/Image.php | 11 ---- src/Compute/v2/Models/Keypair.php | 15 ------ src/Compute/v2/Models/QuotaSet.php | 9 ---- src/Compute/v2/Models/Server.php | 20 ------- src/Compute/v2/Service.php | 9 +++- src/Identity/v2/Models/Catalog.php | 8 +-- src/Identity/v2/Models/Entry.php | 3 -- src/Identity/v2/Models/Token.php | 6 --- src/Identity/v2/Service.php | 4 +- src/Identity/v3/Enum.php | 6 +-- src/Identity/v3/Models/Assignment.php | 3 -- src/Identity/v3/Models/Catalog.php | 3 -- src/Identity/v3/Models/Credential.php | 12 ----- src/Identity/v3/Models/Domain.php | 13 +---- src/Identity/v3/Models/Endpoint.php | 11 ---- src/Identity/v3/Models/Group.php | 12 +---- src/Identity/v3/Models/Policy.php | 11 ---- src/Identity/v3/Models/Project.php | 13 +---- src/Identity/v3/Models/Role.php | 5 -- src/Identity/v3/Models/Service.php | 14 ----- src/Identity/v3/Models/Token.php | 14 +---- src/Identity/v3/Models/User.php | 11 ---- src/Identity/v3/Service.php | 11 +++- src/Images/v2/Models/Image.php | 6 --- src/Images/v2/Models/Member.php | 12 ++--- src/Metric/v1/Gnocchi/Models/Metric.php | 6 --- src/Metric/v1/Gnocchi/Models/Resource.php | 31 +++++------ src/Metric/v1/Gnocchi/Service.php | 4 ++ .../Extensions/Layer3/Models/FloatingIp.php | 3 -- .../Extensions/Layer3/Models/GatewayInfo.php | 3 -- .../v2/Extensions/Layer3/Models/Router.php | 6 --- .../SecurityGroups/Models/SecurityGroup.php | 12 ----- .../Models/SecurityGroupRule.php | 9 ---- .../v2/Extensions/SecurityGroups/Service.php | 1 - src/Networking/v2/Models/LoadBalancer.php | 15 ------ .../v2/Models/LoadBalancerHealthMonitor.php | 15 ------ .../v2/Models/LoadBalancerListener.php | 15 ------ .../v2/Models/LoadBalancerMember.php | 12 ----- src/Networking/v2/Models/LoadBalancerPool.php | 15 ------ src/Networking/v2/Models/LoadBalancerStat.php | 3 -- .../v2/Models/LoadBalancerStatus.php | 6 --- src/Networking/v2/Models/Network.php | 11 ---- src/Networking/v2/Models/Port.php | 3 -- src/Networking/v2/Models/Quota.php | 9 ---- src/Networking/v2/Models/Subnet.php | 14 ----- src/Networking/v2/Service.php | 5 +- src/ObjectStore/v1/Models/Account.php | 17 +----- src/ObjectStore/v1/Models/Container.php | 38 +++---------- src/ObjectStore/v1/Models/StorageObject.php | 25 +-------- src/ObjectStore/v1/Service.php | 3 +- src/OpenStack.php | 1 - 87 files changed, 229 insertions(+), 631 deletions(-) create mode 100644 .github/workflows/format.yml rename .php_cs.dist => .php-cs-fixer.dist.php (94%) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 000000000..db2aacd20 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,50 @@ +name: "Format" +on: + push: + branches: + - '*' + +jobs: + composer-normalize: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + + - uses: shivammathur/setup-php@v2 + with: + coverage: none + extensions: mbstring + php-version: 8.2 + + - run: composer install --no-interaction --no-progress --no-suggest + + - run: composer normalize + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Normalize composer.json + + php-cs-fixer: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.head_ref }} + + - uses: shivammathur/setup-php@v2 + with: + coverage: none + extensions: mbstring + php-version: 8.1 + + - run: composer install --no-interaction --no-progress --no-suggest + + - run: vendor/bin/php-cs-fixer fix + + - run: git pull + + - uses: stefanzweifel/git-auto-commit-action@v4 + with: + commit_message: Apply php-cs-fixer changes diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index dce570d3e..f1646ca8a 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -9,7 +9,9 @@ on: jobs: tests: - if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')" + if: | + !contains(github.event.pull_request.body, 'skip ci') + && !contains(github.event.pull_request.body, 'skip integration') strategy: fail-fast: false matrix: @@ -19,9 +21,15 @@ jobs: - name: "bobcat" openstack_version: "stable/2023.2" ubuntu_version: "22.04" + - name: "antelope" + openstack_version: "stable/2023.1" + ubuntu_version: "22.04" - name: "zed" openstack_version: "stable/zed" ubuntu_version: "20.04" + - name: "yoga" + openstack_version: "stable/yoga" + ubuntu_version: "20.04" - name: "wallaby" openstack_version: "stable/wallaby" ubuntu_version: "20.04" diff --git a/.github/workflows/unit_tests.yml b/.github/workflows/unit_tests.yml index ec1fccbe2..88eb15c9a 100644 --- a/.github/workflows/unit_tests.yml +++ b/.github/workflows/unit_tests.yml @@ -9,32 +9,45 @@ on: jobs: tests: runs-on: ubuntu-22.04 - if: "!contains(github.event.head_commit.message, 'skip ci') && !contains(github.event.head_commit.message, 'ci skip')" + if: | + !contains(github.event.pull_request.body, 'skip ci') + && !contains(github.event.pull_request.body, 'skip unit') strategy: fail-fast: false matrix: - php: [ 7.2, 7.3, 7.4, 8.0, 8.1 ] - name: "php-${{ matrix.php }}" + php: [ 7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3 ] + composer: + - name: lowest + arg: "--prefer-lowest --prefer-stable" + - name: highest + arg: "" # No args added as highest is default + name: PHPUnit on PHP ${{ matrix.php }} with ${{ matrix.composer.name }} dependencies steps: - uses: actions/checkout@v2 + - name: get cache directory id: composer-cache run: | echo "::set-output name=dir::$(composer config cache-files-dir)" + - uses: actions/cache@v2 with: path: | ~/.php_cs.cache ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ hashFiles('**.composer.lock') }} + key: ${{ runner.os }}-cache-${{ matrix.php }}-${{ matrix.composer.name }}-${{ hashFiles('**.composer.lock') }} + - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} extensions: curl tools: composer:v2 coverage: none - - run: composer install --prefer-dist --no-interaction --no-progress + + - run: composer update --prefer-dist --no-interaction --no-progress ${{ matrix.composer.arg }} + - run: vendor/bin/parallel-lint --exclude vendor . + - name: execute unit tests run: vendor/bin/phpunit --configuration phpunit.xml.dist diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 94% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index 32d7e97ef..5a9aeecf5 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -4,7 +4,7 @@ exit(0); } -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setRules( [ '@PSR2' => true, diff --git a/COVERAGE.md b/COVERAGE.md index 7957e324e..c743bfcb2 100644 --- a/COVERAGE.md +++ b/COVERAGE.md @@ -1,3 +1,12 @@ +# OpenStack versions coverage + +While we strive to support all versions of OpenStack, we can only test limited number of versions. The current set: +* 2023.2 Bobcat +* 2023.1 Antelope +* Zed +* Yoga +* Wallaby - as the latest version which had BlockStorage v2 API + # OpenStack services coverage | Name |PHP classes|API definition|Unit tests|Sample files|Integration tests|Documentation| @@ -5,19 +14,11 @@ | Block Storage v2 |✓|✓|✓||✓|| | Block Storage v3 |✓|✓|✓|✓|✓|✓| | Compute v2 |✓|✓|✓|✓|✓|✓| -| Compute v2 exts ||||||| -| Data Processing v1 ||||||| -| Database v1 ||||||| | Identity v2 |✓|✓|✓|||| -| Identity v2 exts ||||||| | Identity v3 |✓|✓|✓|✓|✓|✓| -| Identity v3 exts ||||||| | Images v2 |✓|✓|✓|✓|✓|✓| | Networking v2 |✓|✓|✓|✓|✓|✓| -| Networking v2 exts ||||||| | Object Storage v1 |✓|✓|✓|✓|✓|✓| -| Orchestration v1 ||||||| -| Telemetry v2 ||||||| ## Key @@ -55,3 +56,4 @@ In order for this to be marked complete, every public operation needs to be docu have all their keys defined. All types must be defined. Any required options must be marked. * a human-readable description * a code sample + diff --git a/README.md b/README.md index b6d1fa703..056f8c3aa 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ OpenStack services, and versions of services, are supported. ## Links * [Official documentation](https://php-openstack-sdk.readthedocs.io/en/latest/) -* [Reference documentation](http://refdocs.os.php-opencloud.com) +* [Supported services](/COVERAGE.md) * [Contributing guide](/CONTRIBUTING.md) * [Code of Conduct](/CODE_OF_CONDUCT.md) diff --git a/composer.json b/composer.json index ec065b988..6d460aadf 100644 --- a/composer.json +++ b/composer.json @@ -1,26 +1,47 @@ { "name": "php-opencloud/openstack", "description": "PHP SDK for OpenStack APIs. Supports BlockStorage, Compute, Identity, Images, Networking and Metric Gnocchi", + "license": "Apache-2.0", "keywords": [ "php", "openstack", "api", "sdk" ], - "homepage": "https://github.com/php-opencloud/openstack", - "license": "Apache-2.0", "authors": [ { "name": "Jamie Hannaford", "email": "jamie.hannaford@rackspace.com", - "homepage" : "https://github.com/jamiehannaford" + "homepage": "https://github.com/jamiehannaford" }, { "name": "Ha Phan", "email": "thanhha.work@gmail.com", - "homepage" : "https://github.com/haphan" + "homepage": "https://github.com/haphan" + }, + { + "name": "Konstantin Babushkin", + "email": "koka@idwrx.com", + "homepage": "https://github.com/k0ka" } ], + "homepage": "https://github.com/php-opencloud/openstack", + "require": { + "php": "^7.2.5 || ^8.0", + "guzzlehttp/guzzle": "^7.0", + "guzzlehttp/psr7": ">=1.7", + "guzzlehttp/uri-template": "^0.2 || ^1.0", + "justinrainbow/json-schema": "^5.2" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.0", + "friendsofphp/php-cs-fixer": "^3", + "php-coveralls/php-coveralls": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpspec/prophecy": "^1.17", + "phpunit/phpunit": ">=8.5.23 <9.0", + "psr/log": "^1.0" + }, "autoload": { "psr-4": { "OpenStack\\": "src/" @@ -28,27 +49,19 @@ }, "autoload-dev": { "psr-4": { - "OpenStack\\Test\\": "tests/unit/", - "OpenStack\\Integration\\": "tests/integration/" + "OpenStack\\Integration\\": "tests/integration/", + "OpenStack\\Test\\": "tests/unit/" } }, - "require": { - "php": "^7.2.5|^8.0", - "guzzlehttp/guzzle": "^7.0", - "guzzlehttp/uri-template": "^0.2|^1.0", - "justinrainbow/json-schema": "^5.2" - }, - "require-dev": { - "phpunit/phpunit": "^8.0", - "psr/log": "^1.0", - "php-coveralls/php-coveralls": "^2.0", - "friendsofphp/php-cs-fixer": "^2.18", - "php-parallel-lint/php-parallel-lint": "^1.2", - "phpspec/prophecy": "^1.17" + "config": { + "allow-plugins": { + "ergebnis/composer-normalize": true + }, + "sort-packages": true }, "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "3.0-dev" } } } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 05ba70a11..22694ff40 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,5 @@ - + diff --git a/src/BlockStorage/v2/Models/QuotaSet.php b/src/BlockStorage/v2/Models/QuotaSet.php index d28052484..c603bc28e 100644 --- a/src/BlockStorage/v2/Models/QuotaSet.php +++ b/src/BlockStorage/v2/Models/QuotaSet.php @@ -58,27 +58,18 @@ class QuotaSet extends OperatorResource implements Retrievable, Updateable, Dele protected $resourceKey = 'quota_set'; - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getQuotaSet(), ['tenantId' => (string) $this->tenantId]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->putQuotaSet()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $response = $this->executeWithState($this->api->deleteQuotaSet()); diff --git a/src/BlockStorage/v2/Models/Snapshot.php b/src/BlockStorage/v2/Models/Snapshot.php index fbf266c4c..f05a403b6 100644 --- a/src/BlockStorage/v2/Models/Snapshot.php +++ b/src/BlockStorage/v2/Models/Snapshot.php @@ -59,9 +59,6 @@ class Snapshot extends OperatorResource implements Listable, Creatable, Updateab 'os-extended-snapshot-attributes:project_id' => 'projectId', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -84,8 +81,6 @@ public function retrieve() } /** - * {@inheritdoc} - * * @param array $userOptions {@see \OpenStack\BlockStorage\v2\Api::postSnapshots} */ public function create(array $userOptions): Creatable diff --git a/src/BlockStorage/v2/Models/Volume.php b/src/BlockStorage/v2/Models/Volume.php index 7e377f678..1aec74ab1 100644 --- a/src/BlockStorage/v2/Models/Volume.php +++ b/src/BlockStorage/v2/Models/Volume.php @@ -85,9 +85,6 @@ class Volume extends OperatorResource implements Creatable, Listable, Updateable 'volume_image_metadata' => 'volumeImageMetadata', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -110,8 +107,6 @@ public function retrieve() } /** - * {@inheritdoc} - * * @param array $userOptions {@see \OpenStack\BlockStorage\v2\Api::postVolumes} */ public function create(array $userOptions): Creatable @@ -179,12 +174,6 @@ public function setImageMetadata(array $metadata) /** * Administrator only. Resets the status, attach status, and migration status for a volume. Specify the os-reset_status action in the request body. * - * @param array $options - * - * $options['status'] = (string) The volume status. - * $options['migrationStatus'] = (string) The volume migration status. - * $options['attachStatus'] = (string) The volume attach status. [OPTIONAL] - * * @see https://developer.openstack.org/api-ref/block-storage/v2/index.html#volume-actions-volumes-action */ public function resetStatus(array $options) diff --git a/src/BlockStorage/v2/Models/VolumeType.php b/src/BlockStorage/v2/Models/VolumeType.php index d85ecb937..c54425e2f 100644 --- a/src/BlockStorage/v2/Models/VolumeType.php +++ b/src/BlockStorage/v2/Models/VolumeType.php @@ -25,8 +25,6 @@ class VolumeType extends OperatorResource implements Listable, Creatable, Update protected $resourcesKey = 'volume_types'; /** - * {@inheritdoc} - * * @param array $userOptions {@see \OpenStack\BlockStorage\v2\Api::postTypes} */ public function create(array $userOptions): Creatable diff --git a/src/BlockStorage/v2/Service.php b/src/BlockStorage/v2/Service.php index b731d2c2d..b509a6663 100644 --- a/src/BlockStorage/v2/Service.php +++ b/src/BlockStorage/v2/Service.php @@ -11,7 +11,7 @@ use OpenStack\Common\Service\AbstractService; /** - * @property \OpenStack\BlockStorage\v2\Api $api + * @property Api $api */ class Service extends AbstractService { @@ -31,6 +31,7 @@ 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 diff --git a/src/BlockStorage/v3/Api.php b/src/BlockStorage/v3/Api.php index 1b8c194f0..c0ece2749 100644 --- a/src/BlockStorage/v3/Api.php +++ b/src/BlockStorage/v3/Api.php @@ -4,5 +4,4 @@ class Api extends \OpenStack\BlockStorage\v2\Api { - -} \ No newline at end of file +} diff --git a/src/BlockStorage/v3/Service.php b/src/BlockStorage/v3/Service.php index 9ec33954d..f998d727e 100644 --- a/src/BlockStorage/v3/Service.php +++ b/src/BlockStorage/v3/Service.php @@ -4,5 +4,4 @@ class Service extends \OpenStack\BlockStorage\v2\Service { - -} \ No newline at end of file +} diff --git a/src/Common/Api/AbstractParams.php b/src/Common/Api/AbstractParams.php index 7b7b2c775..a62317ee3 100644 --- a/src/Common/Api/AbstractParams.php +++ b/src/Common/Api/AbstractParams.php @@ -7,21 +7,21 @@ abstract class AbstractParams { // locations - const QUERY = 'query'; - const HEADER = 'header'; - const URL = 'url'; - const JSON = 'json'; - const RAW = 'raw'; + public const QUERY = 'query'; + public const HEADER = 'header'; + public const URL = 'url'; + public const JSON = 'json'; + public const RAW = 'raw'; // types - const STRING_TYPE = 'string'; - const BOOL_TYPE = 'boolean'; - const BOOLEAN_TYPE = self::BOOL_TYPE; - const OBJECT_TYPE = 'object'; - const ARRAY_TYPE = 'array'; - const NULL_TYPE = 'NULL'; - const INT_TYPE = 'integer'; - const INTEGER_TYPE = self::INT_TYPE; + public const STRING_TYPE = 'string'; + public const BOOL_TYPE = 'boolean'; + public const BOOLEAN_TYPE = self::BOOL_TYPE; + public const OBJECT_TYPE = 'object'; + public const ARRAY_TYPE = 'array'; + public const NULL_TYPE = 'NULL'; + public const INT_TYPE = 'integer'; + public const INTEGER_TYPE = self::INT_TYPE; public static function isSupportedLocation(string $val): bool { diff --git a/src/Common/Api/ApiInterface.php b/src/Common/Api/ApiInterface.php index 149c1f03c..86284b42d 100644 --- a/src/Common/Api/ApiInterface.php +++ b/src/Common/Api/ApiInterface.php @@ -7,7 +7,7 @@ /** * All classes which implement this interface are a data representation of a remote OpenStack API. * They do not execute functionality, but instead return data for each API operation for other parts - * of the SDK to use. Usually, the data is injected into {@see OpenStack\Common\Api\Operation} objects. + * of the SDK to use. Usually, the data is injected into {@see Operation} objects. * The operation is then serialized into a {@see GuzzleHttp\Message\Request} and sent to the API. * * The reason for storing all the API-specific data is to decouple service information from client diff --git a/src/Common/Api/Operation.php b/src/Common/Api/Operation.php index 26278927b..d42cb0905 100644 --- a/src/Common/Api/Operation.php +++ b/src/Common/Api/Operation.php @@ -65,8 +65,6 @@ public function hasParam(string $key): bool } /** - * @param $name - * * @return Parameter */ public function getParam(string $name) diff --git a/src/Common/Api/OperatorTrait.php b/src/Common/Api/OperatorTrait.php index 1555c21df..7eed4e1bb 100644 --- a/src/Common/Api/OperatorTrait.php +++ b/src/Common/Api/OperatorTrait.php @@ -20,9 +20,6 @@ trait OperatorTrait /** @var ApiInterface */ protected $api; - /** - * {@inheritdoc} - */ public function __construct(ClientInterface $client, ApiInterface $api) { $this->client = $client; @@ -61,9 +58,9 @@ public function __debugInfo() * @param $methodName the name of the method being invoked * @param $args the arguments to be passed to the sequential method * - * @throws \RuntimeException If method does not exist - * * @return Promise + * + * @throws \RuntimeException If method does not exist */ public function __call($methodName, $args) { @@ -90,17 +87,12 @@ function () use (&$promise, $realMethod, $args) { throw $e($methodName); } - /** - * {@inheritdoc} - */ public function getOperation(array $definition): Operation { return new Operation($definition); } /** - * @return mixed - * * @throws \Exception */ protected function sendRequest(Operation $operation, array $userValues = [], bool $async = false) @@ -119,25 +111,16 @@ protected function sendRequest(Operation $operation, array $userValues = [], boo return $this->client->$method($operation->getMethod(), $uri, $options); } - /** - * {@inheritdoc} - */ public function execute(array $definition, array $userValues = []): ResponseInterface { return $this->sendRequest($this->getOperation($definition), $userValues); } - /** - * {@inheritdoc} - */ public function executeAsync(array $definition, array $userValues = []): PromiseInterface { return $this->sendRequest($this->getOperation($definition), $userValues, true); } - /** - * {@inheritdoc} - */ public function model(string $class, $data = null): ResourceInterface { $model = new $class($this->client, $this->api); diff --git a/src/Common/Api/Parameter.php b/src/Common/Api/Parameter.php index 5d46d7e3c..bfa8d2e0d 100644 --- a/src/Common/Api/Parameter.php +++ b/src/Common/Api/Parameter.php @@ -35,7 +35,7 @@ class Parameter { use HydratorStrategyTrait; - const DEFAULT_LOCATION = 'json'; + public const DEFAULT_LOCATION = 'json'; /** * The human-friendly name of the parameter. This is what the user will input. @@ -304,8 +304,6 @@ public function getLocation(): string /** * Verifies whether the given location matches the parameter's location. - * - * @param $value */ public function hasLocation($value): bool { diff --git a/src/Common/ArrayAccessTrait.php b/src/Common/ArrayAccessTrait.php index cbd709dff..fa9e42f62 100644 --- a/src/Common/ArrayAccessTrait.php +++ b/src/Common/ArrayAccessTrait.php @@ -20,7 +20,6 @@ trait ArrayAccessTrait * Sets an internal key with a value. * * @param string $offset - * @param mixed $value */ public function offsetSet($offset, $value) { diff --git a/src/Common/Error/Builder.php b/src/Common/Error/Builder.php index f7ba9615c..796415a29 100644 --- a/src/Common/Error/Builder.php +++ b/src/Common/Error/Builder.php @@ -33,9 +33,6 @@ class Builder */ private $client; - /** - * @param ClientInterface $client - */ public function __construct(ClientInterface $client = null) { $this->client = $client ?: new Client(); @@ -43,8 +40,6 @@ public function __construct(ClientInterface $client = null) /** * Internal method used when outputting headers in the error description. - * - * @param $name */ private function header(string $name): string { diff --git a/src/Common/JsonPath.php b/src/Common/JsonPath.php index 346da5eda..18019c352 100644 --- a/src/Common/JsonPath.php +++ b/src/Common/JsonPath.php @@ -50,10 +50,6 @@ public function set(string $path, $value) /** * Internal method for recursive calls. * - * @param $path - * @param $value - * @param $json - * * @return mixed */ private function setPath(string $path, $value, array $json): array @@ -76,8 +72,6 @@ private function setPath(string $path, $value, array $json): array /** * Return the updated structure. - * - * @return mixed */ public function getStructure() { @@ -87,8 +81,6 @@ public function getStructure() /** * Get a path's value. If no path can be matched, NULL is returned. * - * @param $path - * * @return mixed|null */ public function get(string $path) @@ -98,9 +90,6 @@ public function get(string $path) /** * Internal method for recursion. - * - * @param $path - * @param $json */ private function getPath(string $path, $json) { diff --git a/src/Common/JsonSchema/JsonPatch.php b/src/Common/JsonSchema/JsonPatch.php index 55f93abe3..cce7c3289 100644 --- a/src/Common/JsonSchema/JsonPatch.php +++ b/src/Common/JsonSchema/JsonPatch.php @@ -6,9 +6,9 @@ class JsonPatch { - const OP_ADD = 'add'; - const OP_REPLACE = 'replace'; - const OP_REMOVE = 'remove'; + public const OP_ADD = 'add'; + public const OP_REPLACE = 'replace'; + public const OP_REMOVE = 'remove'; public static function diff($src, $dest) { diff --git a/src/Common/Resource/Alias.php b/src/Common/Resource/Alias.php index 69746f229..ebd7a6bfd 100644 --- a/src/Common/Resource/Alias.php +++ b/src/Common/Resource/Alias.php @@ -33,11 +33,6 @@ public function __construct(string $propertyName, string $className = null, bool $this->className = $className && class_exists($className) ? $className : null; } - /** - * @param mixed $value - * - * @return mixed - */ public function getValue(ResourceInterface $resource, $value) { if (null === $value || !$this->className) { diff --git a/src/Common/Resource/OperatorResource.php b/src/Common/Resource/OperatorResource.php index 11414e28e..894925986 100644 --- a/src/Common/Resource/OperatorResource.php +++ b/src/Common/Resource/OperatorResource.php @@ -11,7 +11,7 @@ abstract class OperatorResource extends AbstractResource implements OperatorInte { use OperatorTrait; - const DEFAULT_MARKER_KEY = 'id'; + public const DEFAULT_MARKER_KEY = 'id'; /** * The key that indicates how the API nests resource collections. For example, when @@ -47,9 +47,6 @@ protected function getHttpBaseUrl() return $this->client->getConfig('base_uri'); } - /** - * @return mixed - */ public function executeWithState(array $definition) { return $this->execute($definition, $this->getAttrs(array_keys($definition['params']))); @@ -84,7 +81,7 @@ public function enumerate(array $def, array $userVals = [], callable $mapFn = nu return $this->sendRequest($operation, $userVals); }; - $resourceFn = function (array $data) { + $resourceFn = function (array $data) { $resource = $this->newInstance(); $resource->populateFromArray($data); @@ -130,9 +127,6 @@ protected function getService() return new $service($this->client, $this->api); } - /** - * {@inheritdoc} - */ public function model(string $class, $data = null): ResourceInterface { $model = new $class($this->client, $this->api); diff --git a/src/Common/Resource/ResourceInterface.php b/src/Common/Resource/ResourceInterface.php index 346ec2674..4e51c97e5 100644 --- a/src/Common/Resource/ResourceInterface.php +++ b/src/Common/Resource/ResourceInterface.php @@ -15,7 +15,6 @@ interface ResourceInterface * All models which represent an API resource should be able to be populated * from a {@see ResponseInterface} object. * - * @param \Psr\Http\Message\ResponseInterface $response * @return self */ public function populateFromResponse(ResponseInterface $response); @@ -27,9 +26,10 @@ public function populateFromArray(array $data); /** * @template T of \OpenStack\Common\Resource\ResourceInterface + * * @param class-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 + * @param mixed $data either a {@see ResponseInterface} or data array that will populate the newly + * created model class * * @return T */ diff --git a/src/Common/Service/Builder.php b/src/Common/Service/Builder.php index 8103aca7c..4259c255d 100644 --- a/src/Common/Service/Builder.php +++ b/src/Common/Service/Builder.php @@ -70,8 +70,6 @@ private function getClasses($namespace) * @param string $namespace The namespace of the service * @param array $serviceOptions The service-specific options to use * - * @return \OpenStack\Common\Service\ServiceInterface - * * @throws \Exception */ public function createService(string $namespace, array $serviceOptions = []): ServiceInterface diff --git a/src/Common/Transport/HandlerStack.php b/src/Common/Transport/HandlerStack.php index d0205d58d..778149287 100644 --- a/src/Common/Transport/HandlerStack.php +++ b/src/Common/Transport/HandlerStack.php @@ -9,7 +9,7 @@ class HandlerStack extends GuzzleStack { - public static function create(?callable $handler = null): GuzzleStack + public static function create(callable $handler = null): GuzzleStack { $stack = new self($handler ?: Utils::chooseHandler()); $stack->push(Middleware::httpErrors(), 'http_errors'); diff --git a/src/Common/Transport/JsonSerializer.php b/src/Common/Transport/JsonSerializer.php index 5cd2e25bf..0ea5750ab 100644 --- a/src/Common/Transport/JsonSerializer.php +++ b/src/Common/Transport/JsonSerializer.php @@ -87,6 +87,7 @@ public function stockJson(Parameter $param, $userValue, array $json): array } elseif ($param->isObject()) { $userValue = $this->stockObjectJson($param, $this->serializeObjectValue($userValue)); } + // Populate the final value return $this->stockValue($param, $userValue, $json); } @@ -97,7 +98,7 @@ private function serializeObjectValue($value) if ($value instanceof Serializable) { $value = $value->serialize(); } elseif (!($value instanceof \stdClass)) { - throw new \InvalidArgumentException(sprintf('When an object value is provided, it must either be \stdClass or implement the Serializable '.'interface, you provided %s', print_r($value, true))); + throw new \InvalidArgumentException(sprintf('When an object value is provided, it must either be \stdClass or implement the Serializable interface, you provided %s', print_r($value, true))); } } diff --git a/src/Common/Transport/Middleware.php b/src/Common/Transport/Middleware.php index 5f3077ca4..86f701ed9 100644 --- a/src/Common/Transport/Middleware.php +++ b/src/Common/Transport/Middleware.php @@ -31,9 +31,6 @@ function (ResponseInterface $response) use ($request) { }; } - /** - * @param Token $token - */ public static function authHandler(callable $tokenGenerator, Token $token = null): callable { return function (callable $handler) use ($tokenGenerator, $token) { diff --git a/src/Common/Transport/Utils.php b/src/Common/Transport/Utils.php index 35ae5842a..6a52a81a2 100644 --- a/src/Common/Transport/Utils.php +++ b/src/Common/Transport/Utils.php @@ -69,8 +69,6 @@ public static function normalizeUrl(string $url): string /** * Add an unlimited list of paths to a given URI. - * - * @param ...$paths */ public static function addPaths(UriInterface $uri, ...$paths): UriInterface { diff --git a/src/Compute/v2/Enum.php b/src/Compute/v2/Enum.php index 84e8f5912..378445e60 100644 --- a/src/Compute/v2/Enum.php +++ b/src/Compute/v2/Enum.php @@ -9,11 +9,11 @@ */ abstract class Enum { - const REBOOT_SOFT = 'SOFT'; - const REBOOT_HARD = 'HARD'; - const CONSOLE_NOVNC = 'novnc'; - const CONSOLE_XVPNC = 'xvpvnc'; - const CONSOLE_RDP_HTML5 = 'rdp-html5'; - const CONSOLE_SPICE_HTML5 = 'spice-html5'; - const CONSOLE_SERIAL = 'serial'; + public const REBOOT_SOFT = 'SOFT'; + public const REBOOT_HARD = 'HARD'; + public const CONSOLE_NOVNC = 'novnc'; + public const CONSOLE_XVPNC = 'xvpvnc'; + public const CONSOLE_RDP_HTML5 = 'rdp-html5'; + public const CONSOLE_SPICE_HTML5 = 'spice-html5'; + public const CONSOLE_SERIAL = 'serial'; } diff --git a/src/Compute/v2/Models/Flavor.php b/src/Compute/v2/Models/Flavor.php index 1000aad41..c6ea08b68 100644 --- a/src/Compute/v2/Models/Flavor.php +++ b/src/Compute/v2/Models/Flavor.php @@ -41,18 +41,12 @@ class Flavor extends OperatorResource implements Listable, Retrievable, Creatabl protected $resourceKey = 'flavor'; protected $resourcesKey = 'flavors'; - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getFlavor(), ['id' => (string) $this->id]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postFlavors(), $userOptions); @@ -60,9 +54,6 @@ public function create(array $userOptions): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->execute($this->api->deleteFlavor(), ['id' => (string) $this->id]); diff --git a/src/Compute/v2/Models/Host.php b/src/Compute/v2/Models/Host.php index ad6bbc0f1..002502a25 100644 --- a/src/Compute/v2/Models/Host.php +++ b/src/Compute/v2/Models/Host.php @@ -31,9 +31,6 @@ class Host extends OperatorResource implements Listable, Retrievable 'host_name' => 'name', ]; - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getHost(), $this->getAttrs(['name'])); diff --git a/src/Compute/v2/Models/Hypervisor.php b/src/Compute/v2/Models/Hypervisor.php index 6710f9493..0490c9389 100644 --- a/src/Compute/v2/Models/Hypervisor.php +++ b/src/Compute/v2/Models/Hypervisor.php @@ -94,9 +94,6 @@ class Hypervisor extends OperatorResource implements Retrievable, Listable 'disk_available_least' => 'diskAvailableLeast', ]; - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getHypervisor(), ['id' => (string) $this->id]); diff --git a/src/Compute/v2/Models/Image.php b/src/Compute/v2/Models/Image.php index 5bd88134b..e4614cdde 100644 --- a/src/Compute/v2/Models/Image.php +++ b/src/Compute/v2/Models/Image.php @@ -53,9 +53,6 @@ class Image extends OperatorResource implements Listable, Retrievable, Deletable protected $resourceKey = 'image'; protected $resourcesKey = 'images'; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -64,18 +61,12 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getImage(), ['id' => (string) $this->id]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->execute($this->api->deleteImage(), ['id' => (string) $this->id]); @@ -120,8 +111,6 @@ public function mergeMetadata(array $metadata) * Retrieve the value for a specific metadata key. * * @param string $key {@see \OpenStack\Compute\v2\Api::getImageMetadataKey} - * - * @return mixed */ public function getMetadataItem(string $key) { diff --git a/src/Compute/v2/Models/Keypair.php b/src/Compute/v2/Models/Keypair.php index 61c178659..f5c37c763 100644 --- a/src/Compute/v2/Models/Keypair.php +++ b/src/Compute/v2/Models/Keypair.php @@ -56,9 +56,6 @@ class Keypair extends OperatorResource implements Listable, Retrievable, Deletab protected $resourceKey = 'keypair'; protected $resourcesKey = 'keypairs'; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -66,18 +63,12 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getKeypair(), $this->getAttrs(['name', 'userId'])); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postKeypair(), $userOptions); @@ -85,17 +76,11 @@ public function create(array $userOptions): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function populateFromArray(array $array): self { return parent::populateFromArray(Utils::flattenJson($array, $this->resourceKey)); } - /** - * {@inheritdoc} - */ public function delete() { $this->execute($this->api->deleteKeypair(), ['name' => (string) $this->name]); diff --git a/src/Compute/v2/Models/QuotaSet.php b/src/Compute/v2/Models/QuotaSet.php index 719375d54..9b44511fb 100644 --- a/src/Compute/v2/Models/QuotaSet.php +++ b/src/Compute/v2/Models/QuotaSet.php @@ -147,27 +147,18 @@ class QuotaSet extends OperatorResource implements Retrievable, Updateable, Dele 'server_groups' => 'serverGroups', ]; - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getQuotaSet(), ['tenantId' => (string) $this->tenantId]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $response = $this->executeWithState($this->api->deleteQuotaSet()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->putQuotaSet()); diff --git a/src/Compute/v2/Models/Server.php b/src/Compute/v2/Models/Server.php index 85ab5c353..96a88b126 100644 --- a/src/Compute/v2/Models/Server.php +++ b/src/Compute/v2/Models/Server.php @@ -113,9 +113,6 @@ class Server extends OperatorResource implements Creatable, Updateable, Deletabl 'OS-EXT-SRV-ATTR:hypervisor_hostname' => 'hypervisorHostname', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -127,8 +124,6 @@ protected function getAliases(): array } /** - * {@inheritdoc} - * * @param array $userOptions {@see \OpenStack\Compute\v2\Api::postServer} */ public function create(array $userOptions): Creatable @@ -142,26 +137,17 @@ public function create(array $userOptions): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->execute($this->api->putServer(), $this->getAttrs(['id', 'name', 'ipv4', 'ipv6'])); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->execute($this->api->deleteServer(), $this->getAttrs(['id'])); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getServer(), $this->getAttrs(['id'])); @@ -485,8 +471,6 @@ public function mergeMetadata(array $metadata) * Retrieve the value for a specific metadata key. * * @param string $key {@see \OpenStack\Compute\v2\Api::getServerMetadataKey} - * - * @return mixed */ public function getMetadataItem(string $key) { @@ -563,8 +547,6 @@ public function listVolumeAttachments(): \Generator /** * Attach a volume and returns volume that was attached. - * - * @param $volumeId */ public function attachVolume(string $volumeId): VolumeAttachment { @@ -575,8 +557,6 @@ public function attachVolume(string $volumeId): VolumeAttachment /** * Detach a volume. - * - * @param $attachmentId */ public function detachVolume(string $attachmentId) { diff --git a/src/Compute/v2/Service.php b/src/Compute/v2/Service.php index 3d39c3de1..05e7149ee 100644 --- a/src/Compute/v2/Service.php +++ b/src/Compute/v2/Service.php @@ -19,7 +19,7 @@ /** * Compute v2 service for OpenStack. * - * @property \OpenStack\Compute\v2\Api $api + * @property Api $api */ class Service extends AbstractService { @@ -41,6 +41,7 @@ public function createServer(array $options): Server * the ID, name and links attributes are returned, saving bandwidth. * @param array $options {@see \OpenStack\Compute\v2\Api::getServers} * @param callable $mapFn a callable function that will be invoked on every iteration of the list + * * @return \Generator */ public function listServers(bool $detailed = false, array $options = [], callable $mapFn = null): \Generator @@ -74,6 +75,7 @@ public function getServer(array $options = []): Server * @param array $options {@see \OpenStack\Compute\v2\Api::getFlavors} * @param callable $mapFn a callable function that will be invoked on every iteration of the list * @param bool $detailed set to true to fetch flavors' details + * * @return \Generator */ public function listFlavors(array $options = [], callable $mapFn = null, bool $detailed = false): \Generator @@ -114,6 +116,7 @@ public function createFlavor(array $options = []): Flavor * * @param array $options {@see \OpenStack\Compute\v2\Api::getImages} * @param callable $mapFn a callable function that will be invoked on every iteration of the list + * * @return \Generator */ public function listImages(array $options = [], callable $mapFn = null): \Generator @@ -142,6 +145,7 @@ public function getImage(array $options = []): Image * * @param array $options {@see \OpenStack\Compute\v2\Api::getKeyPairs} * @param callable $mapFn a callable function that will be invoked on every iteration of the list + * * @return \Generator */ public function listKeypairs(array $options = [], callable $mapFn = null): \Generator @@ -197,6 +201,7 @@ public function getHypervisorStatistics(): HypervisorStatistic * the ID, name and links attributes are returned, saving bandwidth. * @param array $options {@see \OpenStack\Compute\v2\Api::getHypervisors} * @param callable $mapFn a callable function that will be invoked on every iteration of the list + * * @return \Generator */ public function listHypervisors(bool $detailed = false, array $options = [], callable $mapFn = null): \Generator @@ -221,6 +226,7 @@ public function getHypervisor(array $options = []): Hypervisor * * @param array $options {@see \OpenStack\Compute\v2\Api::getHosts} * @param callable $mapFn a callable function that will be invoked on every iteration of the list + * * @return \Generator */ public function listHosts(array $options = [], callable $mapFn = null): \Generator @@ -251,6 +257,7 @@ public function getHost(array $options = []): Host * * @param array $options {@see \OpenStack\Compute\v2\Api::getAvailabilityZones} * @param callable $mapFn a callable function that will be invoked on every iteration of the list + * * @return \Generator */ public function listAvailabilityZones(array $options = [], callable $mapFn = null): \Generator diff --git a/src/Identity/v2/Models/Catalog.php b/src/Identity/v2/Models/Catalog.php index 247c9fafc..91de2d2bc 100644 --- a/src/Identity/v2/Models/Catalog.php +++ b/src/Identity/v2/Models/Catalog.php @@ -14,7 +14,7 @@ */ class Catalog extends OperatorResource implements \OpenStack\Common\Auth\Catalog { - const DEFAULT_URL_TYPE = 'publicURL'; + public const DEFAULT_URL_TYPE = 'publicURL'; /** * The catalog entries. @@ -23,9 +23,6 @@ class Catalog extends OperatorResource implements \OpenStack\Common\Auth\Catalog */ public $entries = []; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -33,9 +30,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function populateFromResponse(ResponseInterface $response): self { $entries = Utils::jsonDecode($response)['access']['serviceCatalog']; diff --git a/src/Identity/v2/Models/Entry.php b/src/Identity/v2/Models/Entry.php index 650428770..2c101688a 100644 --- a/src/Identity/v2/Models/Entry.php +++ b/src/Identity/v2/Models/Entry.php @@ -21,9 +21,6 @@ class Entry extends OperatorResource /** @var []Endpoint */ public $endpoints = []; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ diff --git a/src/Identity/v2/Models/Token.php b/src/Identity/v2/Models/Token.php index 4599caf6f..35281b4b2 100644 --- a/src/Identity/v2/Models/Token.php +++ b/src/Identity/v2/Models/Token.php @@ -26,9 +26,6 @@ class Token extends OperatorResource implements \OpenStack\Common\Auth\Token /** @var Tenant */ public $tenant; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -38,9 +35,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function populateFromResponse(ResponseInterface $response): self { $this->populateFromArray(Utils::jsonDecode($response)['access']['token']); diff --git a/src/Identity/v2/Service.php b/src/Identity/v2/Service.php index cded85fa5..620f6b948 100644 --- a/src/Identity/v2/Service.php +++ b/src/Identity/v2/Service.php @@ -13,7 +13,7 @@ /** * Represents the OpenStack Identity v2 service. * - * @property \OpenStack\Identity\v2\Api $api + * @property Api $api */ class Service extends AbstractService implements IdentityService { @@ -44,8 +44,6 @@ public function authenticate(array $options = []): array * Generates a new authentication token. * * @param array $options {@see \OpenStack\Identity\v2\Api::postToken} - * - * @return Models\Token */ public function generateToken(array $options = []): Token { diff --git a/src/Identity/v3/Enum.php b/src/Identity/v3/Enum.php index 1a6b1c60a..60401a2b2 100644 --- a/src/Identity/v3/Enum.php +++ b/src/Identity/v3/Enum.php @@ -6,7 +6,7 @@ abstract class Enum { - const INTERFACE_INTERNAL = 'internal'; - const INTERFACE_PUBLIC = 'public'; - const INTERFACE_ADMIN = 'admin'; + public const INTERFACE_INTERNAL = 'internal'; + public const INTERFACE_PUBLIC = 'public'; + public const INTERFACE_ADMIN = 'admin'; } diff --git a/src/Identity/v3/Models/Assignment.php b/src/Identity/v3/Models/Assignment.php index e4bb157cf..26032a5fe 100644 --- a/src/Identity/v3/Models/Assignment.php +++ b/src/Identity/v3/Models/Assignment.php @@ -25,9 +25,6 @@ class Assignment extends OperatorResource implements Listable protected $resourcesKey = 'role_assignments'; protected $resourceKey = 'role_assignment'; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ diff --git a/src/Identity/v3/Models/Catalog.php b/src/Identity/v3/Models/Catalog.php index 3dc784533..d208d7b6a 100644 --- a/src/Identity/v3/Models/Catalog.php +++ b/src/Identity/v3/Models/Catalog.php @@ -15,9 +15,6 @@ class Catalog extends OperatorResource implements \OpenStack\Common\Auth\Catalog /** @var []Service */ public $services; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ diff --git a/src/Identity/v3/Models/Credential.php b/src/Identity/v3/Models/Credential.php index ab844b3e4..5bbd28e11 100644 --- a/src/Identity/v3/Models/Credential.php +++ b/src/Identity/v3/Models/Credential.php @@ -39,9 +39,6 @@ class Credential extends OperatorResource implements Creatable, Updateable, Retr 'user_id' => 'userId', ]; - /** - * {@inheritdoc} - */ public function create(array $data): Creatable { $response = $this->execute($this->api->postCredentials(), $data); @@ -49,27 +46,18 @@ public function create(array $data): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->executeWithState($this->api->getCredential()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->patchCredential()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteCredential()); diff --git a/src/Identity/v3/Models/Domain.php b/src/Identity/v3/Models/Domain.php index 83263ef99..332503e99 100644 --- a/src/Identity/v3/Models/Domain.php +++ b/src/Identity/v3/Models/Domain.php @@ -36,8 +36,6 @@ class Domain extends OperatorResource implements Creatable, Listable, Retrievabl protected $resourcesKey = 'domains'; /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\Identity\v3\Api::postDomains} */ public function create(array $data): Creatable @@ -47,27 +45,18 @@ public function create(array $data): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->executeWithState($this->api->getDomain()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->patchDomain()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteDomain()); @@ -75,6 +64,7 @@ public function delete() /** * @param array $options {@see \OpenStack\Identity\v3\Api::getUserRoles} + * * @return \Generator */ public function listUserRoles(array $options = []): \Generator @@ -116,6 +106,7 @@ public function revokeUserRole(array $options = []) /** * @param array $options {@see \OpenStack\Identity\v3\Api::getGroupRoles} + * * @return \Generator */ public function listGroupRoles(array $options = []): \Generator diff --git a/src/Identity/v3/Models/Endpoint.php b/src/Identity/v3/Models/Endpoint.php index 5fe0a5bc2..1f496fba5 100644 --- a/src/Identity/v3/Models/Endpoint.php +++ b/src/Identity/v3/Models/Endpoint.php @@ -41,8 +41,6 @@ class Endpoint extends OperatorResource implements Creatable, Updateable, Deleta protected $aliases = ['service_id' => 'serviceId']; /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\Identity\v3\Api::postEndpoints} */ public function create(array $data): Creatable @@ -52,27 +50,18 @@ public function create(array $data): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->executeWithState($this->api->getEndpoint()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->patchEndpoint()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->execute($this->api->deleteEndpoint(), $this->getAttrs(['id'])); diff --git a/src/Identity/v3/Models/Group.php b/src/Identity/v3/Models/Group.php index 2854a92aa..c6869dea6 100644 --- a/src/Identity/v3/Models/Group.php +++ b/src/Identity/v3/Models/Group.php @@ -38,8 +38,6 @@ class Group extends OperatorResource implements Creatable, Listable, Retrievable protected $resourcesKey = 'groups'; /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\Identity\v3\Api::postGroups} */ public function create(array $data): Creatable @@ -49,27 +47,18 @@ public function create(array $data): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getGroup(), ['id' => $this->id]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->patchGroup()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->execute($this->api->deleteGroup(), ['id' => $this->id]); @@ -77,6 +66,7 @@ public function delete() /** * @param array $options {@see \OpenStack\Identity\v3\Api::getGroupUsers} + * * @return \Generator */ public function listUsers(array $options = []): \Generator diff --git a/src/Identity/v3/Models/Policy.php b/src/Identity/v3/Models/Policy.php index 121688292..1ccca4f0a 100644 --- a/src/Identity/v3/Models/Policy.php +++ b/src/Identity/v3/Models/Policy.php @@ -43,8 +43,6 @@ class Policy extends OperatorResource implements Creatable, Listable, Retrievabl ]; /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\Identity\v3\Api::postPolicies} */ public function create(array $data): Creatable @@ -54,27 +52,18 @@ public function create(array $data): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getPolicy(), ['id' => $this->id]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->patchPolicy()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->execute($this->api->deletePolicy(), ['id' => $this->id]); diff --git a/src/Identity/v3/Models/Project.php b/src/Identity/v3/Models/Project.php index 68beb3ce8..8d58c2236 100644 --- a/src/Identity/v3/Models/Project.php +++ b/src/Identity/v3/Models/Project.php @@ -47,8 +47,6 @@ class Project extends OperatorResource implements Creatable, Retrievable, Listab protected $resourcesKey = 'projects'; /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\Identity\v3\Api::postProjects} */ public function create(array $data): Creatable @@ -59,27 +57,18 @@ public function create(array $data): Creatable return $this; } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->executeWithState($this->api->getProject()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->patchProject()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteProject()); @@ -87,6 +76,7 @@ public function delete() /** * @param array $options {@see \OpenStack\Identity\v3\Api::getProjectUserRoles} + * * @return \Generator */ public function listUserRoles(array $options = []): \Generator @@ -128,6 +118,7 @@ public function revokeUserRole(array $options) /** * @param array $options {@see \OpenStack\Identity\v3\Api::getProjectGroupRoles} + * * @return \Generator */ public function listGroupRoles(array $options = []): \Generator diff --git a/src/Identity/v3/Models/Role.php b/src/Identity/v3/Models/Role.php index 907b1005d..d2236311b 100644 --- a/src/Identity/v3/Models/Role.php +++ b/src/Identity/v3/Models/Role.php @@ -27,8 +27,6 @@ class Role extends OperatorResource implements Creatable, Listable, Deletable protected $resourcesKey = 'roles'; /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\Identity\v3\Api::postRoles} */ public function create(array $data): Creatable @@ -38,9 +36,6 @@ public function create(array $data): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteRole()); diff --git a/src/Identity/v3/Models/Service.php b/src/Identity/v3/Models/Service.php index 67d0b5f7b..6a257dce0 100644 --- a/src/Identity/v3/Models/Service.php +++ b/src/Identity/v3/Models/Service.php @@ -38,9 +38,6 @@ class Service extends OperatorResource implements Creatable, Listable, Retrievab protected $resourceKey = 'service'; protected $resourcesKey = 'services'; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -49,8 +46,6 @@ protected function getAliases(): array } /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\Identity\v3\Api::postServices} */ public function create(array $data): Creatable @@ -60,27 +55,18 @@ public function create(array $data): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->executeWithState($this->api->getService()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->patchService()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteService()); diff --git a/src/Identity/v3/Models/Token.php b/src/Identity/v3/Models/Token.php index b3808a54d..56bfcd880 100644 --- a/src/Identity/v3/Models/Token.php +++ b/src/Identity/v3/Models/Token.php @@ -31,7 +31,6 @@ class Token extends OperatorResource implements Creatable, Retrievable, \OpenSta /** @var Catalog */ public $catalog; - /** @var mixed */ public $extras; /** @var User */ @@ -48,9 +47,6 @@ class Token extends OperatorResource implements Creatable, Retrievable, \OpenSta protected $cachedToken; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -63,9 +59,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function populateFromResponse(ResponseInterface $response) { parent::populateFromResponse($response); @@ -87,9 +80,6 @@ public function hasExpired(): bool return $this->expires <= new \DateTimeImmutable('now', $this->expires->getTimezone()); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getTokens(), ['tokenId' => $this->id]); @@ -97,8 +87,6 @@ public function retrieve() } /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\Identity\v3\Api::postTokens} */ public function create(array $data): Creatable @@ -106,7 +94,7 @@ public function create(array $data): Creatable if (isset($data['user'])) { $data['methods'] = ['password']; if (!isset($data['user']['id']) && empty($data['user']['domain'])) { - throw new \InvalidArgumentException('When authenticating with a username, you must also provide either the domain name or domain ID to '.'which the user belongs to. Alternatively, if you provide a user ID instead, you do not need to '.'provide domain information.'); + throw new \InvalidArgumentException('When authenticating with a username, you must also provide either the domain name or domain ID to which the user belongs to. Alternatively, if you provide a user ID instead, you do not need to provide domain information.'); } } elseif (isset($data['tokenId'])) { $data['methods'] = ['token']; diff --git a/src/Identity/v3/Models/User.php b/src/Identity/v3/Models/User.php index fb9480a1f..7d5f6dd0a 100644 --- a/src/Identity/v3/Models/User.php +++ b/src/Identity/v3/Models/User.php @@ -49,8 +49,6 @@ class User extends OperatorResource implements Creatable, Listable, Retrievable, protected $resourcesKey = 'users'; /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\Identity\v3\Api::postUsers} */ public function create(array $data): Creatable @@ -60,27 +58,18 @@ public function create(array $data): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getUser(), ['id' => $this->id]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->patchUser()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->execute($this->api->deleteUser(), ['id' => $this->id]); diff --git a/src/Identity/v3/Service.php b/src/Identity/v3/Service.php index fd6fa07e9..1f67f28bc 100644 --- a/src/Identity/v3/Service.php +++ b/src/Identity/v3/Service.php @@ -12,7 +12,7 @@ /** * Represents the Keystone v3 service. * - * @property \OpenStack\Identity\v3\Api $api + * @property Api $api */ class Service extends AbstractService implements IdentityService { @@ -128,6 +128,7 @@ public function createService(array $options): Models\Service * will need to use retrieve() to pull in the full state of the remote resource from the API. * * @param array $options {@see \OpenStack\Identity\v3\Api::getServices} + * * @return \Generator */ public function listServices(array $options = []): \Generator @@ -173,6 +174,7 @@ public function getEndpoint(string $id): Models\Endpoint * will need to use retrieve() to pull in the full state of the remote resource from the API. * * @param array $options {@see \OpenStack\Identity\v3\Api::getEndpoints} + * * @return \Generator */ public function listEndpoints(array $options = []): \Generator @@ -196,6 +198,7 @@ public function createDomain(array $options): Models\Domain * will need to use retrieve() to pull in the full state of the remote resource from the API. * * @param array $options {@see \OpenStack\Identity\v3\Api::getDomains} + * * @return \Generator */ public function listDomains(array $options = []): \Generator @@ -230,6 +233,7 @@ public function createProject(array $options): Models\Project * will need to use retrieve() to pull in the full state of the remote resource from the API. * * @param array $options {@see \OpenStack\Identity\v3\Api::getProjects} + * * @return \Generator */ public function listProjects(array $options = []): \Generator @@ -264,6 +268,7 @@ public function createUser(array $options): Models\User * will need to use retrieve() to pull in the full state of the remote resource from the API. * * @param array $options {@see \OpenStack\Identity\v3\Api::getUsers} + * * @return \Generator */ public function listUsers(array $options = []): \Generator @@ -298,6 +303,7 @@ public function createGroup(array $options): Models\Group * will need to use retrieve() to pull in the full state of the remote resource from the API. * * @param array $options {@see \OpenStack\Identity\v3\Api::getGroups} + * * @return \Generator */ public function listGroups(array $options = []): \Generator @@ -365,6 +371,7 @@ public function createRole(array $options): Models\Role * will need to use retrieve() to pull in the full state of the remote resource from the API. * * @param array $options {@see \OpenStack\Identity\v3\Api::getRoles} + * * @return \Generator */ public function listRoles(array $options = []): \Generator @@ -378,6 +385,7 @@ public function listRoles(array $options = []): \Generator * collections; you will need to use retrieve() to pull in the full state of the remote resource from the API. * * @param array $options {@see \OpenStack\Identity\v3\Api::getRoleAssignments} + * * @return \Generator */ public function listRoleAssignments(array $options = []): \Generator @@ -401,6 +409,7 @@ public function createPolicy(array $options): Models\Policy * will need to use retrieve() to pull in the full state of the remote resource from the API. * * @param array $options {@see \OpenStack\Identity\v3\Api::getPolicies} + * * @return \Generator */ public function listPolicies(array $options = []): \Generator diff --git a/src/Images/v2/Models/Image.php b/src/Images/v2/Models/Image.php index 6cf172cfd..9cff176b6 100644 --- a/src/Images/v2/Models/Image.php +++ b/src/Images/v2/Models/Image.php @@ -85,9 +85,6 @@ class Image extends OperatorResource implements Creatable, Listable, Retrievable 'virtual_size' => 'virtualSize', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -115,9 +112,6 @@ public function populateFromArray(array $data): self return $this; } - /** - * {@inheritdoc} - */ public function create(array $data): Creatable { $response = $this->execute($this->api->postImages(), $data); diff --git a/src/Images/v2/Models/Member.php b/src/Images/v2/Models/Member.php index 4b6c6dbb7..9023d2817 100644 --- a/src/Images/v2/Models/Member.php +++ b/src/Images/v2/Models/Member.php @@ -16,9 +16,9 @@ */ class Member extends OperatorResource implements Creatable, Listable, Retrievable, Deletable { - const STATUS_ACCEPTED = 'accepted'; - const STATUS_PENDING = 'pending'; - const STATUS_REJECTED = 'rejected'; + public const STATUS_ACCEPTED = 'accepted'; + public const STATUS_PENDING = 'pending'; + public const STATUS_REJECTED = 'rejected'; /** @var string */ public $imageId; @@ -43,9 +43,6 @@ class Member extends OperatorResource implements Creatable, Listable, Retrievabl 'image_id' => 'imageId', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -54,9 +51,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $response = $this->executeWithState($this->api->postImageMembers()); diff --git a/src/Metric/v1/Gnocchi/Models/Metric.php b/src/Metric/v1/Gnocchi/Models/Metric.php index 71b489caa..9ad76011f 100644 --- a/src/Metric/v1/Gnocchi/Models/Metric.php +++ b/src/Metric/v1/Gnocchi/Models/Metric.php @@ -40,9 +40,6 @@ class Metric extends OperatorResource implements Retrievable 'archive_policy' => 'archivePolicy', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -50,9 +47,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->executeWithState($this->api->getMetric()); diff --git a/src/Metric/v1/Gnocchi/Models/Resource.php b/src/Metric/v1/Gnocchi/Models/Resource.php index c6041dcd3..06c2d6940 100644 --- a/src/Metric/v1/Gnocchi/Models/Resource.php +++ b/src/Metric/v1/Gnocchi/Models/Resource.php @@ -14,21 +14,21 @@ */ class Resource extends OperatorResource implements Retrievable { - const RESOURCE_TYPE_GENERIC = 'generic'; - const RESOURCE_TYPE_CEPH_ACCOUNT = 'ceph_account'; - const RESOURCE_TYPE_HOST = 'host'; - const RESOURCE_TYPE_HOST_DISK = 'host_disk'; - const RESOURCE_TYPE_HOST_NETWORK_INTERFACE = 'host_network_interface'; - const RESOURCE_TYPE_IDENTITY = 'identity'; - const RESOURCE_TYPE_IMAGE = 'image'; - const RESOURCE_TYPE_INSTANCE = 'instance'; - const RESOURCE_TYPE_INSTANCE_DISK = 'instance_disk'; - const RESOURCE_TYPE_INSTANCE_NETWORK_INTERFACE = 'instance_network_interface'; - const RESOURCE_TYPE_IPMI = 'ipmi'; - const RESOURCE_TYPE_NETWORK = 'network'; - const RESOURCE_TYPE_STACK = 'stack'; - const RESOURCE_TYPE_SWIFT_ACCOUNT = 'swift_account'; - const RESOURCE_TYPE_VOLUME = 'volume'; + public const RESOURCE_TYPE_GENERIC = 'generic'; + public const RESOURCE_TYPE_CEPH_ACCOUNT = 'ceph_account'; + public const RESOURCE_TYPE_HOST = 'host'; + public const RESOURCE_TYPE_HOST_DISK = 'host_disk'; + public const RESOURCE_TYPE_HOST_NETWORK_INTERFACE = 'host_network_interface'; + public const RESOURCE_TYPE_IDENTITY = 'identity'; + public const RESOURCE_TYPE_IMAGE = 'image'; + public const RESOURCE_TYPE_INSTANCE = 'instance'; + public const RESOURCE_TYPE_INSTANCE_DISK = 'instance_disk'; + public const RESOURCE_TYPE_INSTANCE_NETWORK_INTERFACE = 'instance_network_interface'; + public const RESOURCE_TYPE_IPMI = 'ipmi'; + public const RESOURCE_TYPE_NETWORK = 'network'; + public const RESOURCE_TYPE_STACK = 'stack'; + public const RESOURCE_TYPE_SWIFT_ACCOUNT = 'swift_account'; + public const RESOURCE_TYPE_VOLUME = 'volume'; /** @var string */ public $createdByUserId; @@ -138,6 +138,7 @@ public function getMetricMeasures(array $options = []): array /** * @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::getResourceMetrics} + * * @return \Generator */ public function listResourceMetrics(array $options = []): \Generator diff --git a/src/Metric/v1/Gnocchi/Service.php b/src/Metric/v1/Gnocchi/Service.php index 6e418b146..61be0e282 100644 --- a/src/Metric/v1/Gnocchi/Service.php +++ b/src/Metric/v1/Gnocchi/Service.php @@ -18,6 +18,7 @@ class Service extends AbstractService { /** * Retrieves a collection of \OpenStack\Metric\v1\Gnocchi\Models\ResourceType type in a generator format. + * * @return \Generator */ public function listResourceTypes(): \Generator @@ -29,6 +30,7 @@ public function listResourceTypes(): \Generator * Retrieves a collection of \OpenStack\Metric\v1\Gnocchi\Models\Resource type in a generator format. * * @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::getResources} + * * @return \Generator */ public function listResources(array $options = []): \Generator @@ -57,6 +59,7 @@ public function getResource(array $options = []): Resource * Retrieves a collection of \OpenStack\Metric\v1\Gnocchi\Models\Resource type in a generator format. * * @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::searchResources} + * * @return \Generator */ public function searchResources(array $options = []): \Generator @@ -97,6 +100,7 @@ public function getMetric(string $id): Metric * Retrieves a collection of Metric type in a generator format. * * @param array $options {@see \OpenStack\Metric\v1\Gnocchi\Api::getMetrics} + * * @return \Generator */ public function listMetrics(array $options = []): \Generator diff --git a/src/Networking/v2/Extensions/Layer3/Models/FloatingIp.php b/src/Networking/v2/Extensions/Layer3/Models/FloatingIp.php index 048b942b2..07dc0ddba 100644 --- a/src/Networking/v2/Extensions/Layer3/Models/FloatingIp.php +++ b/src/Networking/v2/Extensions/Layer3/Models/FloatingIp.php @@ -51,9 +51,6 @@ class FloatingIp extends OperatorResource implements Listable, Creatable, Retrie protected $resourceKey = 'floatingip'; protected $resourcesKey = 'floatingips'; - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postFloatingIps(), $userOptions); diff --git a/src/Networking/v2/Extensions/Layer3/Models/GatewayInfo.php b/src/Networking/v2/Extensions/Layer3/Models/GatewayInfo.php index 0614fe05d..9fff1ed72 100644 --- a/src/Networking/v2/Extensions/Layer3/Models/GatewayInfo.php +++ b/src/Networking/v2/Extensions/Layer3/Models/GatewayInfo.php @@ -21,9 +21,6 @@ class GatewayInfo extends AbstractResource 'enable_snat' => 'enableSnat', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ diff --git a/src/Networking/v2/Extensions/Layer3/Models/Router.php b/src/Networking/v2/Extensions/Layer3/Models/Router.php index 63e89bbe4..883c46e8a 100644 --- a/src/Networking/v2/Extensions/Layer3/Models/Router.php +++ b/src/Networking/v2/Extensions/Layer3/Models/Router.php @@ -47,9 +47,6 @@ class Router extends OperatorResource implements Listable, Creatable, Retrievabl 'tenant_id' => 'tenantId', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -57,9 +54,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postRouters(), $userOptions); diff --git a/src/Networking/v2/Extensions/SecurityGroups/Models/SecurityGroup.php b/src/Networking/v2/Extensions/SecurityGroups/Models/SecurityGroup.php index 20516227a..215fad49d 100644 --- a/src/Networking/v2/Extensions/SecurityGroups/Models/SecurityGroup.php +++ b/src/Networking/v2/Extensions/SecurityGroups/Models/SecurityGroup.php @@ -51,9 +51,6 @@ class SecurityGroup extends OperatorResource implements Creatable, Listable, Del protected $resourceKey = 'security_group'; protected $resourcesKey = 'security_groups'; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -62,9 +59,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postSecurityGroups(), $userOptions); @@ -72,17 +66,11 @@ public function create(array $userOptions): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteSecurityGroup()); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->executeWithState($this->api->getSecurityGroup()); diff --git a/src/Networking/v2/Extensions/SecurityGroups/Models/SecurityGroupRule.php b/src/Networking/v2/Extensions/SecurityGroups/Models/SecurityGroupRule.php index a7da99bdc..825a2f518 100644 --- a/src/Networking/v2/Extensions/SecurityGroups/Models/SecurityGroupRule.php +++ b/src/Networking/v2/Extensions/SecurityGroups/Models/SecurityGroupRule.php @@ -80,9 +80,6 @@ class SecurityGroupRule extends OperatorResource implements Creatable, Listable, protected $resourcesKey = 'security_group_rules'; - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postSecurityRules(), $userOptions); @@ -90,17 +87,11 @@ public function create(array $userOptions): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteSecurityRule()); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->executeWithState($this->api->getSecurityRule()); diff --git a/src/Networking/v2/Extensions/SecurityGroups/Service.php b/src/Networking/v2/Extensions/SecurityGroups/Service.php index 088efd152..4cc69d664 100644 --- a/src/Networking/v2/Extensions/SecurityGroups/Service.php +++ b/src/Networking/v2/Extensions/SecurityGroups/Service.php @@ -22,7 +22,6 @@ private function securityGroupRule(array $info = []): SecurityGroupRule } /** - * @param array $options * @return \Generator */ public function listSecurityGroups(array $options = []): \Generator diff --git a/src/Networking/v2/Models/LoadBalancer.php b/src/Networking/v2/Models/LoadBalancer.php index 42671b3df..70df8063d 100644 --- a/src/Networking/v2/Models/LoadBalancer.php +++ b/src/Networking/v2/Models/LoadBalancer.php @@ -81,9 +81,6 @@ class LoadBalancer extends OperatorResource implements Creatable, Retrievable, U 'provisioning_status' => 'provisioningStatus', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -91,9 +88,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postLoadBalancer(), $userOptions); @@ -101,27 +95,18 @@ public function create(array $userOptions): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getLoadBalancer(), ['id' => (string) $this->id]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->putLoadBalancer()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteLoadBalancer()); diff --git a/src/Networking/v2/Models/LoadBalancerHealthMonitor.php b/src/Networking/v2/Models/LoadBalancerHealthMonitor.php index 1322e589b..bc25dfddf 100644 --- a/src/Networking/v2/Models/LoadBalancerHealthMonitor.php +++ b/src/Networking/v2/Models/LoadBalancerHealthMonitor.php @@ -104,9 +104,6 @@ class LoadBalancerHealthMonitor extends OperatorResource implements Creatable, R 'provisioning_status' => 'provisioningStatus', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -114,9 +111,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postLoadBalancerHealthMonitor(), $userOptions); @@ -124,27 +118,18 @@ public function create(array $userOptions): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getLoadBalancerHealthMonitor(), ['id' => (string) $this->id]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->putLoadBalancerHealthMonitor()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteLoadBalancerHealthMonitor()); diff --git a/src/Networking/v2/Models/LoadBalancerListener.php b/src/Networking/v2/Models/LoadBalancerListener.php index 2ab1254b3..bc8175063 100644 --- a/src/Networking/v2/Models/LoadBalancerListener.php +++ b/src/Networking/v2/Models/LoadBalancerListener.php @@ -103,9 +103,6 @@ class LoadBalancerListener extends OperatorResource implements Creatable, Retrie 'provisioning_status' => 'provisioningStatus', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -114,9 +111,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postLoadBalancerListener(), $userOptions); @@ -124,27 +118,18 @@ public function create(array $userOptions): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getLoadBalancerListener(), ['id' => (string) $this->id]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->putLoadBalancerListener()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteLoadBalancerListener()); diff --git a/src/Networking/v2/Models/LoadBalancerMember.php b/src/Networking/v2/Models/LoadBalancerMember.php index a8d01c2b1..a4835bd10 100644 --- a/src/Networking/v2/Models/LoadBalancerMember.php +++ b/src/Networking/v2/Models/LoadBalancerMember.php @@ -81,9 +81,6 @@ class LoadBalancerMember extends OperatorResource implements Creatable, Retrieva 'provisioning_status' => 'provisioningStatus', ]; - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $userOptions = array_merge(['poolId' => $this->poolId], $userOptions); @@ -92,27 +89,18 @@ public function create(array $userOptions): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getLoadBalancerMember(), ['poolId' => (string) $this->poolId, 'id' => (string) $this->id]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->putLoadBalancerMember(), ['poolId' => (string) $this->poolId, 'id' => (string) $this->id]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteLoadBalancerMember(), ['poolId' => (string) $this->poolId, 'id' => (string) $this->id]); diff --git a/src/Networking/v2/Models/LoadBalancerPool.php b/src/Networking/v2/Models/LoadBalancerPool.php index b18816524..195c0e7cf 100644 --- a/src/Networking/v2/Models/LoadBalancerPool.php +++ b/src/Networking/v2/Models/LoadBalancerPool.php @@ -103,9 +103,6 @@ class LoadBalancerPool extends OperatorResource implements Creatable, Retrievabl 'provisioning_status' => 'provisioningStatus', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -115,9 +112,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postLoadBalancerPool(), $userOptions); @@ -125,27 +119,18 @@ public function create(array $userOptions): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getLoadBalancerPool(), ['id' => (string) $this->id]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->putLoadBalancerPool()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteLoadBalancerPool()); diff --git a/src/Networking/v2/Models/LoadBalancerStat.php b/src/Networking/v2/Models/LoadBalancerStat.php index 4b34a91f4..0bde1af10 100644 --- a/src/Networking/v2/Models/LoadBalancerStat.php +++ b/src/Networking/v2/Models/LoadBalancerStat.php @@ -49,9 +49,6 @@ class LoadBalancerStat extends OperatorResource implements Retrievable 'loadbalancer_id' => 'loadbalancerId', ]; - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getLoadBalancerStats(), ['loadbalancerId' => (string) $this->loadbalancerId]); diff --git a/src/Networking/v2/Models/LoadBalancerStatus.php b/src/Networking/v2/Models/LoadBalancerStatus.php index 367952aac..e89e301cd 100644 --- a/src/Networking/v2/Models/LoadBalancerStatus.php +++ b/src/Networking/v2/Models/LoadBalancerStatus.php @@ -54,9 +54,6 @@ class LoadBalancerStatus extends OperatorResource implements Retrievable 'provisioning_status' => 'provisioningStatus', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -64,9 +61,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getLoadBalancerStatuses(), ['loadbalancerId' => (string) $this->loadbalancerId]); diff --git a/src/Networking/v2/Models/Network.php b/src/Networking/v2/Models/Network.php index 8bff5bc36..b9741ef56 100644 --- a/src/Networking/v2/Models/Network.php +++ b/src/Networking/v2/Models/Network.php @@ -53,9 +53,6 @@ class Network extends OperatorResource implements Listable, Retrievable, Creatab protected $resourceKey = 'network'; protected $resourcesKey = 'networks'; - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getNetwork(), ['id' => (string) $this->id]); @@ -77,8 +74,6 @@ public function bulkCreate(array $data): array } /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\Networking\v2\Api::postNetwork} */ public function create(array $data): Creatable @@ -88,18 +83,12 @@ public function create(array $data): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->putNetwork()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteNetwork()); diff --git a/src/Networking/v2/Models/Port.php b/src/Networking/v2/Models/Port.php index 8f1cf03ff..9c3dd6d51 100644 --- a/src/Networking/v2/Models/Port.php +++ b/src/Networking/v2/Models/Port.php @@ -136,9 +136,6 @@ class Port extends OperatorResource implements Creatable, Updateable, Deletable, protected $resourceKey = 'port'; protected $resourcesKey = 'ports'; - /** - * {@inheritdoc} - */ public function create(array $userOptions): Creatable { $response = $this->execute($this->api->postSinglePort(), $userOptions); diff --git a/src/Networking/v2/Models/Quota.php b/src/Networking/v2/Models/Quota.php index 3398d1dca..637b94440 100644 --- a/src/Networking/v2/Models/Quota.php +++ b/src/Networking/v2/Models/Quota.php @@ -77,27 +77,18 @@ class Quota extends OperatorResource implements Retrievable, Updateable, Deletab 'rbac_policy' => 'rbacPolicy', ]; - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getQuota(), ['tenantId' => (string) $this->tenantId]); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->putQuota()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteQuota()); diff --git a/src/Networking/v2/Models/Subnet.php b/src/Networking/v2/Models/Subnet.php index bf77c5c72..f1000c765 100644 --- a/src/Networking/v2/Models/Subnet.php +++ b/src/Networking/v2/Models/Subnet.php @@ -68,9 +68,6 @@ class Subnet extends OperatorResource implements Listable, Retrievable, Creatabl protected $resourceKey = 'subnet'; protected $resourcesKey = 'subnets'; - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->getSubnet(), ['id' => (string) $this->id]); @@ -92,8 +89,6 @@ public function bulkCreate(array $data): array } /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\Networking\v2\Api::postSubnet} */ public function create(array $data): Creatable @@ -103,26 +98,17 @@ public function create(array $data): Creatable return $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function update() { $response = $this->executeWithState($this->api->putSubnet()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteSubnet()); } - /** - * {@inheritdoc} - */ protected function getAttrs(array $keys) { $output = parent::getAttrs($keys); diff --git a/src/Networking/v2/Service.php b/src/Networking/v2/Service.php index e99c6176a..b66c63be9 100644 --- a/src/Networking/v2/Service.php +++ b/src/Networking/v2/Service.php @@ -19,7 +19,7 @@ /** * Network v2 service for OpenStack. * - * @property \OpenStack\Networking\v2\Api $api + * @property Api $api */ class Service extends AbstractService { @@ -57,6 +57,7 @@ public function getNetwork(string $id): Network * List networks. * * @param array $options {@see \OpenStack\Networking\v2\Api::getNetworks} + * * @return \Generator */ public function listNetworks(array $options = []): \Generator @@ -100,6 +101,7 @@ public function getSubnet(string $id): Subnet * List subnets. * * @param array $options {@see \OpenStack\Networking\v2\Api::getSubnets} + * * @return \Generator */ public function listSubnets(array $options = []): \Generator @@ -143,6 +145,7 @@ public function getPort(string $id): Port * List ports. * * @param array $options {@see \OpenStack\Networking\v2\Api::getPorts} + * * @return \Generator */ public function listPorts(array $options = []): \Generator diff --git a/src/ObjectStore/v1/Models/Account.php b/src/ObjectStore/v1/Models/Account.php index 84ef1fd4f..576c6b77b 100644 --- a/src/ObjectStore/v1/Models/Account.php +++ b/src/ObjectStore/v1/Models/Account.php @@ -16,7 +16,7 @@ class Account extends OperatorResource implements Retrievable, HasMetadata { use MetadataTrait; - const METADATA_PREFIX = 'X-Account-Meta-'; + public const METADATA_PREFIX = 'X-Account-Meta-'; /** @var int */ public $objectCount; @@ -33,9 +33,6 @@ class Account extends OperatorResource implements Retrievable, HasMetadata /** @var string */ public $tempUrl; - /** - * {@inheritdoc} - */ public function populateFromResponse(ResponseInterface $response): self { parent::populateFromResponse($response); @@ -49,27 +46,18 @@ public function populateFromResponse(ResponseInterface $response): self return $this; } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->execute($this->api->headAccount()); $this->populateFromResponse($response); } - /** - * {@inheritdoc} - */ public function mergeMetadata(array $metadata) { $response = $this->execute($this->api->postAccount(), ['metadata' => $metadata]); $this->metadata = $this->parseMetadata($response); } - /** - * {@inheritdoc} - */ public function resetMetadata(array $metadata) { $options = [ @@ -87,9 +75,6 @@ public function resetMetadata(array $metadata) $this->metadata = $this->parseMetadata($response); } - /** - * {@inheritdoc} - */ public function getMetadata(): array { $response = $this->execute($this->api->headAccount()); diff --git a/src/ObjectStore/v1/Models/Container.php b/src/ObjectStore/v1/Models/Container.php index 6501bfd90..7d3d799e5 100644 --- a/src/ObjectStore/v1/Models/Container.php +++ b/src/ObjectStore/v1/Models/Container.php @@ -22,7 +22,7 @@ class Container extends OperatorResource implements Creatable, Deletable, Retrie { use MetadataTrait; - const METADATA_PREFIX = 'X-Container-Meta-'; + public const METADATA_PREFIX = 'X-Container-Meta-'; /** @var int */ public $objectCount; @@ -38,9 +38,6 @@ class Container extends OperatorResource implements Creatable, Deletable, Retrie protected $markerKey = 'name'; - /** - * {@inheritdoc} - */ public function populateFromResponse(ResponseInterface $response): self { parent::populateFromResponse($response); @@ -57,13 +54,14 @@ public function populateFromResponse(ResponseInterface $response): self * * @param array $options {@see \OpenStack\ObjectStore\v1\Api::getContainer} * @param callable|null $mapFn allows a function to be mapped over each element + * * @return \Generator */ public function listObjects(array $options = [], callable $mapFn = null): \Generator { $options = array_merge($options, ['name' => $this->name, 'format' => 'json']); - $appendContainerNameFn = function (StorageObject $resource) use ($mapFn) { + $appendContainerNameFn = function (StorageObject $resource) use ($mapFn) { $resource->containerName = $this->name; if ($mapFn) { call_user_func_array($mapFn, [&$resource]); @@ -73,9 +71,6 @@ public function listObjects(array $options = [], callable $mapFn = null): \Gener return $this->model(StorageObject::class)->enumerate($this->api->getContainer(), $options, $appendContainerNameFn); } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->executeWithState($this->api->headContainer()); @@ -83,8 +78,6 @@ public function retrieve() } /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\ObjectStore\v1\Api::putContainer} */ public function create(array $data): Creatable @@ -97,26 +90,17 @@ public function create(array $data): Creatable return $this; } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteContainer()); } - /** - * {@inheritdoc} - */ public function mergeMetadata(array $metadata) { $response = $this->execute($this->api->postContainer(), ['name' => $this->name, 'metadata' => $metadata]); $this->metadata = $this->parseMetadata($response); } - /** - * {@inheritdoc} - */ public function resetMetadata(array $metadata) { $options = [ @@ -135,9 +119,6 @@ public function resetMetadata(array $metadata) $this->metadata = $this->parseMetadata($response); } - /** - * {@inheritdoc} - */ public function getMetadata(): array { $response = $this->executeWithState($this->api->headContainer()); @@ -183,16 +164,16 @@ public function objectExists(string $name): bool /** * Verifies if provied segment index format for DLOs is valid. - * + * * @param string $fmt The format of segment index name, e.g. %05d for 00001, 00002, etc. - * + * * @return bool TRUE if the format is valid, FALSE if it is not */ public function isValidSegmentIndexFormat($fmt) { $testValue1 = sprintf($fmt, 1); $testValue2 = sprintf($fmt, 10); - + // Test if different results of the same string length return ($testValue1 !== $testValue2) && (strlen($testValue1) === strlen($testValue2)); } @@ -214,12 +195,7 @@ public function createObject(array $data): StorageObject * container. When this completes, a manifest file is uploaded which references the prefix of the segments, * allowing concatenation when a request is executed against the manifest. * - * @param array $data {@see \OpenStack\ObjectStore\v1\Api::putObject} - * @param int $data['segmentSize'] The size in Bytes of each segment - * @param string $data['segmentContainer'] The container to which each segment will be uploaded - * @param string $data['segmentPrefix'] The prefix that will come before each segment. If omitted, a default - * is used: name/timestamp/filesize - * @param string $data['segmentIndexFormat'] The format of segment index name, default %05d - 00001, 00002, etc. + * @param array $data {@see \OpenStack\ObjectStore\v1\Api::putObject} */ public function createLargeObject(array $data): StorageObject { diff --git a/src/ObjectStore/v1/Models/StorageObject.php b/src/ObjectStore/v1/Models/StorageObject.php index d639a0cd9..77c40fdb6 100644 --- a/src/ObjectStore/v1/Models/StorageObject.php +++ b/src/ObjectStore/v1/Models/StorageObject.php @@ -21,7 +21,7 @@ class StorageObject extends OperatorResource implements Creatable, Deletable, Ha { use MetadataTrait; - const METADATA_PREFIX = 'X-Object-Meta-'; + public const METADATA_PREFIX = 'X-Object-Meta-'; /** @var string */ public $containerName; @@ -52,9 +52,6 @@ class StorageObject extends OperatorResource implements Creatable, Deletable, Ha 'subdir' => 'name', ]; - /** - * {@inheritdoc} - */ protected function getAliases(): array { return parent::getAliases() + [ @@ -62,9 +59,6 @@ protected function getAliases(): array ]; } - /** - * {@inheritdoc} - */ public function populateFromResponse(ResponseInterface $response): self { parent::populateFromResponse($response); @@ -97,8 +91,6 @@ public function getPublicUri(): Uri } /** - * {@inheritdoc} - * * @param array $data {@see \OpenStack\ObjectStore\v1\Api::putObject} */ public function create(array $data): Creatable @@ -121,9 +113,6 @@ public function create(array $data): Creatable return $storageObject; } - /** - * {@inheritdoc} - */ public function retrieve() { $response = $this->executeWithState($this->api->headObject()); @@ -150,9 +139,6 @@ public function download(array $data = []): StreamInterface return $response->getBody(); } - /** - * {@inheritdoc} - */ public function delete() { $this->executeWithState($this->api->deleteObject()); @@ -167,9 +153,6 @@ public function copy(array $options) $this->execute($this->api->copyObject(), $options); } - /** - * {@inheritdoc} - */ public function mergeMetadata(array $metadata) { $options = [ @@ -182,9 +165,6 @@ public function mergeMetadata(array $metadata) $this->metadata = $this->parseMetadata($response); } - /** - * {@inheritdoc} - */ public function resetMetadata(array $metadata) { $options = [ @@ -197,9 +177,6 @@ public function resetMetadata(array $metadata) $this->metadata = $this->parseMetadata($response); } - /** - * {@inheritdoc} - */ public function getMetadata(): array { $response = $this->executeWithState($this->api->headObject()); diff --git a/src/ObjectStore/v1/Service.php b/src/ObjectStore/v1/Service.php index ce029479f..d4bdbae78 100644 --- a/src/ObjectStore/v1/Service.php +++ b/src/ObjectStore/v1/Service.php @@ -10,7 +10,7 @@ use OpenStack\ObjectStore\v1\Models\Container; /** - * @property \OpenStack\ObjectStore\v1\Api $api + * @property Api $api */ class Service extends AbstractService { @@ -27,6 +27,7 @@ public function getAccount(): Account * * @param array $options {@see \OpenStack\ObjectStore\v1\Api::getAccount} * @param callable|null $mapFn allows a function to be mapped over each element in the collection + * * @return \Generator */ public function listContainers(array $options = [], callable $mapFn = null): \Generator diff --git a/src/OpenStack.php b/src/OpenStack.php index 750042dac..770b3324c 100644 --- a/src/OpenStack.php +++ b/src/OpenStack.php @@ -33,7 +33,6 @@ class OpenStack * ['messageFormatter'] = (MessageFormatter) Must set if debugLog is true [OPTIONAL] * ['requestOptions'] = (array) Guzzle Http request options [OPTIONAL] * ['cachedToken'] = (array) Cached token credential [OPTIONAL] - * @param Builder $builder */ public function __construct(array $options = [], Builder $builder = null) {