From a708cb4d3dc96e88da29c9eb0d4ff28e1309de16 Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Thu, 27 Mar 2025 22:23:21 -0500 Subject: [PATCH 1/7] lots of cleanup and etc. --- .github/workflows/tests.yaml | 8 +- composer.json | 8 +- composer.lock | 558 ++++--- docker/dev.Dockerfile | 24 - phpunit.xml | 3 +- src/ACL/ACLAuthMethod.php | 105 +- src/ACL/ACLAuthMethodListEntry.php | 72 +- .../ACLAuthMethodListEntryQueryResponse.php | 12 +- src/ACL/ACLAuthMethodNamespaceRule.php | 21 +- src/ACL/ACLAuthMethodQueryResponse.php | 12 +- src/ACL/ACLAuthMethodWriteResponse.php | 12 +- src/ACL/ACLBindingRule.php | 77 +- src/ACL/ACLBindingRuleQueryResponse.php | 12 +- src/ACL/ACLBindingRuleWriteResponse.php | 12 +- src/ACL/ACLBindingRulesQueryResponse.php | 12 +- src/ACL/ACLClient.php | 271 +-- src/ACL/ACLEntriesResponse.php | 12 +- src/ACL/ACLEntry.php | 53 +- src/ACL/ACLLink.php | 13 +- src/ACL/ACLLoginParams.php | 29 +- src/ACL/ACLNodeIdentity.php | 13 +- src/ACL/ACLOIDCAuthURLParams.php | 37 +- src/ACL/ACLOIDCCallbackParams.php | 37 +- src/ACL/ACLPolicy.php | 77 +- src/ACL/ACLPolicyListEntry.php | 69 +- src/ACL/ACLPolicyListEntryQueryResponse.php | 12 +- src/ACL/ACLPolicyQueryResponse.php | 12 +- src/ACL/ACLPolicyWriteResponse.php | 12 +- src/ACL/ACLReplicationStatus.php | 41 +- src/ACL/ACLReplicationStatusResponse.php | 12 +- src/ACL/ACLRole.php | 85 +- src/ACL/ACLRolePolicyLink.php | 5 +- src/ACL/ACLRoleQueryResponse.php | 12 +- src/ACL/ACLRoleWriteResponse.php | 12 +- src/ACL/ACLRolesQueryResponse.php | 12 +- src/ACL/ACLServiceIdentity.php | 13 +- src/ACL/ACLToken.php | 148 +- src/ACL/ACLTokenListEntry.php | 129 +- src/ACL/ACLTokenListEntryQueryResponse.php | 12 +- src/ACL/ACLTokenPolicyLink.php | 5 +- src/ACL/ACLTokenQueryResponse.php | 12 +- src/ACL/ACLTokenRoleLink.php | 5 +- src/ACL/ACLTokenWriteResponse.php | 12 +- src/ACL/KubernetesAuthMethodConfig.php | 29 +- src/ACL/OIDCAuthMethodConfig.php | 5 +- src/AbstractClient.php | 144 +- src/AbstractModel.php | 12 +- src/AbstractResponse.php | 16 +- src/AbstractValuedQueryResponse.php | 13 +- src/AbstractValuedResponse.php | 13 +- src/AbstractValuedWriteResponse.php | 13 +- src/Agent/AgentCheck.php | 100 +- src/Agent/AgentCheckRegistration.php | 29 +- src/Agent/AgentCheckUpdate.php | 25 +- src/Agent/AgentChecksResponse.php | 12 +- src/Agent/AgentClient.php | 194 +-- src/Agent/AgentHealthServiceResponse.php | 27 +- src/Agent/AgentHealthServicesResponse.php | 27 +- src/Agent/AgentMember.php | 54 +- src/Agent/AgentMembersResponse.php | 12 +- src/Agent/AgentService.php | 137 +- src/Agent/AgentServiceCheck.php | 181 +- src/Agent/AgentServiceChecks.php | 10 +- src/Agent/AgentServiceChecksInfo.php | 36 +- src/Agent/AgentServiceConnect.php | 21 +- src/Agent/AgentServiceConnectProxyConfig.php | 109 +- src/Agent/AgentServiceRegistration.php | 124 +- src/Agent/AgentServiceResponse.php | 12 +- src/Agent/AgentServicesResponse.php | 12 +- src/Agent/AgentToken.php | 13 +- src/Agent/AgentWeights.php | 13 +- src/Agent/EnvoyExtension.php | 42 +- src/Agent/GaugeValue.php | 29 +- src/Agent/MemberOpts.php | 21 +- src/Agent/MetricsInfo.php | 45 +- src/Agent/MetricsInfoResponse.php | 12 +- src/Agent/PointValue.php | 21 +- src/Agent/SampledValue.php | 69 +- src/Agent/ServiceRegisterOpts.php | 13 +- src/Agent/TransparentProxyConfig.php | 11 +- src/Agent/Upstream.php | 73 +- src/Catalog/CatalogClient.php | 71 +- src/Catalog/CatalogDeregistration.php | 45 +- src/Catalog/CatalogNode.php | 21 +- src/Catalog/CatalogNodeResponse.php | 12 +- src/Catalog/CatalogNodeServiceList.php | 21 +- .../CatalogNodeServicesListResponse.php | 12 +- src/Catalog/CatalogRegistration.php | 89 +- src/Catalog/CatalogService.php | 157 +- src/Catalog/CatalogServicesResponse.php | 12 +- src/Catalog/CompoundServiceName.php | 21 +- src/Catalog/GatewayService.php | 99 +- src/Catalog/GatewayServicesResponse.php | 12 +- src/Catalog/Node.php | 73 +- src/Catalog/NodesResponse.php | 12 +- src/Catalog/ServiceAddress.php | 21 +- src/Catalog/Weights.php | 21 +- src/Config.php | 168 +- src/ConfigEntry/ConfigEntry.php | 20 +- src/ConfigEntry/ConfigEntryTrait.php | 53 +- src/ConfigEntry/ExposeConfig.php | 21 +- src/ConfigEntry/ExposePath.php | 45 +- src/ConfigEntry/MeshConfigEntry.php | 12 +- src/ConfigEntry/MeshGatewayConfig.php | 13 +- src/ConfigEntry/PassiveHealthCheck.php | 24 +- src/ConfigEntry/ProxyConfigEntry.php | 45 +- src/ConfigEntry/RingHashConfig.php | 5 +- src/ConfigEntry/ServiceConfigEntry.php | 62 +- .../ServiceResolverConfigEntry.php | 5 +- src/ConfigEntry/ServiceResolverFailover.php | 37 +- src/ConfigEntry/ServiceResolverRedirect.php | 37 +- src/ConfigEntry/ServiceResolverSubset.php | 21 +- src/ConfigEntry/ServiceRoute.php | 5 +- src/ConfigEntry/ServiceRouteDestination.php | 69 +- src/ConfigEntry/ServiceRouteHTTPMatch.php | 53 +- .../ServiceRouteHTTPMatchHeader.php | 61 +- .../ServiceRouteHTTPMatchQueryParam.php | 37 +- src/ConfigEntry/ServiceRouteMatch.php | 13 +- src/ConfigEntry/ServiceRouterConfigEntry.php | 13 +- src/ConfigEntry/ServiceSplit.php | 37 +- .../ServiceSplitterConfigEntry.php | 13 +- src/ConfigEntry/TransparentProxyConfig.php | 21 +- src/ConfigEntry/UpstreamConfiguration.php | 77 +- src/ConfigEntry/UpstreamLimits.php | 29 +- src/Consul.php | 53 +- src/Coordinate/Coordinate.php | 43 +- src/Coordinate/CoordinateClient.php | 29 +- src/Coordinate/CoordinateConfig.php | 72 +- src/Coordinate/CoordinateDatacenterMap.php | 17 +- .../CoordinateDatacentersResponse.php | 12 +- src/Coordinate/CoordinateEntriesResponse.php | 12 +- src/Coordinate/CoordinateEntry.php | 29 +- .../DimensionalityConflictException.php | 11 +- src/Coordinate/funcs.php | 11 +- src/Debug/DebugClient.php | 27 +- src/DecodedBody.php | 14 +- src/Error.php | 26 +- src/ErrorContainer.php | 9 +- src/Event/EventClient.php | 23 +- src/Event/UserEvent.php | 37 +- src/Event/UserEventResponse.php | 12 +- src/Event/UserEventsResponse.php | 12 +- src/FakeMap.php | 44 +- src/FakeSlice.php | 56 +- src/HasSettableStringTags.php | 13 +- src/HasStringTags.php | 9 +- src/Health/HealthCheck.php | 121 +- src/Health/HealthCheckDefinition.php | 70 +- src/Health/HealthChecks.php | 14 +- src/Health/HealthChecksResponse.php | 12 +- src/Health/HealthClient.php | 89 +- src/Health/ServiceEntriesResponse.php | 12 +- src/Health/ServiceEntry.php | 33 +- src/HttpAuth.php | 30 +- src/KV/CheckTxnOp.php | 25 +- src/KV/KVClient.php | 82 +- src/KV/KVPair.php | 72 +- src/KV/KVPairResponse.php | 12 +- src/KV/KVPairs.php | 10 +- src/KV/KVPairsResponse.php | 12 +- src/KV/KVTree.php | 48 +- src/KV/KVTxnAPIResponse.php | 13 +- src/KV/KVTxnOp.php | 29 +- src/KV/KVTxnOps.php | 10 +- src/KV/KVTxnResponse.php | 13 +- src/KV/NodeTxnOp.php | 25 +- src/KV/ServiceTxnOp.php | 33 +- src/KV/TxnError.php | 21 +- src/KV/TxnErrors.php | 10 +- src/KV/TxnOp.php | 37 +- src/KV/TxnOps.php | 10 +- src/KV/TxnResponse.php | 25 +- src/KV/TxnResult.php | 37 +- src/KV/TxnResults.php | 10 +- src/MapResponse.php | 12 +- src/Marshaller.php | 7 +- src/Operator/Area.php | 37 +- src/Operator/AreaJoinResponse.php | 17 +- src/Operator/AutopilotConfiguration.php | 85 +- src/Operator/AutopilotServer.php | 140 +- src/Operator/AutopilotState.php | 77 +- src/Operator/AutopilotStateResponse.php | 12 +- src/Operator/AutopilotUpgrade.php | 77 +- src/Operator/AutopilotZone.php | 29 +- src/Operator/AutopilotZoneUpgradeVersions.php | 37 +- src/Operator/OperatorAreaJoinResponse.php | 12 +- src/Operator/OperatorAreasResponse.php | 12 +- ...OperatorAutopilotConfigurationResponse.php | 12 +- src/Operator/OperatorClient.php | 104 +- src/Operator/OperatorHealthReply.php | 29 +- src/Operator/OperatorHealthReplyResponse.php | 12 +- .../OperatorRaftConfigurationResponse.php | 12 +- src/Operator/OperatorSerfMembersResponse.php | 12 +- .../OperatorServerHealthsResponse.php | 12 +- src/Operator/RaftConfiguration.php | 21 +- src/Operator/RaftServer.php | 53 +- src/Operator/ReadableDuration.php | 17 +- src/Operator/SerfMember.php | 89 +- src/Operator/ServerHealth.php | 105 +- src/Params.php | 9 +- src/PreparedQuery/PreparedQueryClient.php | 44 +- src/PreparedQuery/PreparedQueryDefinition.php | 65 +- .../PreparedQueryDefinitionsResponse.php | 12 +- .../PreparedQueryExecuteResponse.php | 57 +- .../PreparedQueryExecuteResponseResponse.php | 12 +- src/PreparedQuery/QueryDNSOptions.php | 16 +- src/PreparedQuery/QueryDatacenterOptions.php | 25 +- src/PreparedQuery/QueryTemplate.php | 21 +- src/PreparedQuery/ServiceQuery.php | 81 +- src/QueryMeta.php | 41 +- src/QueryMetaContainer.php | 9 +- src/QueryOptions.php | 145 +- src/Request.php | 47 +- src/RequestMeta.php | 21 +- src/RequestOptions.php | 8 +- src/RequestResponse.php | 38 +- src/ResponseValueBoolTrait.php | 15 +- src/ResponseValueStringTrait.php | 15 +- src/ResponseValueStringsTrait.php | 12 +- src/ScalarType.php | 2 +- src/Session/ServiceCheck.php | 21 +- src/Session/SessionClient.php | 62 +- src/Session/SessionEntriesQueryResponse.php | 12 +- src/Session/SessionEntriesWriteResponse.php | 12 +- src/Session/SessionEntry.php | 100 +- src/Status/StatusClient.php | 25 +- src/Transcoding.php | 26 +- src/UnmarshalledResponseInterface.php | 8 +- src/Unmarshaller.php | 119 +- src/ValuedBoolResponse.php | 5 +- src/ValuedQueryBoolResponse.php | 5 +- src/ValuedQueryStringResponse.php | 5 +- src/ValuedQueryStringsResponse.php | 5 +- src/ValuedResponseInterface.php | 8 +- src/ValuedStringResponse.php | 5 +- src/ValuedStringsResponse.php | 5 +- src/ValuedWriteBoolResponse.php | 5 +- src/ValuedWriteStringResponse.php | 5 +- src/Values.php | 65 +- src/WriteMeta.php | 9 +- src/WriteMetaContainer.php | 9 +- src/WriteOptions.php | 47 +- src/WriteResponse.php | 13 +- src/funcs.php | 6 +- tools/php-cs-fixer/composer.lock | 1452 +++++++++++------ 245 files changed, 1564 insertions(+), 9217 deletions(-) delete mode 100644 docker/dev.Dockerfile diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b0e5e521..28d7cf12 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -22,14 +22,18 @@ on: env: CONSUL_HTTP_ADDR: "127.0.0.1:8500" - CONSUL_VERSION: '1.17.2' + CONSUL_VERSION: '1.20.5' jobs: tests: runs-on: ubuntu-22.04 strategy: matrix: - php-version: ["8.0", "8.1", "8.2"] + php-version: + - '8.1' + - '8.2' + - '8.3' + - '8.4' name: Tests - PHP ${{ matrix.php-version }} steps: diff --git a/composer.json b/composer.json index c7180b70..abff10c1 100644 --- a/composer.json +++ b/composer.json @@ -16,9 +16,9 @@ "php-consul-api" ], "require": { - "php": "8.*", + "php": "^8.1", "ext-json": "*", - "dcarbone/gotime": "v0.5.*", + "dcarbone/gotime": "^v0.6", "dcarbone/gohttp": "v0.3.*", "guzzlehttp/guzzle": "^7.4", "guzzlehttp/psr7": "^2.4" @@ -33,7 +33,7 @@ } }, "require-dev": { - "phpunit/phpunit": "@stable" + "phpunit/phpunit": "^10.5 || ^11.0" }, "autoload-dev": { "files": [ @@ -46,6 +46,6 @@ } }, "scripts": { - "php-cs-fixer": "vendor/bin/php-cs-fixer fix --config tools/php-cs-fixer/php-consul-api-rules.php_cs src/" + "php-cs-fixer": "tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config tools/php-cs-fixer/php-consul-api-rules.php_cs src/" } } \ No newline at end of file diff --git a/composer.lock b/composer.lock index ba12eb50..9208b439 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "7d5a3eed8b593d15e1a1323a35bf6fd2", + "content-hash": "01cc136766bba4c1a8f16d214945f536", "packages": [ { "name": "dcarbone/gohttp", @@ -57,24 +57,24 @@ }, { "name": "dcarbone/gotime", - "version": "v0.5.1", + "version": "v0.6.0", "source": { "type": "git", "url": "https://github.com/dcarbone/gotime.git", - "reference": "4d1feef39d2bc1a7765a21cfe22601cfa2f27320" + "reference": "a34ce8374185f31030d939ea2a1092d3ca4b46b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dcarbone/gotime/zipball/4d1feef39d2bc1a7765a21cfe22601cfa2f27320", - "reference": "4d1feef39d2bc1a7765a21cfe22601cfa2f27320", + "url": "https://api.github.com/repos/dcarbone/gotime/zipball/a34ce8374185f31030d939ea2a1092d3ca4b46b4", + "reference": "a34ce8374185f31030d939ea2a1092d3ca4b46b4", "shasum": "" }, "require": { "ext-json": "*", - "php": "^8.0" + "php": "^8.1" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^10.5 || ^11.0" }, "type": "library", "autoload": { @@ -103,28 +103,28 @@ "homepage": "https://github.com/dcarbone/gotime", "support": { "issues": "https://github.com/dcarbone/gotime/issues", - "source": "https://github.com/dcarbone/gotime/tree/v0.5.1" + "source": "https://github.com/dcarbone/gotime/tree/v0.6.0" }, - "time": "2022-01-07T03:18:12+00:00" + "time": "2025-03-28T02:19:40+00:00" }, { "name": "guzzlehttp/guzzle", - "version": "7.8.1", + "version": "7.9.3", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", + "reference": "7b2f29fe81dc4da0ca0ea7d42107a0845946ea77", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.1", - "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -135,9 +135,9 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "guzzle/client-integration-tests": "3.0.2", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -215,7 +215,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.1" + "source": "https://github.com/guzzle/guzzle/tree/7.9.3" }, "funding": [ { @@ -231,20 +231,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:35:24+00:00" + "time": "2025-03-27T13:37:11+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.2", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "url": "https://api.github.com/repos/guzzle/promises/zipball/7c69f28996b0a6920945dd20b3857e499d9ca96c", + "reference": "7c69f28996b0a6920945dd20b3857e499d9ca96c", "shasum": "" }, "require": { @@ -252,7 +252,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "type": "library", "extra": { @@ -298,7 +298,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.2" + "source": "https://github.com/guzzle/promises/tree/2.2.0" }, "funding": [ { @@ -314,20 +314,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:19:20+00:00" + "time": "2025-03-27T13:27:01+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.6.2", + "version": "2.7.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16", + "reference": "c2270caaabe631b3b44c85f99e5a04bbb8060d16", "shasum": "" }, "require": { @@ -342,8 +342,8 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -414,7 +414,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.6.2" + "source": "https://github.com/guzzle/psr7/tree/2.7.1" }, "funding": [ { @@ -430,7 +430,7 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:05:35+00:00" + "time": "2025-03-27T12:30:47+00:00" }, { "name": "psr/http-client", @@ -486,20 +486,20 @@ }, { "name": "psr/http-factory", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -523,7 +523,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -535,9 +535,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", @@ -638,16 +638,16 @@ }, { "name": "symfony/deprecation-contracts", - "version": "v3.4.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/7c3aff79d10325257a001fcf92d991f24fc967cf", - "reference": "7c3aff79d10325257a001fcf92d991f24fc967cf", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -655,12 +655,12 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.4-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -685,7 +685,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.4.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -701,22 +701,22 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-09-25T14:20:29+00:00" } ], "packages-dev": [ { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.13.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "024473a478be9df5fdaca2c793f2232fe788e414" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/024473a478be9df5fdaca2c793f2232fe788e414", + "reference": "024473a478be9df5fdaca2c793f2232fe788e414", "shasum": "" }, "require": { @@ -724,11 +724,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -754,7 +755,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.0" }, "funding": [ { @@ -762,20 +763,20 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2025-02-12T12:17:51+00:00" }, { "name": "nikic/php-parser", - "version": "v5.0.0", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4a21235f7e56e713259a6f76bf4b5ea08502b9dc", - "reference": "4a21235f7e56e713259a6f76bf4b5ea08502b9dc", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -786,7 +787,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -818,26 +819,27 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.0.0" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-01-07T17:17:35+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -878,9 +880,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -935,35 +943,35 @@ }, { "name": "phpunit/php-code-coverage", - "version": "11.0.0", + "version": "11.0.9", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "5e238e4b982cb272bf9faeee6f33af83d465d0e2" + "reference": "14d63fbcca18457e49c6f8bebaa91a87e8e188d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5e238e4b982cb272bf9faeee6f33af83d465d0e2", - "reference": "5e238e4b982cb272bf9faeee6f33af83d465d0e2", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/14d63fbcca18457e49c6f8bebaa91a87e8e188d7", + "reference": "14d63fbcca18457e49c6f8bebaa91a87e8e188d7", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^5.0", + "nikic/php-parser": "^5.4.0", "php": ">=8.2", - "phpunit/php-file-iterator": "^5.0", - "phpunit/php-text-template": "^4.0", - "sebastian/code-unit-reverse-lookup": "^4.0", - "sebastian/complexity": "^4.0", - "sebastian/environment": "^7.0", - "sebastian/lines-of-code": "^3.0", - "sebastian/version": "^5.0", - "theseer/tokenizer": "^1.2.0" + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-text-template": "^4.0.1", + "sebastian/code-unit-reverse-lookup": "^4.0.1", + "sebastian/complexity": "^4.0.1", + "sebastian/environment": "^7.2.0", + "sebastian/lines-of-code": "^3.0.1", + "sebastian/version": "^5.0.2", + "theseer/tokenizer": "^1.2.3" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^11.5.2" }, "suggest": { "ext-pcov": "PHP extension that provides line coverage", @@ -972,7 +980,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "11.0-dev" + "dev-main": "11.0.x-dev" } }, "autoload": { @@ -1001,7 +1009,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.0" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.9" }, "funding": [ { @@ -1009,20 +1017,20 @@ "type": "github" } ], - "time": "2024-02-02T06:03:46+00:00" + "time": "2025-02-25T13:26:39+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "5.0.0", + "version": "5.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "99e95c94ad9500daca992354fa09d7b99abe2210" + "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/99e95c94ad9500daca992354fa09d7b99abe2210", - "reference": "99e95c94ad9500daca992354fa09d7b99abe2210", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/118cfaaa8bc5aef3287bf315b6060b1174754af6", + "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6", "shasum": "" }, "require": { @@ -1062,7 +1070,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.0.0" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.0" }, "funding": [ { @@ -1070,20 +1078,20 @@ "type": "github" } ], - "time": "2024-02-02T06:05:04+00:00" + "time": "2024-08-27T05:02:59+00:00" }, { "name": "phpunit/php-invoker", - "version": "5.0.0", + "version": "5.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-invoker.git", - "reference": "5d8d9355a16d8cc5a1305b0a85342cfa420612be" + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5d8d9355a16d8cc5a1305b0a85342cfa420612be", - "reference": "5d8d9355a16d8cc5a1305b0a85342cfa420612be", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2", "shasum": "" }, "require": { @@ -1126,7 +1134,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-invoker/issues", "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", - "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.0" + "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.1" }, "funding": [ { @@ -1134,20 +1142,20 @@ "type": "github" } ], - "time": "2024-02-02T06:05:50+00:00" + "time": "2024-07-03T05:07:44+00:00" }, { "name": "phpunit/php-text-template", - "version": "4.0.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "d38f6cbff1cdb6f40b03c9811421561668cc133e" + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/d38f6cbff1cdb6f40b03c9811421561668cc133e", - "reference": "d38f6cbff1cdb6f40b03c9811421561668cc133e", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964", "shasum": "" }, "require": { @@ -1186,7 +1194,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-text-template/issues", "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.0" + "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.1" }, "funding": [ { @@ -1194,20 +1202,20 @@ "type": "github" } ], - "time": "2024-02-02T06:06:56+00:00" + "time": "2024-07-03T05:08:43+00:00" }, { "name": "phpunit/php-timer", - "version": "7.0.0", + "version": "7.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "8a59d9e25720482ee7fcdf296595e08795b84dc5" + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8a59d9e25720482ee7fcdf296595e08795b84dc5", - "reference": "8a59d9e25720482ee7fcdf296595e08795b84dc5", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", "shasum": "" }, "require": { @@ -1246,7 +1254,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", "security": "https://github.com/sebastianbergmann/php-timer/security/policy", - "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.0" + "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.1" }, "funding": [ { @@ -1254,20 +1262,20 @@ "type": "github" } ], - "time": "2024-02-02T06:08:01+00:00" + "time": "2024-07-03T05:09:35+00:00" }, { "name": "phpunit/phpunit", - "version": "11.0.3", + "version": "11.5.15", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "de24e7e7c67fbf437f7b6cd7bc919f2dc6fd89d4" + "reference": "4b6a4ee654e5e0c5e1f17e2f83c0f4c91dee1f9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de24e7e7c67fbf437f7b6cd7bc919f2dc6fd89d4", - "reference": "de24e7e7c67fbf437f7b6cd7bc919f2dc6fd89d4", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/4b6a4ee654e5e0c5e1f17e2f83c0f4c91dee1f9c", + "reference": "4b6a4ee654e5e0c5e1f17e2f83c0f4c91dee1f9c", "shasum": "" }, "require": { @@ -1277,25 +1285,26 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.1", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.13.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=8.2", - "phpunit/php-code-coverage": "^11.0", - "phpunit/php-file-iterator": "^5.0", - "phpunit/php-invoker": "^5.0", - "phpunit/php-text-template": "^4.0", - "phpunit/php-timer": "^7.0", - "sebastian/cli-parser": "^3.0", - "sebastian/code-unit": "^3.0", - "sebastian/comparator": "^6.0", - "sebastian/diff": "^6.0", - "sebastian/environment": "^7.0", - "sebastian/exporter": "^6.0", - "sebastian/global-state": "^7.0", - "sebastian/object-enumerator": "^6.0", - "sebastian/type": "^5.0", - "sebastian/version": "^5.0" + "phpunit/php-code-coverage": "^11.0.9", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-invoker": "^5.0.1", + "phpunit/php-text-template": "^4.0.1", + "phpunit/php-timer": "^7.0.1", + "sebastian/cli-parser": "^3.0.2", + "sebastian/code-unit": "^3.0.3", + "sebastian/comparator": "^6.3.1", + "sebastian/diff": "^6.0.2", + "sebastian/environment": "^7.2.0", + "sebastian/exporter": "^6.3.0", + "sebastian/global-state": "^7.0.2", + "sebastian/object-enumerator": "^6.0.1", + "sebastian/type": "^5.1.2", + "sebastian/version": "^5.0.2", + "staabm/side-effects-detector": "^1.0.5" }, "suggest": { "ext-soap": "To be able to generate mocks based on WSDL files" @@ -1306,7 +1315,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "11.0-dev" + "dev-main": "11.5-dev" } }, "autoload": { @@ -1338,7 +1347,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.0.3" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.15" }, "funding": [ { @@ -1354,20 +1363,20 @@ "type": "tidelift" } ], - "time": "2024-02-10T06:31:16+00:00" + "time": "2025-03-23T16:02:11+00:00" }, { "name": "sebastian/cli-parser", - "version": "3.0.0", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/cli-parser.git", - "reference": "efd6ce5bb8131fe981e2f879dbd47605fbe0cc6f" + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/efd6ce5bb8131fe981e2f879dbd47605fbe0cc6f", - "reference": "efd6ce5bb8131fe981e2f879dbd47605fbe0cc6f", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180", "shasum": "" }, "require": { @@ -1403,7 +1412,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/cli-parser/issues", "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", - "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2" }, "funding": [ { @@ -1411,27 +1420,27 @@ "type": "github" } ], - "time": "2024-02-02T05:48:04+00:00" + "time": "2024-07-03T04:41:36+00:00" }, { "name": "sebastian/code-unit", - "version": "3.0.0", + "version": "3.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit.git", - "reference": "6634549cb8d702282a04a774e36a7477d2bd9015" + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/6634549cb8d702282a04a774e36a7477d2bd9015", - "reference": "6634549cb8d702282a04a774e36a7477d2bd9015", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/54391c61e4af8078e5b276ab082b6d3c54c9ad64", + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64", "shasum": "" }, "require": { "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^11.5" }, "type": "library", "extra": { @@ -1460,7 +1469,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/code-unit/issues", "security": "https://github.com/sebastianbergmann/code-unit/security/policy", - "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.3" }, "funding": [ { @@ -1468,20 +1477,20 @@ "type": "github" } ], - "time": "2024-02-02T05:50:41+00:00" + "time": "2025-03-19T07:56:08+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "4.0.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "df80c875d3e459b45c6039e4d9b71d4fbccae25d" + "reference": "183a9b2632194febd219bb9246eee421dad8d45e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/df80c875d3e459b45c6039e4d9b71d4fbccae25d", - "reference": "df80c875d3e459b45c6039e4d9b71d4fbccae25d", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e", "shasum": "" }, "require": { @@ -1516,7 +1525,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.0" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1" }, "funding": [ { @@ -1524,20 +1533,20 @@ "type": "github" } ], - "time": "2024-02-02T05:52:17+00:00" + "time": "2024-07-03T04:45:54+00:00" }, { "name": "sebastian/comparator", - "version": "6.0.0", + "version": "6.3.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "bd0f2fa5b9257c69903537b266ccb80fcf940db8" + "reference": "24b8fbc2c8e201bb1308e7b05148d6ab393b6959" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/bd0f2fa5b9257c69903537b266ccb80fcf940db8", - "reference": "bd0f2fa5b9257c69903537b266ccb80fcf940db8", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/24b8fbc2c8e201bb1308e7b05148d6ab393b6959", + "reference": "24b8fbc2c8e201bb1308e7b05148d6ab393b6959", "shasum": "" }, "require": { @@ -1548,12 +1557,15 @@ "sebastian/exporter": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^11.4" + }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "6.3-dev" } }, "autoload": { @@ -1593,7 +1605,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/6.0.0" + "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.1" }, "funding": [ { @@ -1601,20 +1613,20 @@ "type": "github" } ], - "time": "2024-02-02T05:53:45+00:00" + "time": "2025-03-07T06:57:01+00:00" }, { "name": "sebastian/complexity", - "version": "4.0.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/complexity.git", - "reference": "88a434ad86150e11a606ac4866b09130712671f0" + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/88a434ad86150e11a606ac4866b09130712671f0", - "reference": "88a434ad86150e11a606ac4866b09130712671f0", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0", "shasum": "" }, "require": { @@ -1651,7 +1663,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/complexity/issues", "security": "https://github.com/sebastianbergmann/complexity/security/policy", - "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.0" + "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1" }, "funding": [ { @@ -1659,20 +1671,20 @@ "type": "github" } ], - "time": "2024-02-02T05:55:19+00:00" + "time": "2024-07-03T04:49:50+00:00" }, { "name": "sebastian/diff", - "version": "6.0.0", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "3e3f502419518897a923aa1c64d51f9def2e0aff" + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/3e3f502419518897a923aa1c64d51f9def2e0aff", - "reference": "3e3f502419518897a923aa1c64d51f9def2e0aff", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", "shasum": "" }, "require": { @@ -1718,7 +1730,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", "security": "https://github.com/sebastianbergmann/diff/security/policy", - "source": "https://github.com/sebastianbergmann/diff/tree/6.0.0" + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" }, "funding": [ { @@ -1726,20 +1738,20 @@ "type": "github" } ], - "time": "2024-02-02T05:56:35+00:00" + "time": "2024-07-03T04:53:05+00:00" }, { "name": "sebastian/environment", - "version": "7.0.0", + "version": "7.2.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "100d8b855d7180f79f9a9a5c483f2d960581c3ea" + "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/100d8b855d7180f79f9a9a5c483f2d960581c3ea", - "reference": "100d8b855d7180f79f9a9a5c483f2d960581c3ea", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", + "reference": "855f3ae0ab316bbafe1ba4e16e9f3c078d24a0c5", "shasum": "" }, "require": { @@ -1754,7 +1766,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "7.0-dev" + "dev-main": "7.2-dev" } }, "autoload": { @@ -1782,7 +1794,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", "security": "https://github.com/sebastianbergmann/environment/security/policy", - "source": "https://github.com/sebastianbergmann/environment/tree/7.0.0" + "source": "https://github.com/sebastianbergmann/environment/tree/7.2.0" }, "funding": [ { @@ -1790,20 +1802,20 @@ "type": "github" } ], - "time": "2024-02-02T05:57:54+00:00" + "time": "2024-07-03T04:54:44+00:00" }, { "name": "sebastian/exporter", - "version": "6.0.0", + "version": "6.3.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "d0c0a93fc746b0c066037f1e7d09104129e868ff" + "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/d0c0a93fc746b0c066037f1e7d09104129e868ff", - "reference": "d0c0a93fc746b0c066037f1e7d09104129e868ff", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/3473f61172093b2da7de1fb5782e1f24cc036dc3", + "reference": "3473f61172093b2da7de1fb5782e1f24cc036dc3", "shasum": "" }, "require": { @@ -1812,12 +1824,12 @@ "sebastian/recursion-context": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "6.0-dev" + "dev-main": "6.1-dev" } }, "autoload": { @@ -1860,7 +1872,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", "security": "https://github.com/sebastianbergmann/exporter/security/policy", - "source": "https://github.com/sebastianbergmann/exporter/tree/6.0.0" + "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.0" }, "funding": [ { @@ -1868,20 +1880,20 @@ "type": "github" } ], - "time": "2024-02-02T05:58:52+00:00" + "time": "2024-12-05T09:17:50+00:00" }, { "name": "sebastian/global-state", - "version": "7.0.0", + "version": "7.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "590e7cbc6565fa2e26c3df4e629a34bb0bc00c17" + "reference": "3be331570a721f9a4b5917f4209773de17f747d7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/590e7cbc6565fa2e26c3df4e629a34bb0bc00c17", - "reference": "590e7cbc6565fa2e26c3df4e629a34bb0bc00c17", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7", "shasum": "" }, "require": { @@ -1922,7 +1934,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", "security": "https://github.com/sebastianbergmann/global-state/security/policy", - "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.0" + "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2" }, "funding": [ { @@ -1930,20 +1942,20 @@ "type": "github" } ], - "time": "2024-02-02T05:59:33+00:00" + "time": "2024-07-03T04:57:36+00:00" }, { "name": "sebastian/lines-of-code", - "version": "3.0.0", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/lines-of-code.git", - "reference": "376c5b3f6b43c78fdc049740bca76a7c846706c0" + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/376c5b3f6b43c78fdc049740bca76a7c846706c0", - "reference": "376c5b3f6b43c78fdc049740bca76a7c846706c0", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a", "shasum": "" }, "require": { @@ -1980,7 +1992,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", - "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.0" + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1" }, "funding": [ { @@ -1988,20 +2000,20 @@ "type": "github" } ], - "time": "2024-02-02T06:00:36+00:00" + "time": "2024-07-03T04:58:38+00:00" }, { "name": "sebastian/object-enumerator", - "version": "6.0.0", + "version": "6.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "f75f6c460da0bbd9668f43a3dde0ec0ba7faa678" + "reference": "f5b498e631a74204185071eb41f33f38d64608aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f75f6c460da0bbd9668f43a3dde0ec0ba7faa678", - "reference": "f75f6c460da0bbd9668f43a3dde0ec0ba7faa678", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa", "shasum": "" }, "require": { @@ -2038,7 +2050,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.0" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1" }, "funding": [ { @@ -2046,20 +2058,20 @@ "type": "github" } ], - "time": "2024-02-02T06:01:29+00:00" + "time": "2024-07-03T05:00:13+00:00" }, { "name": "sebastian/object-reflector", - "version": "4.0.0", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "bb2a6255d30853425fd38f032eb64ced9f7f132d" + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/bb2a6255d30853425fd38f032eb64ced9f7f132d", - "reference": "bb2a6255d30853425fd38f032eb64ced9f7f132d", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9", "shasum": "" }, "require": { @@ -2094,7 +2106,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.0" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1" }, "funding": [ { @@ -2102,20 +2114,20 @@ "type": "github" } ], - "time": "2024-02-02T06:02:18+00:00" + "time": "2024-07-03T05:01:32+00:00" }, { "name": "sebastian/recursion-context", - "version": "6.0.0", + "version": "6.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "b75224967b5a466925c6d54e68edd0edf8dd4ed4" + "reference": "694d156164372abbd149a4b85ccda2e4670c0e16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/b75224967b5a466925c6d54e68edd0edf8dd4ed4", - "reference": "b75224967b5a466925c6d54e68edd0edf8dd4ed4", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/694d156164372abbd149a4b85ccda2e4670c0e16", + "reference": "694d156164372abbd149a4b85ccda2e4670c0e16", "shasum": "" }, "require": { @@ -2158,7 +2170,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.0" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.2" }, "funding": [ { @@ -2166,32 +2178,32 @@ "type": "github" } ], - "time": "2024-02-02T06:08:48+00:00" + "time": "2024-07-03T05:10:34+00:00" }, { "name": "sebastian/type", - "version": "5.0.0", + "version": "5.1.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "b8502785eb3523ca0dd4afe9ca62235590020f3f" + "reference": "a8a7e30534b0eb0c77cd9d07e82de1a114389f5e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/b8502785eb3523ca0dd4afe9ca62235590020f3f", - "reference": "b8502785eb3523ca0dd4afe9ca62235590020f3f", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/a8a7e30534b0eb0c77cd9d07e82de1a114389f5e", + "reference": "a8a7e30534b0eb0c77cd9d07e82de1a114389f5e", "shasum": "" }, "require": { "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -2215,7 +2227,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/type/issues", "security": "https://github.com/sebastianbergmann/type/security/policy", - "source": "https://github.com/sebastianbergmann/type/tree/5.0.0" + "source": "https://github.com/sebastianbergmann/type/tree/5.1.2" }, "funding": [ { @@ -2223,20 +2235,20 @@ "type": "github" } ], - "time": "2024-02-02T06:09:34+00:00" + "time": "2025-03-18T13:35:50+00:00" }, { "name": "sebastian/version", - "version": "5.0.0", + "version": "5.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/version.git", - "reference": "13999475d2cb1ab33cb73403ba356a814fdbb001" + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/13999475d2cb1ab33cb73403ba356a814fdbb001", - "reference": "13999475d2cb1ab33cb73403ba356a814fdbb001", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874", "shasum": "" }, "require": { @@ -2269,7 +2281,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/version/issues", "security": "https://github.com/sebastianbergmann/version/security/policy", - "source": "https://github.com/sebastianbergmann/version/tree/5.0.0" + "source": "https://github.com/sebastianbergmann/version/tree/5.0.2" }, "funding": [ { @@ -2277,20 +2289,72 @@ "type": "github" } ], - "time": "2024-02-02T06:10:47+00:00" + "time": "2024-10-09T05:16:32+00:00" + }, + { + "name": "staabm/side-effects-detector", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" + ], + "support": { + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" + }, + "funding": [ + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2024-10-20T05:08:20+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.2", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b2ad5003ca10d4ee50a12da31de12a5774ba6b96", - "reference": "b2ad5003ca10d4ee50a12da31de12a5774ba6b96", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -2319,7 +2383,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.2" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -2327,20 +2391,18 @@ "type": "github" } ], - "time": "2023-11-20T00:12:19+00:00" + "time": "2024-03-03T12:36:25+00:00" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "phpunit/phpunit": 0 - }, + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "8.*", + "php": "^8.1", "ext-json": "*" }, - "platform-dev": [], + "platform-dev": {}, "plugin-api-version": "2.6.0" } diff --git a/docker/dev.Dockerfile b/docker/dev.Dockerfile deleted file mode 100644 index 15c07b51..00000000 --- a/docker/dev.Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -FROM php:7.4-cli -LABEL org.opencontainers.image.title="PHP Consul API development container" -LABEL org.opencontainers.image.description="PHP Consul API development container" -LABEL org.opencontainers.image.authors="Daniel Carbone" - -# set for php-cs-fixer -ENV WORKDIR /app - -# copy in php-extension-installer -COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/ - -# install extensions -RUN install-php-extensions \ - xdebug - -# install composer -RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ - && php composer-setup.php --install-dir=/usr/bin --filename=composer \ - && rm 'composer-setup.php' - -# install php-cs tools (thanks, cytopia!) -COPY --from=cytopia/phpcs:3-php7.4 /usr/bin/phpcs /usr/bin/phpcs -COPY --from=dancarbone/cytopia-phpcbf:7.4 /usr/bin/phpcbf /usr/bin/phpcbf -COPY --from=cytopia/php-cs-fixer:3-php7.4 /usr/bin/php-cs-fixer /usr/bin/php-cs-fixer diff --git a/phpunit.xml b/phpunit.xml index 623a0bba..0699e390 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,10 +1,9 @@ diff --git a/src/ACL/ACLAuthMethod.php b/src/ACL/ACLAuthMethod.php index 68d852be..bb7d2d9d 100644 --- a/src/ACL/ACLAuthMethod.php +++ b/src/ACL/ACLAuthMethod.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ACLAuthMethod - */ class ACLAuthMethod extends AbstractModel { protected const FIELDS = [ @@ -54,35 +51,19 @@ class ACLAuthMethod extends AbstractModel private const FIELD_NAMESPACE_RULES = 'NamespaceRules'; private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Type = ''; - /** @var string */ public string $DisplayName = ''; - /** @var string */ public string $Description = ''; - /** @var \DCarbone\Go\Time\Duration */ public Time\Duration $MaxTokenTTL; - /** @var string */ public string $TokenLocality = ''; - /** @var array */ public array $config = []; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodNamespaceRule[] */ public array $NamespaceRules = []; - /** @var string */ public string $Namespace = ''; - /** - * ACLAuthMethod constructor. - * @param array|null $data - */ public function __construct(?array $data = null) { parent::__construct($data); @@ -91,216 +72,132 @@ public function __construct(?array $data = null) } } - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return ACLAuthMethod - */ public function setID(string $ID): ACLAuthMethod { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getType(): string { return $this->Type; } - /** - * @param string $Type - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod - */ public function setType(string $Type): self { $this->Type = $Type; return $this; } - /** - * @return string - */ public function getDisplayName(): string { return $this->DisplayName; } - /** - * @param string $DisplayName - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod - */ public function setDisplayName(string $DisplayName): self { $this->DisplayName = $DisplayName; return $this; } - /** - * @return string - */ public function getDescription(): string { return $this->Description; } - /** - * @param string $Description - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod - */ public function setDescription(string $Description): self { $this->Description = $Description; return $this; } - /** - * @return \DCarbone\Go\Time\Duration - */ public function getMaxTokenTTL(): Time\Duration { return $this->MaxTokenTTL; } - /** - * @param int|string|\DCarbone\Go\Time\Duration $MaxTokenTTL - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod - */ public function setMaxTokenTTL(int|string|Time\Duration $MaxTokenTTL): self { $this->MaxTokenTTL = Time::ParseDuration($MaxTokenTTL); return $this; } - /** - * @return string - */ public function getTokenLocality(): string { return $this->TokenLocality; } - /** - * @param string $TokenLocality - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod - */ public function setTokenLocality(string $TokenLocality): self { $this->TokenLocality = $TokenLocality; return $this; } - /** - * @return array - */ public function getConfig(): array { return $this->config; } - /** - * @param array $config - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod - */ public function setConfig(array $config): self { $this->config = $config; return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodNamespaceRule[] - */ public function getNamespaceRules(): array { return $this->NamespaceRules; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodNamespaceRule[] $NamespaceRules - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod - */ public function setNamespaceRules(array $NamespaceRules): self { $this->NamespaceRules = $NamespaceRules; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; diff --git a/src/ACL/ACLAuthMethodListEntry.php b/src/ACL/ACLAuthMethodListEntry.php index 491e911f..3a54d9f7 100644 --- a/src/ACL/ACLAuthMethodListEntry.php +++ b/src/ACL/ACLAuthMethodListEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ACLAuthMethodListEntry - */ class ACLAuthMethodListEntry extends AbstractModel { protected const FIELDS = [ @@ -47,15 +44,10 @@ class ACLAuthMethodListEntry extends AbstractModel private const FIELD_TOKEN_LOCALITY = 'TokenLocality'; private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Type = ''; - /** @var string */ public string $DisplayName = ''; - /** @var string */ public string $Description = ''; - /** @var \DCarbone\Go\Time\Duration */ public Time\Duration $MaxTokenTTL; /** * TokenLocality defines the kind of token that this auth method produces. @@ -63,97 +55,59 @@ class ACLAuthMethodListEntry extends AbstractModel * @var string */ public string $TokenLocality; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** @var string */ public string $Namespace = ''; - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodListEntry - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getType(): string { return $this->Type; } - /** - * @param string $Type - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodListEntry - */ public function setType(string $Type): self { $this->Type = $Type; return $this; } - /** - * @return string - */ public function getDisplayName(): string { return $this->DisplayName; } - /** - * @param string $DisplayName - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodListEntry - */ public function setDisplayName(string $DisplayName): self { $this->DisplayName = $DisplayName; return $this; } - /** - * @return string - */ public function getDescription(): string { return $this->Description; } - /** - * @param string $Description - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodListEntry - */ public function setDescription(string $Description): self { $this->Description = $Description; return $this; } - /** - * @return \DCarbone\Go\Time\Duration - */ public function getMaxTokenTTL(): Time\Duration { return $this->MaxTokenTTL; } - /** - * @param \DCarbone\Go\Time\Duration $MaxTokenTTL - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodListEntry - */ public function setMaxTokenTTL(Time\Duration $MaxTokenTTL): self { $this->MaxTokenTTL = $MaxTokenTTL; @@ -184,63 +138,39 @@ public function setTokenLocality(string $TokenLocality): self return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodListEntry - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodListEntry - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodListEntry - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return array - */ public function jsonSerialize(): array { $out = parent::jsonSerialize(); diff --git a/src/ACL/ACLAuthMethodListEntryQueryResponse.php b/src/ACL/ACLAuthMethodListEntryQueryResponse.php index ddf681fc..7233b6c2 100644 --- a/src/ACL/ACLAuthMethodListEntryQueryResponse.php +++ b/src/ACL/ACLAuthMethodListEntryQueryResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLAuthMethodListEntryQueryResponse - */ class ACLAuthMethodListEntryQueryResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodListEntry[]|null */ public ?array $ACLAuthMethodListEntries = []; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodListEntry[]|null - */ public function getValue(): ?array { return $this->ACLAuthMethodListEntries; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLAuthMethodListEntries = []; diff --git a/src/ACL/ACLAuthMethodNamespaceRule.php b/src/ACL/ACLAuthMethodNamespaceRule.php index f911bfe8..c6b76694 100644 --- a/src/ACL/ACLAuthMethodNamespaceRule.php +++ b/src/ACL/ACLAuthMethodNamespaceRule.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ACLAuthMethodNamespaceRule - */ class ACLAuthMethodNamespaceRule extends AbstractModel { protected const FIELDS = [ @@ -36,41 +33,25 @@ class ACLAuthMethodNamespaceRule extends AbstractModel private const FIELD_SELECTOR = 'Selector'; private const FIELD_BIND_NAMESPACE = 'BindNamespace'; - /** @var string */ public string $Selector = ''; - /** @var string */ public string $BindNamespace = ''; - /** - * @return string - */ public function getSelector(): string { return $this->Selector; } - /** - * @param string $Selector - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodNamespaceRule - */ public function setSelector(string $Selector): self { $this->Selector = $Selector; return $this; } - /** - * @return string - */ public function getBindNamespace(): string { return $this->BindNamespace; } - /** - * @param string $BindNamespace - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodNamespaceRule - */ public function setBindNamespace(string $BindNamespace): self { $this->BindNamespace = $BindNamespace; diff --git a/src/ACL/ACLAuthMethodQueryResponse.php b/src/ACL/ACLAuthMethodQueryResponse.php index ef672b01..a3a26039 100644 --- a/src/ACL/ACLAuthMethodQueryResponse.php +++ b/src/ACL/ACLAuthMethodQueryResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLAuthMethodWriteResponse - */ class ACLAuthMethodQueryResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod|null */ public ?ACLAuthMethod $ACLAuthMethod = null; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod|null - */ public function getValue(): ?ACLAuthMethod { return $this->ACLAuthMethod; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLAuthMethod = new ACLAuthMethod((array)$decodedData); diff --git a/src/ACL/ACLAuthMethodWriteResponse.php b/src/ACL/ACLAuthMethodWriteResponse.php index ba4d8754..0a609b71 100644 --- a/src/ACL/ACLAuthMethodWriteResponse.php +++ b/src/ACL/ACLAuthMethodWriteResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedWriteResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLAuthMethodWriteResponse - */ class ACLAuthMethodWriteResponse extends AbstractValuedWriteResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod|null */ public ?ACLAuthMethod $ACLAuthMethod = null; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod|null - */ public function getValue(): ?ACLAuthMethod { return $this->ACLAuthMethod; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLAuthMethod = new ACLAuthMethod((array)$decodedData); diff --git a/src/ACL/ACLBindingRule.php b/src/ACL/ACLBindingRule.php index f097187b..0a359399 100644 --- a/src/ACL/ACLBindingRule.php +++ b/src/ACL/ACLBindingRule.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ACLBindingRule - */ class ACLBindingRule extends AbstractModel { protected const FIELDS = [ @@ -34,181 +31,109 @@ class ACLBindingRule extends AbstractModel private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Description = ''; - /** @var string */ public string $AuthMethod = ''; - /** @var string */ public string $Selector = ''; - /** @var string */ public string $BindType = ''; - /** @var string */ public string $BindName = ''; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** @var string */ public string $Namespace = ''; - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRule - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getDescription(): string { return $this->Description; } - /** - * @param string $Description - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRule - */ public function setDescription(string $Description): self { $this->Description = $Description; return $this; } - /** - * @return string - */ public function getAuthMethod(): string { return $this->AuthMethod; } - /** - * @param string $AuthMethod - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRule - */ public function setAuthMethod(string $AuthMethod): self { $this->AuthMethod = $AuthMethod; return $this; } - /** - * @return string - */ public function getSelector(): string { return $this->Selector; } - /** - * @param string $Selector - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRule - */ public function setSelector(string $Selector): self { $this->Selector = $Selector; return $this; } - /** - * @return string - */ public function getBindType(): string { return $this->BindType; } - /** - * @param string $BindType - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRule - */ public function setBindType(string $BindType): self { $this->BindType = $BindType; return $this; } - /** - * @return string - */ public function getBindName(): string { return $this->BindName; } - /** - * @param string $BindName - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRule - */ public function setBindName(string $BindName): self { $this->BindName = $BindName; return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRule - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRule - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRule - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; diff --git a/src/ACL/ACLBindingRuleQueryResponse.php b/src/ACL/ACLBindingRuleQueryResponse.php index a1203cd1..ee85a37d 100644 --- a/src/ACL/ACLBindingRuleQueryResponse.php +++ b/src/ACL/ACLBindingRuleQueryResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLBindingRuleWriteResponse - */ class ACLBindingRuleQueryResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLBindingRule|null */ public ?ACLBindingRule $ACLBindingRule = null; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRule|null - */ public function getValue(): ?ACLBindingRule { return $this->ACLBindingRule; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLBindingRule = new ACLBindingRule((array)$decodedData); diff --git a/src/ACL/ACLBindingRuleWriteResponse.php b/src/ACL/ACLBindingRuleWriteResponse.php index 671e3788..c1ba51c1 100644 --- a/src/ACL/ACLBindingRuleWriteResponse.php +++ b/src/ACL/ACLBindingRuleWriteResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedWriteResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLBindingRuleWriteResponse - */ class ACLBindingRuleWriteResponse extends AbstractValuedWriteResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLBindingRule|null */ public ?ACLBindingRule $ACLBindingRule = null; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRule|null - */ public function getValue(): ?ACLBindingRule { return $this->ACLBindingRule; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLBindingRule = new ACLBindingRule((array)$decodedData); diff --git a/src/ACL/ACLBindingRulesQueryResponse.php b/src/ACL/ACLBindingRulesQueryResponse.php index 1c7b3914..59d77a58 100644 --- a/src/ACL/ACLBindingRulesQueryResponse.php +++ b/src/ACL/ACLBindingRulesQueryResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLBindingRulesQueryResponse - */ class ACLBindingRulesQueryResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLBindingRule[]|null */ public ?array $ACLBindingRules = []; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRule[]|null - */ public function getValue(): ?array { return $this->ACLBindingRules; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLBindingRules = []; diff --git a/src/ACL/ACLClient.php b/src/ACL/ACLClient.php index 9623af84..79e3daa0 100644 --- a/src/ACL/ACLClient.php +++ b/src/ACL/ACLClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -27,71 +27,33 @@ use DCarbone\PHPConsulAPI\WriteOptions; use DCarbone\PHPConsulAPI\WriteResponse; -/** - * Class ACLClient - */ class ACLClient extends AbstractClient { - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\ValuedWriteStringResponse - */ public function Bootstrap(): ValuedWriteStringResponse { return $this->_executePutValuedStr('v1/acl/bootstrap', null, null); } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLEntry $acl - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\ValuedWriteStringResponse - */ public function Create(ACLEntry $acl, ?WriteOptions $opts = null): ValuedWriteStringResponse { return $this->_executePutValuedStr('v1/acl/create', $acl, $opts); } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLEntry $acl - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Update(ACLEntry $acl, ?WriteOptions $opts = null): WriteResponse { return $this->_executePut('v1/acl/update', $acl, $opts); } - /** - * @param string $id - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Destroy(string $id, ?WriteOptions $opts = null): WriteResponse { return $this->_executePut(sprintf('v1/acl/destroy/%s', $id), null, $opts); } - /** - * @param string $id - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\ValuedWriteStringResponse - */ public function Clone(string $id, ?WriteOptions $opts = null): ValuedWriteStringResponse { return $this->_executePutValuedStr(sprintf('v1/acl/clone/%s', $id), null, $opts); } - /** - * @param string $id - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLEntriesResponse - */ public function Info(string $id, ?QueryOptions $opts = null): ACLEntriesResponse { $resp = $this->_requireOK($this->_doGet(sprintf('v1/acl/info/%s', $id), $opts)); @@ -100,12 +62,6 @@ public function Info(string $id, ?QueryOptions $opts = null): ACLEntriesResponse return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLEntriesResponse - */ public function List(?QueryOptions $opts = null): ACLEntriesResponse { $resp = $this->_requireOK($this->_doGet('v1/acl/list', $opts)); @@ -114,12 +70,6 @@ public function List(?QueryOptions $opts = null): ACLEntriesResponse return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLReplicationStatusResponse - */ public function Replication(?QueryOptions $opts = null): ACLReplicationStatusResponse { $resp = $this->_requireOK($this->_doGet('/v1/acl/replication', $opts)); @@ -128,13 +78,6 @@ public function Replication(?QueryOptions $opts = null): ACLReplicationStatusRes return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLToken $token - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenWriteResponse - */ public function TokenCreate(ACLToken $token, ?WriteOptions $opts = null): ACLTokenWriteResponse { $resp = $this->_requireOK($this->_doPut('/v1/acl/token', $token, $opts)); @@ -143,13 +86,6 @@ public function TokenCreate(ACLToken $token, ?WriteOptions $opts = null): ACLTok return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLToken $token - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenWriteResponse - */ public function TokenUpdate(ACLToken $token, ?WriteOptions $opts = null): ACLTokenWriteResponse { $ret = new ACLTokenWriteResponse(); @@ -162,14 +98,6 @@ public function TokenUpdate(ACLToken $token, ?WriteOptions $opts = null): ACLTok return $ret; } - /** - * @param string $tokenID - * @param string $description - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenWriteResponse - */ public function TokenClone(string $tokenID, string $description, ?WriteOptions $opts = null): ACLTokenWriteResponse { $ret = new ACLTokenWriteResponse(); @@ -184,24 +112,11 @@ public function TokenClone(string $tokenID, string $description, ?WriteOptions $ return $ret; } - /** - * @param string $tokenID - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function TokenDelete(string $tokenID, ?WriteOptions $opts = null): WriteResponse { return $this->_executeDelete(sprintf('/v1/acl/token/%s', $tokenID), $opts); } - /** - * @param string $tokenID - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenQueryResponse - */ public function TokenRead(string $tokenID, ?QueryOptions $opts = null): ACLTokenQueryResponse { $resp = $this->_requireOK($this->_doGet(sprintf('/v1/acl/token/%s', $tokenID), $opts)); @@ -210,12 +125,6 @@ public function TokenRead(string $tokenID, ?QueryOptions $opts = null): ACLToken return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenQueryResponse - */ public function TokenReadSelf(?QueryOptions $opts = null): ACLTokenQueryResponse { $resp = $this->_requireOK($this->_doGet('/v1/acl/token/self', $opts)); @@ -224,12 +133,6 @@ public function TokenReadSelf(?QueryOptions $opts = null): ACLTokenQueryResponse return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntryQueryResponse - */ public function TokenList(?QueryOptions $opts = null): ACLTokenListEntryQueryResponse { $resp = $this->_requireOK($this->_doGet('/v1/acl/tokens', $opts)); @@ -238,13 +141,6 @@ public function TokenList(?QueryOptions $opts = null): ACLTokenListEntryQueryRes return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLPolicy $policy - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyWriteResponse - */ public function PolicyCreate(ACLPolicy $policy, ?WriteOptions $opts = null): ACLPolicyWriteResponse { $ret = new ACLPolicyWriteResponse(); @@ -257,13 +153,6 @@ public function PolicyCreate(ACLPolicy $policy, ?WriteOptions $opts = null): ACL return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLPolicy $policy - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyWriteResponse - */ public function PolicyUpdate(ACLPolicy $policy, ?WriteOptions $opts = null): ACLPolicyWriteResponse { $ret = new ACLPolicyWriteResponse(); @@ -276,24 +165,11 @@ public function PolicyUpdate(ACLPolicy $policy, ?WriteOptions $opts = null): ACL return $ret; } - /** - * @param string $policyID - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function PolicyDelete(string $policyID, ?WriteOptions $opts = null): WriteResponse { return $this->_executeDelete(sprintf('/v1/acl/policy/%s', $policyID), $opts); } - /** - * @param string $policyID - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyQueryResponse - */ public function PolicyRead(string $policyID, ?QueryOptions $opts = null): ACLPolicyQueryResponse { $resp = $this->_requireOK($this->_doGet(sprintf('/v1/acl/policy/%s', $policyID), $opts)); @@ -302,13 +178,6 @@ public function PolicyRead(string $policyID, ?QueryOptions $opts = null): ACLPol return $ret; } - /** - * @param string $policyName - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyQueryResponse - */ public function PolicyReadByName(string $policyName, ?QueryOptions $opts = null): ACLPolicyQueryResponse { $resp = $this->_requireOK($this->_doGet(sprintf('/v1/acl/policy/name/%s', $policyName), $opts)); @@ -317,12 +186,6 @@ public function PolicyReadByName(string $policyName, ?QueryOptions $opts = null) return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyListEntryQueryResponse - */ public function PolicyList(?QueryOptions $opts = null): ACLPolicyListEntryQueryResponse { $resp = $this->_requireOK($this->_doGet('/v1/acl/policies', $opts)); @@ -331,13 +194,6 @@ public function PolicyList(?QueryOptions $opts = null): ACLPolicyListEntryQueryR return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLRole $role - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLRoleWriteResponse - */ public function RoleCreate(ACLRole $role, ?WriteOptions $opts = null): ACLRoleWriteResponse { $ret = new ACLRoleWriteResponse(); @@ -350,13 +206,6 @@ public function RoleCreate(ACLRole $role, ?WriteOptions $opts = null): ACLRoleWr return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLRole $role - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLRoleWriteResponse - */ public function RoleUpdate(ACLRole $role, ?WriteOptions $opts = null): ACLRoleWriteResponse { $ret = new ACLRoleWriteResponse(); @@ -369,24 +218,11 @@ public function RoleUpdate(ACLRole $role, ?WriteOptions $opts = null): ACLRoleWr return $ret; } - /** - * @param string $roleID - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function RoleDelete(string $roleID, ?WriteOptions $opts = null): WriteResponse { return $this->_executeDelete(sprintf('/v1/acl/role/%s', $roleID), $opts); } - /** - * @param string $roleID - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLRoleQueryResponse - */ public function RoleRead(string $roleID, ?QueryOptions $opts = null): ACLRoleQueryResponse { $resp = $this->_requireNotFoundOrOK($this->_doGet(sprintf('/v1/acl/role/%s', $roleID), $opts)); @@ -395,13 +231,6 @@ public function RoleRead(string $roleID, ?QueryOptions $opts = null): ACLRoleQue return $ret; } - /** - * @param string $roleName - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLRoleQueryResponse - */ public function RoleReadByName(string $roleName, ?QueryOptions $opts = null): ACLRoleQueryResponse { $resp = $this->_requireOK($this->_doGet(sprintf('/v1/acl/role/name/%s', $roleName), $opts)); @@ -410,12 +239,6 @@ public function RoleReadByName(string $roleName, ?QueryOptions $opts = null): AC return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLRolesQueryResponse - */ public function RoleList(?QueryOptions $opts = null): ACLRolesQueryResponse { $resp = $this->_requireOK($this->_doGet('/v1/acl/roles', $opts)); @@ -424,13 +247,6 @@ public function RoleList(?QueryOptions $opts = null): ACLRolesQueryResponse return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod $authMethod - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodWriteResponse - */ public function AuthMethodCreate(ACLAuthMethod $authMethod, ?WriteOptions $opts = null): ACLAuthMethodWriteResponse { $ret = new ACLAuthMethodWriteResponse(); @@ -443,13 +259,6 @@ public function AuthMethodCreate(ACLAuthMethod $authMethod, ?WriteOptions $opts return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLAuthMethod $authMethod - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodWriteResponse - */ public function AuthMethodUpdate(ACLAuthMethod $authMethod, ?WriteOptions $opts = null): ACLAuthMethodWriteResponse { $ret = new ACLAuthMethodWriteResponse(); @@ -462,24 +271,11 @@ public function AuthMethodUpdate(ACLAuthMethod $authMethod, ?WriteOptions $opts return $ret; } - /** - * @param string $authMethodID - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function AuthMethodDelete(string $authMethodID, ?WriteOptions $opts = null): WriteResponse { return $this->_executeDelete(sprintf('/v1/acl/authMethod/%s', $authMethodID), $opts); } - /** - * @param string $authMethodID - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodQueryResponse - */ public function AuthMethodRead(string $authMethodID, ?QueryOptions $opts = null): ACLAuthMethodQueryResponse { $resp = $this->_requireNotFoundOrOK($this->_doGet(sprintf('/v1/acl/authMethod/%s', $authMethodID), $opts)); @@ -488,12 +284,6 @@ public function AuthMethodRead(string $authMethodID, ?QueryOptions $opts = null) return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodListEntryQueryResponse - */ public function AuthMethodList(?QueryOptions $opts = null): ACLAuthMethodListEntryQueryResponse { $resp = $this->_requireOK($this->_doGet('/v1/acl/auth-methods', $opts)); @@ -502,13 +292,6 @@ public function AuthMethodList(?QueryOptions $opts = null): ACLAuthMethodListEnt return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLBindingRule $bindingRule - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRuleWriteResponse - */ public function BindingRuleCreate( ACLBindingRule $bindingRule, ?WriteOptions $opts = null @@ -523,13 +306,6 @@ public function BindingRuleCreate( return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLBindingRule $bindingRule - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRuleWriteResponse - */ public function BindingRuleUpdate( ACLBindingRule $bindingRule, ?WriteOptions $opts = null @@ -544,24 +320,11 @@ public function BindingRuleUpdate( return $ret; } - /** - * @param string $bindingRuleID - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function BindingRuleDelete(string $bindingRuleID, ?WriteOptions $opts = null): WriteResponse { return $this->_executeDelete(sprintf('/v1/acl/binding-rule/%s', $bindingRuleID), $opts); } - /** - * @param string $bindingRuleID - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRuleQueryResponse - */ public function BindingRuleRead(string $bindingRuleID, ?QueryOptions $opts = null): ACLBindingRuleQueryResponse { $resp = $this->_requireNotFoundOrOK($this->_doGet(sprintf('/v1/acl/binding-rule/%s', $bindingRuleID), $opts)); @@ -570,12 +333,6 @@ public function BindingRuleRead(string $bindingRuleID, ?QueryOptions $opts = nul return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLBindingRulesQueryResponse - */ public function BindingRuleList(?QueryOptions $opts = null): ACLBindingRulesQueryResponse { $resp = $this->_requireOK($this->_doGet('/v1/acl/binding-rules', $opts)); @@ -584,13 +341,6 @@ public function BindingRuleList(?QueryOptions $opts = null): ACLBindingRulesQuer return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLLoginParams $login - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenWriteResponse - */ public function Login(ACLLoginParams $login, ?WriteOptions $opts = null): ACLTokenWriteResponse { $resp = $this->_requireOK($this->_doPost('/v1/acl/login', $login, $opts)); @@ -599,23 +349,11 @@ public function Login(ACLLoginParams $login, ?WriteOptions $opts = null): ACLTok return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Logout(?WriteOptions $opts = null): WriteResponse { return $this->_executePost('/v1/acl/logout', null, $opts); } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLOIDCAuthURLParams $auth - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedWriteStringResponse - */ public function OIDCAuthURL(ACLOIDCAuthURLParams $auth, ?WriteOptions $opts = null): ValuedWriteStringResponse { $ret = new ValuedWriteStringResponse(); @@ -628,13 +366,6 @@ public function OIDCAuthURL(ACLOIDCAuthURLParams $auth, ?WriteOptions $opts = nu return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLOIDCCallbackParams $auth - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenWriteResponse - */ public function OIDCCallback(ACLOIDCCallbackParams $auth, ?WriteOptions $opts = null): ACLTokenWriteResponse { $ret = new ACLTokenWriteResponse(); diff --git a/src/ACL/ACLEntriesResponse.php b/src/ACL/ACLEntriesResponse.php index 615d21f6..f9c4af8f 100644 --- a/src/ACL/ACLEntriesResponse.php +++ b/src/ACL/ACLEntriesResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLEntriesResponse - */ class ACLEntriesResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLEntry[]|null */ public array $ACLEntries = []; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLEntry[]|null - */ public function getValue(): ?array { return $this->ACLEntries; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { foreach ($decodedData as $entry) { diff --git a/src/ACL/ACLEntry.php b/src/ACL/ACLEntry.php index de15edb2..4bc149f5 100644 --- a/src/ACL/ACLEntry.php +++ b/src/ACL/ACLEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,126 +22,75 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class ACLEntry - */ class ACLEntry extends AbstractModel { - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Type = ''; - /** @var string */ public string $Rules = ''; - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $createIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLEntry - */ public function setCreateIndex(int $createIndex): self { $this->CreateIndex = $createIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $modifyIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLEntry - */ public function setModifyIndex(int $modifyIndex): self { $this->ModifyIndex = $modifyIndex; return $this; } - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $id - * @return \DCarbone\PHPConsulAPI\ACL\ACLEntry - */ public function setID(string $id): self { $this->ID = $id; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $name - * @return \DCarbone\PHPConsulAPI\ACL\ACLEntry - */ public function setName(string $name): self { $this->Name = $name; return $this; } - /** - * @return string - */ public function getType(): string { return $this->Type; } - /** - * @param string $type - * @return \DCarbone\PHPConsulAPI\ACL\ACLEntry - */ public function setType(string $type): self { $this->Type = $type; return $this; } - /** - * @return string - */ public function getRules(): string { return $this->Rules; } - /** - * @param string $rules - * @return \DCarbone\PHPConsulAPI\ACL\ACLEntry - */ public function setRules(string $rules): self { $this->Rules = $rules; diff --git a/src/ACL/ACLLink.php b/src/ACL/ACLLink.php index a6dbc8dd..905e0a98 100644 --- a/src/ACL/ACLLink.php +++ b/src/ACL/ACLLink.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,27 +22,16 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class ACLLink - */ class ACLLink extends AbstractModel { - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @return string - */ public function getName(): string { return $this->Name; diff --git a/src/ACL/ACLLoginParams.php b/src/ACL/ACLLoginParams.php index 7da35fbb..19ce55aa 100644 --- a/src/ACL/ACLLoginParams.php +++ b/src/ACL/ACLLoginParams.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\FakeMap; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ACLLoginParams - */ class ACLLoginParams extends AbstractModel { protected const FIELDS = [ @@ -35,61 +32,37 @@ class ACLLoginParams extends AbstractModel private const FIELD_META = 'Meta'; - /** @var string */ public string $AuthMethod = ''; - /** @var string */ public string $BearerToken = ''; - /** @var \DCarbone\PHPConsulAPI\FakeMap|null */ public ?FakeMap $Meta = null; - /** - * @return string - */ public function getAuthMethod(): string { return $this->AuthMethod; } - /** - * @param string $AuthMethod - * @return \DCarbone\PHPConsulAPI\ACL\ACLLoginParams - */ public function setAuthMethod(string $AuthMethod): self { $this->AuthMethod = $AuthMethod; return $this; } - /** - * @return string - */ public function getBearerToken(): string { return $this->BearerToken; } - /** - * @param string $BearerToken - * @return \DCarbone\PHPConsulAPI\ACL\ACLLoginParams - */ public function setBearerToken(string $BearerToken): self { $this->BearerToken = $BearerToken; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\FakeMap|null - */ public function getMeta(): ?FakeMap { return $this->Meta; } - /** - * @param mixed $Meta - * @return \DCarbone\PHPConsulAPI\ACL\ACLLoginParams - */ public function setMeta(mixed $Meta): self { $this->Meta = FakeMap::parse($Meta); diff --git a/src/ACL/ACLNodeIdentity.php b/src/ACL/ACLNodeIdentity.php index 78d8c4a5..400aca2d 100644 --- a/src/ACL/ACLNodeIdentity.php +++ b/src/ACL/ACLNodeIdentity.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,27 +22,16 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class ACLNodeIdentity - */ class ACLNodeIdentity extends AbstractModel { - /** @var string */ public string $NodeName = ''; - /** @var string */ public string $Datacenter = ''; - /** - * @return string - */ public function getNodeName(): string { return $this->NodeName; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; diff --git a/src/ACL/ACLOIDCAuthURLParams.php b/src/ACL/ACLOIDCAuthURLParams.php index 5f78c82c..e5384cb7 100644 --- a/src/ACL/ACLOIDCAuthURLParams.php +++ b/src/ACL/ACLOIDCAuthURLParams.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\FakeMap; use DCarbone\PHPConsulAPI\Transcoding; -/** - * ACLOIDCAuthURLParams - */ class ACLOIDCAuthURLParams extends AbstractModel { protected const FIELDS = [ @@ -35,81 +32,49 @@ class ACLOIDCAuthURLParams extends AbstractModel private const FIELD_META = 'Meta'; - /** @var string */ public string $AuthMethod = ''; - /** @var string */ public string $RedirectURI = ''; - /** @var string */ public string $ClientNonce = ''; - /** @var \DCarbone\PHPConsulAPI\FakeMap|null */ public ?FakeMap $Meta = null; - /** - * @return string - */ public function getAuthMethod(): string { return $this->AuthMethod; } - /** - * @param string $AuthMethod - * @return \DCarbone\PHPConsulAPI\ACL\ACLOIDCAuthURLParams - */ public function setAuthMethod(string $AuthMethod): self { $this->AuthMethod = $AuthMethod; return $this; } - /** - * @return string - */ public function getRedirectURI(): string { return $this->RedirectURI; } - /** - * @param string $RedirectURI - * @return \DCarbone\PHPConsulAPI\ACL\ACLOIDCAuthURLParams - */ public function setRedirectURI(string $RedirectURI): self { $this->RedirectURI = $RedirectURI; return $this; } - /** - * @return string - */ public function getClientNonce(): string { return $this->ClientNonce; } - /** - * @param string $ClientNonce - * @return \DCarbone\PHPConsulAPI\ACL\ACLOIDCAuthURLParams - */ public function setClientNonce(string $ClientNonce): self { $this->ClientNonce = $ClientNonce; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\FakeMap|null - */ public function getMeta(): ?FakeMap { return $this->Meta; } - /** - * @param mixed $Meta - * @return \DCarbone\PHPConsulAPI\ACL\ACLOIDCAuthURLParams - */ public function setMeta(mixed $Meta): self { $this->Meta = FakeMap::parse($Meta); diff --git a/src/ACL/ACLOIDCCallbackParams.php b/src/ACL/ACLOIDCCallbackParams.php index deecfa33..1d7b196a 100644 --- a/src/ACL/ACLOIDCCallbackParams.php +++ b/src/ACL/ACLOIDCCallbackParams.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,86 +22,51 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * ACLOIDCCallbackParams - */ class ACLOIDCCallbackParams extends AbstractModel { - /** @var string */ public string $AuthMethod = ''; - /** @var string */ public string $State = ''; - /** @var string */ public string $Code = ''; - /** @var string */ public string $ClientNonce = ''; - /** - * @return string - */ public function getAuthMethod(): string { return $this->AuthMethod; } - /** - * @param string $AuthMethod - * @return \DCarbone\PHPConsulAPI\ACL\ACLOIDCCallbackParams - */ public function setAuthMethod(string $AuthMethod): self { $this->AuthMethod = $AuthMethod; return $this; } - /** - * @return string - */ public function getState(): string { return $this->State; } - /** - * @param string $State - * @return \DCarbone\PHPConsulAPI\ACL\ACLOIDCCallbackParams - */ public function setState(string $State): self { $this->State = $State; return $this; } - /** - * @return string - */ public function getCode(): string { return $this->Code; } - /** - * @param string $Code - * @return \DCarbone\PHPConsulAPI\ACL\ACLOIDCCallbackParams - */ public function setCode(string $Code): self { $this->Code = $Code; return $this; } - /** - * @return string - */ public function getClientNonce(): string { return $this->ClientNonce; } - /** - * @param string $ClientNonce - * @return \DCarbone\PHPConsulAPI\ACL\ACLOIDCCallbackParams - */ public function setClientNonce(string $ClientNonce): self { $this->ClientNonce = $ClientNonce; diff --git a/src/ACL/ACLPolicy.php b/src/ACL/ACLPolicy.php index 0b384661..88dd5d56 100644 --- a/src/ACL/ACLPolicy.php +++ b/src/ACL/ACLPolicy.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ACLPolicy - */ class ACLPolicy extends AbstractModel { protected const FIELDS = [ @@ -34,181 +31,109 @@ class ACLPolicy extends AbstractModel private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Description = ''; - /** @var string */ public string $Rules = ''; - /** @var array */ public array $Datacenters = []; - /** @var string */ public string $Hash = ''; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** @var string */ public string $Namespace = ''; - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicy - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicy - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getDescription(): string { return $this->Description; } - /** - * @param string $Description - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicy - */ public function setDescription(string $Description): self { $this->Description = $Description; return $this; } - /** - * @return string - */ public function getRules(): string { return $this->Rules; } - /** - * @param string $Rules - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicy - */ public function setRules(string $Rules): self { $this->Rules = $Rules; return $this; } - /** - * @return array - */ public function getDatacenters(): array { return $this->Datacenters; } - /** - * @param array $Datacenters - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicy - */ public function setDatacenters(array $Datacenters): self { $this->Datacenters = $Datacenters; return $this; } - /** - * @return string - */ public function getHash(): string { return $this->Hash; } - /** - * @param string $Hash - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicy - */ public function setHash(string $Hash): self { $this->Hash = $Hash; return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicy - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicy - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicy - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; diff --git a/src/ACL/ACLPolicyListEntry.php b/src/ACL/ACLPolicyListEntry.php index 5374df02..6cb4e67e 100644 --- a/src/ACL/ACLPolicyListEntry.php +++ b/src/ACL/ACLPolicyListEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ACLPolicyListEntry - */ class ACLPolicyListEntry extends AbstractModel { protected const FIELDS = [ @@ -34,161 +31,97 @@ class ACLPolicyListEntry extends AbstractModel private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Description = ''; - /** @var array */ public array $Datacenters = []; - /** @var string */ public string $Hash = ''; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** @var string */ public string $Namespace = ''; - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyListEntry - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyListEntry - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getDescription(): string { return $this->Description; } - /** - * @param string $Description - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyListEntry - */ public function setDescription(string $Description): self { $this->Description = $Description; return $this; } - /** - * @return array - */ public function getDatacenters(): array { return $this->Datacenters; } - /** - * @param array $Datacenters - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyListEntry - */ public function setDatacenters(array $Datacenters): self { $this->Datacenters = $Datacenters; return $this; } - /** - * @return string - */ public function getHash(): string { return $this->Hash; } - /** - * @param string $Hash - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyListEntry - */ public function setHash(string $Hash): self { $this->Hash = $Hash; return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyListEntry - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyListEntry - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyListEntry - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; diff --git a/src/ACL/ACLPolicyListEntryQueryResponse.php b/src/ACL/ACLPolicyListEntryQueryResponse.php index 05cbc4e0..96f28700 100644 --- a/src/ACL/ACLPolicyListEntryQueryResponse.php +++ b/src/ACL/ACLPolicyListEntryQueryResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLPolicyListEntryQueryResponse - */ class ACLPolicyListEntryQueryResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLPolicyListEntry[]|null */ public ?array $ACLPolicyListEntries = []; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicyListEntry[]|null - */ public function getValue(): ?array { return $this->ACLPolicyListEntries; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLPolicyListEntries = []; diff --git a/src/ACL/ACLPolicyQueryResponse.php b/src/ACL/ACLPolicyQueryResponse.php index cc363188..e8aeb668 100644 --- a/src/ACL/ACLPolicyQueryResponse.php +++ b/src/ACL/ACLPolicyQueryResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLPolicyWriteResponse - */ class ACLPolicyQueryResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLPolicy|null */ public ?ACLPolicy $ACLPolicy = null; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicy|null - */ public function getValue(): ?ACLPolicy { return $this->ACLPolicy; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLPolicy = new ACLPolicy((array)$decodedData); diff --git a/src/ACL/ACLPolicyWriteResponse.php b/src/ACL/ACLPolicyWriteResponse.php index 94484d6d..1e9439d5 100644 --- a/src/ACL/ACLPolicyWriteResponse.php +++ b/src/ACL/ACLPolicyWriteResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedWriteResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLPolicyWriteResponse - */ class ACLPolicyWriteResponse extends AbstractValuedWriteResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLPolicy|null */ public ?ACLPolicy $ACLPolicy = null; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLPolicy|null - */ public function getValue(): ?ACLPolicy { return $this->ACLPolicy; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLPolicy = new ACLPolicy((array)$decodedData); diff --git a/src/ACL/ACLReplicationStatus.php b/src/ACL/ACLReplicationStatus.php index dfd15aa4..479bc9c2 100644 --- a/src/ACL/ACLReplicationStatus.php +++ b/src/ACL/ACLReplicationStatus.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ACLReplicationStatus - */ class ACLReplicationStatus extends AbstractModel { protected const FIELDS = [ @@ -41,27 +38,15 @@ class ACLReplicationStatus extends AbstractModel private const FIELD_LAST_SUCCESS = 'LastSuccess'; private const FIELD_LAST_ERROR = 'LastError'; - /** @var bool */ public bool $Enabled = false; - /** @var bool */ public bool $Running = false; - /** @var string */ public string $SourceDatacenter = ''; - /** @var int */ public int $ReplicatedIndex = 0; - /** @var int */ public int $ReplicatedRoleIndex = 0; - /** @var int */ public int $ReplicatedTokenIndex = 0; - /** @var \DCarbone\Go\Time\Time */ public Time\Time $LastSuccess; - /** @var \DCarbone\Go\Time\Time */ public Time\Time $LastError; - /** - * ACLReplicationStatus constructor. - * @param array|null $data - */ public function __construct(?array $data = null) { parent::__construct($data); @@ -73,65 +58,41 @@ public function __construct(?array $data = null) } } - /** - * @return bool - */ public function isEnabled(): bool { return $this->Enabled; } - /** - * @return bool - */ public function isRunning(): bool { return $this->Running; } - /** - * @return string - */ public function getSourceDatacenter(): string { return $this->SourceDatacenter; } - /** - * @return int - */ public function getReplicatedIndex(): int { return $this->ReplicatedIndex; } - /** - * @return int - */ public function getReplicatedRoleIndex(): int { return $this->ReplicatedRoleIndex; } - /** - * @return int - */ public function getReplicatedTokenIndex(): int { return $this->ReplicatedTokenIndex; } - /** - * @return \DCarbone\Go\Time\Time - */ public function getLastSuccess(): Time\Time { return $this->LastSuccess; } - /** - * @return \DCarbone\Go\Time\Time - */ public function getLastError(): Time\Time { return $this->LastError; diff --git a/src/ACL/ACLReplicationStatusResponse.php b/src/ACL/ACLReplicationStatusResponse.php index cb2b5437..df71f30f 100644 --- a/src/ACL/ACLReplicationStatusResponse.php +++ b/src/ACL/ACLReplicationStatusResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLReplicationStatusResponse - */ class ACLReplicationStatusResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLReplicationStatus|null */ public ?ACLReplicationStatus $ACLReplicationStatus = null; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLReplicationStatus|null - */ public function getValue(): ?ACLReplicationStatus { return $this->ACLReplicationStatus; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLReplicationStatus = new ACLReplicationStatus((array)$decodedData); diff --git a/src/ACL/ACLRole.php b/src/ACL/ACLRole.php index 8ffcf5f9..1913ea18 100644 --- a/src/ACL/ACLRole.php +++ b/src/ACL/ACLRole.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ACLRole - */ class ACLRole extends AbstractModel { protected const FIELDS = [ @@ -55,201 +52,121 @@ class ACLRole extends AbstractModel private const FIELD_NODE_IDENTITIES = 'NodeIdentities'; private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Description = ''; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLRolePolicyLink[] */ public array $Policies = []; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLServiceIdentity[] */ public array $ServiceIdentities = []; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLNodeIdentity[] */ public array $NodeIdentities = []; - /** @var string */ public string $Hash = ''; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** @var string */ public string $Namespace = ''; - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getDescription(): string { return $this->Description; } - /** - * @param string $Description - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole - */ public function setDescription(string $Description): self { $this->Description = $Description; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLRolePolicyLink[] - */ public function getPolicies(): array { return $this->Policies; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLRolePolicyLink[] $Policies - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole - */ public function setPolicies(array $Policies): self { $this->Policies = $Policies; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLServiceIdentity[] - */ public function getServiceIdentities(): array { return $this->ServiceIdentities; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLServiceIdentity[] $ServiceIdentities - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole - */ public function setServiceIdentities(array $ServiceIdentities): self { $this->ServiceIdentities = $ServiceIdentities; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLNodeIdentity[] - */ public function getNodeIdentities(): array { return $this->NodeIdentities; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLNodeIdentity[] $NodeIdentities - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole - */ public function setNodeIdentities(array $NodeIdentities): self { $this->NodeIdentities = $NodeIdentities; return $this; } - /** - * @return string - */ public function getHash(): string { return $this->Hash; } - /** - * @param string $Hash - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole - */ public function setHash(string $Hash): self { $this->Hash = $Hash; return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; diff --git a/src/ACL/ACLRolePolicyLink.php b/src/ACL/ACLRolePolicyLink.php index 8c25533e..649dbc90 100644 --- a/src/ACL/ACLRolePolicyLink.php +++ b/src/ACL/ACLRolePolicyLink.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ limitations under the License. */ -/** - * Class ACLRolePolicyLink - */ class ACLRolePolicyLink extends ACLLink { } diff --git a/src/ACL/ACLRoleQueryResponse.php b/src/ACL/ACLRoleQueryResponse.php index 00868cc3..4ffbe236 100644 --- a/src/ACL/ACLRoleQueryResponse.php +++ b/src/ACL/ACLRoleQueryResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLRoleWriteResponse - */ class ACLRoleQueryResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLRole|null */ public ?ACLRole $ACLRole = null; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole|null - */ public function getValue(): ?ACLRole { return $this->ACLRole; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLRole = new ACLRole((array)$decodedData); diff --git a/src/ACL/ACLRoleWriteResponse.php b/src/ACL/ACLRoleWriteResponse.php index b0f38919..cb94ff4e 100644 --- a/src/ACL/ACLRoleWriteResponse.php +++ b/src/ACL/ACLRoleWriteResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedWriteResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLRoleWriteResponse - */ class ACLRoleWriteResponse extends AbstractValuedWriteResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLRole|null */ public ?ACLRole $ACLRole = null; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole|null - */ public function getValue(): ?ACLRole { return $this->ACLRole; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLRole = new ACLRole((array)$decodedData); diff --git a/src/ACL/ACLRolesQueryResponse.php b/src/ACL/ACLRolesQueryResponse.php index a2969c88..37d58657 100644 --- a/src/ACL/ACLRolesQueryResponse.php +++ b/src/ACL/ACLRolesQueryResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLRolesQueryResponse - */ class ACLRolesQueryResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLRole[]|null */ public ?array $ACLRoles = []; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLRole[]|null - */ public function getValue(): ?array { return $this->ACLRoles; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLRoles = []; diff --git a/src/ACL/ACLServiceIdentity.php b/src/ACL/ACLServiceIdentity.php index e0e95b77..99d7d938 100644 --- a/src/ACL/ACLServiceIdentity.php +++ b/src/ACL/ACLServiceIdentity.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ACLServiceIdentity - */ class ACLServiceIdentity extends AbstractModel { protected const FIELDS = [ @@ -38,22 +35,14 @@ class ACLServiceIdentity extends AbstractModel private const FIELD_DATACENTERS = 'Datacenters'; - /** @var string */ public string $ServiceName = ''; - /** @var array */ public array $Datacenters = []; - /** - * @return string - */ public function getServiceName(): string { return $this->ServiceName; } - /** - * @return array - */ public function getDatacenters(): array { return $this->Datacenters; diff --git a/src/ACL/ACLToken.php b/src/ACL/ACLToken.php index 42e45104..d417a98d 100644 --- a/src/ACL/ACLToken.php +++ b/src/ACL/ACLToken.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ACLToken - */ class ACLToken extends AbstractModel { protected const FIELDS = [ @@ -83,49 +80,25 @@ class ACLToken extends AbstractModel private const FIELD_RULES = 'Rules'; private const FIELD_NAMESPACE = 'Namespace'; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** @var string */ public string $AccessorID = ''; - /** @var string */ public string $SecretID = ''; - /** @var string */ public string $Description = ''; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLTokenPolicyLink[] */ public array $Policies = []; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLTokenRoleLink[] */ public array $Roles = []; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLServiceIdentity[] */ public array $ServiceIdentities = []; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLNodeIdentity[] */ public array $NodeIdentities = []; - /** @var bool */ public bool $Local = false; - /** @var string */ public string $AuthMethod = ''; - /** @var \DCarbone\Go\Time\Duration */ public Time\Duration $ExpirationTTL; - /** @var \DCarbone\Go\Time\Time|null */ public ?Time\Time $ExpirationTime = null; - /** @var \DCarbone\Go\Time\Time */ public Time\Time $CreateTime; - /** @var string */ public string $Hash = ''; - /** @var string */ public string $Namespace = ''; - /** - * @deprecated - * @var string - */ public string $Rules = ''; - /** - * ACLToken constructor. - * @param array|null $data - */ public function __construct(?array $data = null) { parent::__construct($data); @@ -137,306 +110,187 @@ public function __construct(?array $data = null) } } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; return $this; } - /** - * @return string - */ public function getAccessorID(): string { return $this->AccessorID; } - /** - * @param string $AccessorID - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setAccessorID(string $AccessorID): self { $this->AccessorID = $AccessorID; return $this; } - /** - * @return string - */ public function getSecretID(): string { return $this->SecretID; } - /** - * @param string $SecretID - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setSecretID(string $SecretID): self { $this->SecretID = $SecretID; return $this; } - /** - * @return string - */ public function getDescription(): string { return $this->Description; } - /** - * @param string $Description - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setDescription(string $Description): self { $this->Description = $Description; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenPolicyLink[] - */ public function getPolicies(): array { return $this->Policies; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLTokenPolicyLink[] $Policies - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setPolicies(array $Policies): self { $this->Policies = $Policies; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenRoleLink[] - */ public function getRoles(): array { return $this->Roles; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLTokenRoleLink[] $Roles - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setRoles(array $Roles): self { $this->Roles = $Roles; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLServiceIdentity[] - */ public function getServiceIdentities(): array { return $this->ServiceIdentities; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLServiceIdentity[] $ServiceIdentities - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setServiceIdentities(array $ServiceIdentities): self { $this->ServiceIdentities = $ServiceIdentities; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLNodeIdentity[] - */ public function getNodeIdentities(): array { return $this->NodeIdentities; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLNodeIdentity[] $NodeIdentities - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setNodeIdentities(array $NodeIdentities): self { $this->NodeIdentities = $NodeIdentities; return $this; } - /** - * @return bool - */ public function isLocal(): bool { return $this->Local; } - /** - * @param bool $Local - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setLocal(bool $Local): self { $this->Local = $Local; return $this; } - /** - * @return string - */ public function getAuthMethod(): string { return $this->AuthMethod; } - /** - * @param string $AuthMethod - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setAuthMethod(string $AuthMethod): self { $this->AuthMethod = $AuthMethod; return $this; } - /** - * @return \DCarbone\Go\Time\Duration - */ public function getExpirationTTL(): Time\Duration { return $this->ExpirationTTL; } - /** - * @param \DCarbone\Go\Time\Duration $ExpirationTTL - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setExpirationTTL(Time\Duration $ExpirationTTL): self { $this->ExpirationTTL = $ExpirationTTL; return $this; } - /** - * @return \DCarbone\Go\Time\Time|null - */ public function getExpirationTime(): ?Time\Time { return $this->ExpirationTime; } - /** - * @param \DCarbone\Go\Time\Time|null $ExpirationTime - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setExpirationTime(?Time\Time $ExpirationTime): self { $this->ExpirationTime = $ExpirationTime; return $this; } - /** - * @return \DCarbone\Go\Time\Time - */ public function getCreateTime(): Time\Time { return $this->CreateTime; } - /** - * @param \DCarbone\Go\Time\Time $CreateTime - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setCreateTime(Time\Time $CreateTime): self { $this->CreateTime = $CreateTime; return $this; } - /** - * @return string - */ public function getHash(): string { return $this->Hash; } - /** - * @param string $Hash - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setHash(string $Hash): self { $this->Hash = $Hash; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return string - */ public function getRules(): string { return $this->Rules; } - /** - * @param string $Rules - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken - */ public function setRules(string $Rules): self { $this->Rules = $Rules; diff --git a/src/ACL/ACLTokenListEntry.php b/src/ACL/ACLTokenListEntry.php index 7b268380..eff21026 100644 --- a/src/ACL/ACLTokenListEntry.php +++ b/src/ACL/ACLTokenListEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ACLTokenListEntry - */ class ACLTokenListEntry extends AbstractModel { protected const FIELDS = [ @@ -75,41 +72,22 @@ class ACLTokenListEntry extends AbstractModel private const FIELD_CREATE_TIME = 'CreateTime'; private const FIELD_NAMESPACE = 'Namespace'; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** @var string */ public string $AccessorID = ''; - /** @var string */ public string $Description = ''; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLTokenPolicyLink[] */ public array $Policies = []; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLTokenRoleLink[] */ public array $Roles = []; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLServiceIdentity[] */ public array $ServiceIdentities = []; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLNodeIdentity[] */ public array $NodeIdentities = []; - /** @var bool */ public bool $Local = false; - /** @var string */ public string $AuthMethod = ''; - /** @var \DCarbone\Go\Time\Time|null */ public ?Time\Time $ExpirationTime = null; - /** @var \DCarbone\Go\Time\Time */ public Time\Time $CreateTime; - /** @var string */ public string $Hash = ''; - /** @var bool */ public bool $Legacy = false; - /** @var string */ public string $Namespace = ''; - /** - * ACLTokenListEntry constructor. - * @param array|null $data - */ public function __construct(?array $data = null) { parent::__construct($data); @@ -118,270 +96,165 @@ public function __construct(?array $data = null) } } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; return $this; } - /** - * @return string - */ public function getAccessorID(): string { return $this->AccessorID; } - /** - * @param string $AccessorID - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setAccessorID(string $AccessorID): self { $this->AccessorID = $AccessorID; return $this; } - /** - * @return string - */ public function getDescription(): string { return $this->Description; } - /** - * @param string $Description - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setDescription(string $Description): self { $this->Description = $Description; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenPolicyLink[] - */ public function getPolicies(): array { return $this->Policies; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLTokenPolicyLink[] $Policies - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setPolicies(array $Policies): self { $this->Policies = $Policies; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenRoleLink[] - */ public function getRoles(): array { return $this->Roles; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLTokenRoleLink[] $Roles - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setRoles(array $Roles): self { $this->Roles = $Roles; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLServiceIdentity[] - */ public function getServiceIdentities(): array { return $this->ServiceIdentities; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLServiceIdentity[] $ServiceIdentities - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setServiceIdentities(array $ServiceIdentities): self { $this->ServiceIdentities = $ServiceIdentities; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLNodeIdentity[] - */ public function getNodeIdentities(): array { return $this->NodeIdentities; } - /** - * @param \DCarbone\PHPConsulAPI\ACL\ACLNodeIdentity[] $NodeIdentities - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setNodeIdentities(array $NodeIdentities): self { $this->NodeIdentities = $NodeIdentities; return $this; } - /** - * @return bool - */ public function isLocal(): bool { return $this->Local; } - /** - * @param bool $Local - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setLocal(bool $Local): self { $this->Local = $Local; return $this; } - /** - * @return string - */ public function getAuthMethod(): string { return $this->AuthMethod; } - /** - * @param string $AuthMethod - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setAuthMethod(string $AuthMethod): self { $this->AuthMethod = $AuthMethod; return $this; } - /** - * @return \DCarbone\Go\Time\Time|null - */ public function getExpirationTime(): ?Time\Time { return $this->ExpirationTime; } - /** - * @param \DCarbone\Go\Time\Time|null $ExpirationTime - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setExpirationTime(?Time\Time $ExpirationTime): self { $this->ExpirationTime = $ExpirationTime; return $this; } - /** - * @return \DCarbone\Go\Time\Time - */ public function getCreateTime(): Time\Time { return $this->CreateTime; } - /** - * @param \DCarbone\Go\Time\Time $CreateTime - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setCreateTime(Time\Time $CreateTime): self { $this->CreateTime = $CreateTime; return $this; } - /** - * @return string - */ public function getHash(): string { return $this->Hash; } - /** - * @param string $Hash - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setHash(string $Hash): self { $this->Hash = $Hash; return $this; } - /** - * @return bool - */ public function isLegacy(): bool { return $this->Legacy; } - /** - * @param bool $Legacy - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setLegacy(bool $Legacy): self { $this->Legacy = $Legacy; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; diff --git a/src/ACL/ACLTokenListEntryQueryResponse.php b/src/ACL/ACLTokenListEntryQueryResponse.php index a09499f9..529e314b 100644 --- a/src/ACL/ACLTokenListEntryQueryResponse.php +++ b/src/ACL/ACLTokenListEntryQueryResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLTokenListEntryQueryResponse - */ class ACLTokenListEntryQueryResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry[]|null */ public ?array $ACLTokenListEntries = []; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLTokenListEntry[]|null - */ public function getValue(): ?array { return $this->ACLTokenListEntries; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLTokenListEntries = []; diff --git a/src/ACL/ACLTokenPolicyLink.php b/src/ACL/ACLTokenPolicyLink.php index d983e829..5cc163c0 100644 --- a/src/ACL/ACLTokenPolicyLink.php +++ b/src/ACL/ACLTokenPolicyLink.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ limitations under the License. */ -/** - * Class ACLTokenPolicyLink - */ class ACLTokenPolicyLink extends ACLLink { } diff --git a/src/ACL/ACLTokenQueryResponse.php b/src/ACL/ACLTokenQueryResponse.php index 65822c69..5092f215 100644 --- a/src/ACL/ACLTokenQueryResponse.php +++ b/src/ACL/ACLTokenQueryResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLTokenQueryResponse - */ class ACLTokenQueryResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLToken|null */ public ?ACLToken $ACLToken = null; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken|null - */ public function getValue(): ?ACLToken { return $this->ACLToken; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLToken = new ACLToken((array)$decodedData); diff --git a/src/ACL/ACLTokenRoleLink.php b/src/ACL/ACLTokenRoleLink.php index ac9e9d01..22133f1d 100644 --- a/src/ACL/ACLTokenRoleLink.php +++ b/src/ACL/ACLTokenRoleLink.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ limitations under the License. */ -/** - * Class ACLTokenRoleLink - */ class ACLTokenRoleLink extends ACLLink { } diff --git a/src/ACL/ACLTokenWriteResponse.php b/src/ACL/ACLTokenWriteResponse.php index 6efb9342..1a1a4d91 100644 --- a/src/ACL/ACLTokenWriteResponse.php +++ b/src/ACL/ACLTokenWriteResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedWriteResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ACLTokenWriteResponse - */ class ACLTokenWriteResponse extends AbstractValuedWriteResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\ACL\ACLToken|null */ public ?ACLToken $ACLToken = null; - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLToken|null - */ public function getValue(): ?ACLToken { return $this->ACLToken; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ACLToken = new ACLToken((array)$decodedData); diff --git a/src/ACL/KubernetesAuthMethodConfig.php b/src/ACL/KubernetesAuthMethodConfig.php index 2beb0660..15459bbe 100644 --- a/src/ACL/KubernetesAuthMethodConfig.php +++ b/src/ACL/KubernetesAuthMethodConfig.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\FakeMap; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class KubernetesAuthMethodConfig - */ class KubernetesAuthMethodConfig extends AbstractModel { protected const FIELDS = [ @@ -39,61 +36,37 @@ class KubernetesAuthMethodConfig extends AbstractModel private const FIELD_CA_CERT = 'CACert'; private const FIELD_SERVICE_ACCOUNT_JWT = 'ServiceAccountJWT'; - /** @var string */ public string $Host = ''; - /** @var string */ public string $CACert = ''; - /** @var string */ public string $ServiceAccountJWT = ''; - /** - * @return string - */ public function getHost(): string { return $this->Host; } - /** - * @param string $Host - * @return \DCarbone\PHPConsulAPI\ACL\KubernetesAuthMethodConfig - */ public function setHost(string $Host): self { $this->Host = $Host; return $this; } - /** - * @return string - */ public function getCACert(): string { return $this->CACert; } - /** - * @param string $CACert - * @return \DCarbone\PHPConsulAPI\ACL\KubernetesAuthMethodConfig - */ public function setCACert(string $CACert): self { $this->CACert = $CACert; return $this; } - /** - * @return string - */ public function getServiceAccountJWT(): string { return $this->ServiceAccountJWT; } - /** - * @param string $ServiceAccountJWT - * @return \DCarbone\PHPConsulAPI\ACL\KubernetesAuthMethodConfig - */ public function setServiceAccountJWT(string $ServiceAccountJWT): self { $this->ServiceAccountJWT = $ServiceAccountJWT; diff --git a/src/ACL/OIDCAuthMethodConfig.php b/src/ACL/OIDCAuthMethodConfig.php index 165d65cd..d8568659 100644 --- a/src/ACL/OIDCAuthMethodConfig.php +++ b/src/ACL/OIDCAuthMethodConfig.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ACL; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,9 +22,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class OIDCAuthMethodConfig - */ class OIDCAuthMethodConfig extends AbstractModel { } diff --git a/src/AbstractClient.php b/src/AbstractClient.php index e8ea68e3..0a9b322e 100644 --- a/src/AbstractClient.php +++ b/src/AbstractClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -27,35 +27,20 @@ use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\StreamInterface; -/** - * Class AbstractClient - */ abstract class AbstractClient { - /** @var \DCarbone\PHPConsulAPI\Config */ protected Config $_config; - /** - * AbstractConsulClient constructor. - * @param \DCarbone\PHPConsulAPI\Config $config - */ public function __construct(Config $config) { $this->_config = $config; } - /** - * @return \DCarbone\PHPConsulAPI\Config - */ public function getConfig(): Config { return $this->_config; } - /** - * @param \DCarbone\PHPConsulAPI\Request $r - * @return array - */ protected function _buildGuzzleRequestOptions(Request $r): array { // todo: figure out better guzzle integration @@ -90,13 +75,6 @@ protected function _buildGuzzleRequestOptions(Request $r): array return $opts; } - /** - * @param string $method - * @param string $path - * @param mixed $body - * @param \DCarbone\PHPConsulAPI\RequestOptions|null $opts - * @return \DCarbone\PHPConsulAPI\Request - */ protected function _newRequest(string $method, string $path, mixed $body, ?RequestOptions $opts): Request { $r = new Request($method, $path, $this->_config, $body); @@ -104,54 +82,26 @@ protected function _newRequest(string $method, string $path, mixed $body, ?Reque return $r; } - /** - * @param string $path - * @param mixed $body - * @param \DCarbone\PHPConsulAPI\RequestOptions|null $opts - * @return \DCarbone\PHPConsulAPI\Request - */ protected function _newPostRequest(string $path, mixed $body, ?RequestOptions $opts): Request { return $this->_newRequest(HTTP\MethodPost, $path, $body, $opts); } - /** - * @param string $path - * @param mixed $body - * @param \DCarbone\PHPConsulAPI\RequestOptions|null $opts - * @return \DCarbone\PHPConsulAPI\Request - */ protected function _newPutRequest(string $path, mixed $body, ?RequestOptions $opts): Request { return $this->_newRequest(HTTP\MethodPut, $path, $body, $opts); } - /** - * @param string $path - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @return \DCarbone\PHPConsulAPI\Request - */ protected function _newGetRequest(string $path, ?QueryOptions $opts): Request { return $this->_newRequest(HTTP\MethodGet, $path, null, $opts); } - /** - * @param string $path - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @return \DCarbone\PHPConsulAPI\Request - */ protected function _newDeleteRequest(string $path, ?WriteOptions $opts): Request { return $this->_newRequest(HTTP\MethodDelete, $path, null, $opts); } - /** - * @param \DCarbone\PHPConsulAPI\Request $r - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\RequestResponse - */ protected function _do(Request $r): RequestResponse { $start = microtime(true); @@ -187,12 +137,6 @@ protected function _do(Request $r): RequestResponse return new RequestResponse($r->meta(), $dur, $response, $err); } - /** - * @param \DCarbone\PHPConsulAPI\RequestResponse $r - * @param int[] $allowed - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\RequestResponse - */ protected function _requireStatus(RequestResponse $r, int ...$allowed): RequestResponse { // If a previous error occurred, just return as-is. @@ -241,77 +185,36 @@ protected function _requireStatus(RequestResponse $r, int ...$allowed): RequestR return $r; } - /** - * @param \DCarbone\PHPConsulAPI\RequestResponse $r - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\RequestResponse - */ protected function _requireOK(RequestResponse $r): RequestResponse { return $this->_requireStatus($r, HTTP\StatusOK); } - /** - * @param \DCarbone\PHPConsulAPI\RequestResponse $r - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\RequestResponse - */ protected function _requireNotFoundOrOK(RequestResponse $r): RequestResponse { return $this->_requireStatus($r, HTTP\StatusOK, HTTP\StatusNotFound); } - /** - * @param string $path - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\RequestResponse - */ protected function _doGet(string $path, ?QueryOptions $opts): RequestResponse { return $this->_do($this->_newGetRequest($path, $opts)); } - /** - * @param string $path - * @param mixed $body - * @param \DCarbone\PHPConsulAPI\RequestOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\RequestResponse - */ protected function _doPost(string $path, mixed $body, ?RequestOptions $opts): RequestResponse { return $this->_do($this->_newPostRequest($path, $body, $opts)); } - /** - * @param string $path - * @param mixed $body - * @param \DCarbone\PHPConsulAPI\RequestOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\RequestResponse - */ protected function _doPut(string $path, mixed $body, ?RequestOptions $opts): RequestResponse { return $this->_do($this->_newPutRequest($path, $body, $opts)); } - /** - * @param string $path - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\RequestResponse - */ protected function _doDelete(string $path, ?WriteOptions $opts): RequestResponse { return $this->_do($this->_newDeleteRequest($path, $opts)); } - /** - * @param \Psr\Http\Message\StreamInterface $body - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\DecodedBody - */ protected function _decodeBody(StreamInterface $body): DecodedBody { $data = @json_decode((string)$body, true); @@ -332,14 +235,6 @@ protected function _decodeBody(StreamInterface $body): DecodedBody ); } - /** - * @param string $path - * @param mixed $body - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ protected function _executePut(string $path, mixed $body, ?WriteOptions $opts): WriteResponse { $resp = $this->_requireOK($this->_doPut($path, $body, $opts)); @@ -348,14 +243,6 @@ protected function _executePut(string $path, mixed $body, ?WriteOptions $opts): return $ret; } - /** - * @param string $path - * @param mixed $body - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ protected function _executePost(string $path, mixed $body, ?WriteOptions $opts): WriteResponse { $resp = $this->_requireOK($this->_doPost($path, $body, $opts)); @@ -364,13 +251,6 @@ protected function _executePost(string $path, mixed $body, ?WriteOptions $opts): return $ret; } - /** - * @param string $path - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ protected function _executeDelete(string $path, ?WriteOptions $opts): WriteResponse { $resp = $this->_requireOK($this->_doDelete($path, $opts)); @@ -379,14 +259,6 @@ protected function _executeDelete(string $path, ?WriteOptions $opts): WriteRespo return $ret; } - /** - * @param string $path - * @param mixed $body - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedWriteStringResponse - */ protected function _executePutValuedStr(string $path, mixed $body, ?WriteOptions $opts): ValuedWriteStringResponse { $r = $this->_newPutRequest($path, $body, $opts); @@ -396,13 +268,6 @@ protected function _executePutValuedStr(string $path, mixed $body, ?WriteOptions return $ret; } - /** - * @param string $path - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedQueryStringResponse - */ protected function _executeGetValuedStr(string $path, ?QueryOptions $opts): ValuedQueryStringResponse { $r = $this->_newGetRequest($path, $opts); @@ -412,13 +277,6 @@ protected function _executeGetValuedStr(string $path, ?QueryOptions $opts): Valu return $ret; } - /** - * @param string $path - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedQueryStringsResponse - */ protected function _executeGetValuedStrs(string $path, ?QueryOptions $opts): ValuedQueryStringsResponse { $r = $this->_newGetRequest($path, $opts); diff --git a/src/AbstractModel.php b/src/AbstractModel.php index e3d61527..d38bae8b 100644 --- a/src/AbstractModel.php +++ b/src/AbstractModel.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ limitations under the License. */ -/** - * Class AbstractModel - */ abstract class AbstractModel implements \JsonSerializable { use Marshaller; @@ -30,10 +27,6 @@ abstract class AbstractModel implements \JsonSerializable protected const FIELDS = []; - /** - * Stores dynamically assigned variables - * @var array - */ private array $_dyn = []; /** @@ -93,9 +86,6 @@ public function jsonSerialize(): array return $out; } - /** - * @return string - */ public function __toString(): string { return static::class; diff --git a/src/AbstractResponse.php b/src/AbstractResponse.php index a5f70ebf..914bacd4 100644 --- a/src/AbstractResponse.php +++ b/src/AbstractResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,32 +20,18 @@ limitations under the License. */ -/** - * Class AbstractResponse - */ abstract class AbstractResponse implements \ArrayAccess { - /** - * @param mixed $offset - */ public function offsetUnset(mixed $offset): void { throw new \BadMethodCallException(sprintf('Calling %s on class %s is forbidden', __METHOD__, static::class)); } - /** - * @param mixed $offset - * @param mixed $value - */ public function offsetSet(mixed $offset, mixed $value): void { throw new \BadMethodCallException(sprintf('Calling %s on class %s is forbidden', __METHOD__, static::class)); } - /** - * @param mixed $offset - * @return \OutOfRangeException - */ protected function _newOutOfRangeException(mixed $offset): \OutOfRangeException { return new \OutOfRangeException(sprintf('Offset %s does not exist', $offset)); diff --git a/src/AbstractValuedQueryResponse.php b/src/AbstractValuedQueryResponse.php index 98e35a0e..c56bec8a 100644 --- a/src/AbstractValuedQueryResponse.php +++ b/src/AbstractValuedQueryResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,27 +20,16 @@ limitations under the License. */ -/** - * Class AbstractValuedQueryResponse - */ abstract class AbstractValuedQueryResponse extends AbstractResponse implements ValuedResponseInterface { use QueryMetaContainer; use ErrorContainer; - /** - * @param mixed $offset - * @return bool - */ public function offsetExists(mixed $offset): bool { return \is_int($offset) && 0 <= $offset && $offset < 3; } - /** - * @param mixed $offset - * @return \DCarbone\PHPConsulAPI\Error|\DCarbone\PHPConsulAPI\QueryMeta|mixed|null - */ public function offsetGet(mixed $offset): mixed { if (0 === $offset) { diff --git a/src/AbstractValuedResponse.php b/src/AbstractValuedResponse.php index 65410efb..0d602a4b 100644 --- a/src/AbstractValuedResponse.php +++ b/src/AbstractValuedResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,26 +20,15 @@ limitations under the License. */ -/** - * Class AbstractValuedResponse - */ abstract class AbstractValuedResponse extends AbstractResponse implements ValuedResponseInterface { use ErrorContainer; - /** - * @param mixed $offset - * @return bool - */ public function offsetExists(mixed $offset): bool { return \is_int($offset) && 0 <= $offset && $offset < 2; } - /** - * @param mixed $offset - * @return \DCarbone\PHPConsulAPI\Error|mixed|null - */ public function offsetGet(mixed $offset): mixed { if (0 === $offset) { diff --git a/src/AbstractValuedWriteResponse.php b/src/AbstractValuedWriteResponse.php index 0ba1da2a..03e5a13e 100644 --- a/src/AbstractValuedWriteResponse.php +++ b/src/AbstractValuedWriteResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,27 +20,16 @@ limitations under the License. */ -/** - * Class AbstractValuedWriteResponse - */ abstract class AbstractValuedWriteResponse extends AbstractResponse implements ValuedResponseInterface { use WriteMetaContainer; use ErrorContainer; - /** - * @param mixed $offset - * @return bool - */ public function offsetExists(mixed $offset): bool { return \is_int($offset) && 0 <= $offset && $offset < 3; } - /** - * @param mixed $offset - * @return \DCarbone\PHPConsulAPI\Error|\DCarbone\PHPConsulAPI\WriteMeta|mixed|null - */ public function offsetGet(mixed $offset): mixed { if (0 === $offset) { diff --git a/src/Agent/AgentCheck.php b/src/Agent/AgentCheck.php index edd18c42..55235175 100644 --- a/src/Agent/AgentCheck.php +++ b/src/Agent/AgentCheck.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\Health\HealthCheckDefinition; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AgentCheck - */ class AgentCheck extends AbstractModel { protected const FIELDS = [ @@ -40,33 +37,18 @@ class AgentCheck extends AbstractModel private const FIELD_DEFINITION = 'Definition'; private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $Node = ''; - /** @var string */ public string $CheckID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Status = ''; - /** @var string */ public string $Notes = ''; - /** @var string */ public string $Output = ''; - /** @var string */ public string $ServiceID = ''; - /** @var string */ public string $ServiceName = ''; - /** @var string */ public string $Type = ''; - /** @var \DCarbone\PHPConsulAPI\Health\HealthCheckDefinition */ public HealthCheckDefinition $Definition; - /** @var string */ public string $Namespace = ''; - /** - * AgentCheck constructor. - * @param array|null $data - */ public function __construct(?array $data = null) { parent::__construct($data); @@ -75,206 +57,126 @@ public function __construct(?array $data = null) } } - /** - * @return string - */ public function getNode(): string { return $this->Node; } - /** - * @param string $Node - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck - */ public function setNode(string $Node): self { $this->Node = $Node; return $this; } - /** - * @return string - */ public function getCheckID(): string { return $this->CheckID; } - /** - * @param string $CheckID - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck - */ public function setCheckID(string $CheckID): self { $this->CheckID = $CheckID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getStatus(): string { return $this->Status; } - /** - * @param string $Status - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck - */ public function setStatus(string $Status): self { $this->Status = $Status; return $this; } - /** - * @return string - */ public function getNotes(): string { return $this->Notes; } - /** - * @param string $Notes - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck - */ public function setNotes(string $Notes): self { $this->Notes = $Notes; return $this; } - /** - * @return string - */ public function getOutput(): string { return $this->Output; } - /** - * @param string $Output - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck - */ public function setOutput(string $Output): self { $this->Output = $Output; return $this; } - /** - * @return string - */ public function getServiceID(): string { return $this->ServiceID; } - /** - * @param string $ServiceID - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck - */ public function setServiceID(string $ServiceID): self { $this->ServiceID = $ServiceID; return $this; } - /** - * @return string - */ public function getServiceName(): string { return $this->ServiceName; } - /** - * @param string $ServiceName - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck - */ public function setServiceName(string $ServiceName): self { $this->ServiceName = $ServiceName; return $this; } - /** - * @return string - */ public function getType(): string { return $this->Type; } - /** - * @param string $Type - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck - */ public function setType(string $Type): self { $this->Type = $Type; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Health\HealthCheckDefinition - */ public function getDefinition(): HealthCheckDefinition { return $this->Definition; } - /** - * @param \DCarbone\PHPConsulAPI\Health\HealthCheckDefinition $Definition - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck - */ public function setDefinition(HealthCheckDefinition $Definition): self { $this->Definition = $Definition; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return string - */ public function __toString(): string { return $this->CheckID; diff --git a/src/Agent/AgentCheckRegistration.php b/src/Agent/AgentCheckRegistration.php index 4eb562a2..0a2210f0 100644 --- a/src/Agent/AgentCheckRegistration.php +++ b/src/Agent/AgentCheckRegistration.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,9 +22,6 @@ use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AgentCheckRegistration - */ class AgentCheckRegistration extends AgentServiceCheck { protected const FIELDS = [ @@ -37,61 +34,37 @@ class AgentCheckRegistration extends AgentServiceCheck private const FIELD_SERVICE_ID = 'ServiceID'; private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $ServiceID = ''; - /** @var string */ public string $Namespace = ''; - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheckRegistration - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getServiceID(): string { return $this->ServiceID; } - /** - * @param string $ServiceID - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheckRegistration - */ public function setServiceID(string $ServiceID): self { $this->ServiceID = $ServiceID; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheckRegistration - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; diff --git a/src/Agent/AgentCheckUpdate.php b/src/Agent/AgentCheckUpdate.php index b511a3d6..aed5f53a 100644 --- a/src/Agent/AgentCheckUpdate.php +++ b/src/Agent/AgentCheckUpdate.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,56 +22,33 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class AgentCheckUpdate - * @internal use internally by AgentClient - */ final class AgentCheckUpdate extends AbstractModel { - /** @var string */ public string $Status = ''; - /** @var string */ public string $Output = ''; - /** - * @return string - */ public function getStatus(): string { return $this->Status; } - /** - * @param string $status - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheckUpdate - */ public function setStatus(string $status): self { $this->Status = $status; return $this; } - /** - * @return string - */ public function getOutput(): string { return $this->Output; } - /** - * @param string $output - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheckUpdate - */ public function setOutput(string $output): self { $this->Output = $output; return $this; } - /** - * @return string - */ public function __toString(): string { return sprintf('%s: %s', $this->Status, $this->Output); diff --git a/src/Agent/AgentChecksResponse.php b/src/Agent/AgentChecksResponse.php index 1817be65..4cf50761 100644 --- a/src/Agent/AgentChecksResponse.php +++ b/src/Agent/AgentChecksResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class AgentChecksResponse - */ class AgentChecksResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Agent\AgentCheck[]|null */ public ?array $Checks = null; - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck[]|null - */ public function getValue(): ?array { return $this->Checks; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->Checks = []; diff --git a/src/Agent/AgentClient.php b/src/Agent/AgentClient.php index 6bc00be4..7e896ead 100644 --- a/src/Agent/AgentClient.php +++ b/src/Agent/AgentClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -29,20 +29,10 @@ use DCarbone\PHPConsulAPI\Request; use DCarbone\PHPConsulAPI\ValuedStringResponse; -/** - * Class AgentClient - */ class AgentClient extends AbstractClient { - /** @var \DCarbone\PHPConsulAPI\MapResponse|null */ private ?MapResponse $_self = null; - /** - * @param bool $refresh - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\MapResponse - */ public function Self(bool $refresh = false): MapResponse { if (!$refresh && isset($this->_self)) { @@ -57,11 +47,6 @@ public function Self(bool $refresh = false): MapResponse return $ret; } - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\MapResponse - */ public function Host(): MapResponse { $resp = $this->_requireOK($this->_doGet('v1/agent/host', null)); @@ -70,11 +55,6 @@ public function Host(): MapResponse return $ret; } - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Agent\MetricsInfoResponse - */ public function Metrics(): MetricsInfoResponse { $resp = $this->_requireOK($this->_doGet('v1/agent/metrics', null)); @@ -83,20 +63,11 @@ public function Metrics(): MetricsInfoResponse return $ret; } - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function Reload(): ?Error { return $this->_executePut('v1/agent/reload', null, null)->Err; } - /** - * @param bool $refresh - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\ValuedStringResponse - */ public function NodeName(bool $refresh = false): ValuedStringResponse { $self = $this->Self($refresh); @@ -111,12 +82,6 @@ public function NodeName(bool $refresh = false): ValuedStringResponse return $ret; } - /** - * @param string $filter - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Agent\AgentChecksResponse - */ public function ChecksWithFilter(string $filter): AgentChecksResponse { $r = $this->_newGetRequest('v1/agent/checks', null); @@ -127,21 +92,11 @@ public function ChecksWithFilter(string $filter): AgentChecksResponse return $ret; } - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Agent\AgentChecksResponse - */ public function Checks(): AgentChecksResponse { return $this->checksWithFilter(''); } - /** - * @param string $filter - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Agent\AgentServicesResponse - */ public function ServicesWithFilter(string $filter): AgentServicesResponse { $r = $this->_newGetRequest('v1/agent/services', null); @@ -152,21 +107,11 @@ public function ServicesWithFilter(string $filter): AgentServicesResponse return $ret; } - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Agent\AgentServicesResponse - */ public function Services(): AgentServicesResponse { return $this->ServicesWithFilter(''); } - /** - * @param string $id - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Agent\AgentHealthServiceResponse - */ public function AgentHealthServiceByID(string $id): AgentHealthServiceResponse { $r = $this->_prepAgentHealthServiceRequest(sprintf('v1/agent/health/service/id/%s', $id)); @@ -195,12 +140,6 @@ public function AgentHealthServiceByID(string $id): AgentHealthServiceResponse return new AgentHealthServiceResponse($status, $dec->Decoded, null); } - /** - * @param string $service - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Agent\AgentHealthServicesResponse - */ public function AgentHealthServiceByName(string $service): AgentHealthServicesResponse { $r = $this->_prepAgentHealthServiceRequest(sprintf('v1/agent/health/service/name/%s', urlencode($service))); @@ -229,13 +168,6 @@ public function AgentHealthServiceByName(string $service): AgentHealthServicesRe return new AgentHealthServicesResponse($status, $dec->Decoded, null); } - /** - * @param string $serviceID - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceResponse - */ public function Service(string $serviceID, ?QueryOptions $opts = null): AgentServiceResponse { $resp = $this->_requireOK($this->_doGet(sprintf('v1/agent/service/%s', $serviceID), $opts)); @@ -244,11 +176,6 @@ public function Service(string $serviceID, ?QueryOptions $opts = null): AgentSer return $ret; } - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Agent\AgentMembersResponse - */ public function Members(): AgentMembersResponse { $resp = $this->_requireOK($this->_doGet('v1/agent/members', null)); @@ -257,12 +184,6 @@ public function Members(): AgentMembersResponse return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\MemberOpts $memberOpts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Agent\AgentMembersResponse - */ public function MemberOpts(MemberOpts $memberOpts): AgentMembersResponse { $r = $this->_newGetRequest('v1/agent/members', null); @@ -276,13 +197,6 @@ public function MemberOpts(MemberOpts $memberOpts): AgentMembersResponse return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration $service - * @param \DCarbone\PHPConsulAPI\Agent\ServiceRegisterOpts $registerOpts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function ServiceRegisterOpts(AgentServiceRegistration $service, ServiceRegisterOpts $registerOpts): ?Error { $r = $this->_newPutRequest('v1/agent/service/register', $service, null); @@ -292,82 +206,32 @@ public function ServiceRegisterOpts(AgentServiceRegistration $service, ServiceRe return $this->_requireOK($this->_do($r))->Err; } - /** - * Register a service within Consul - * - * @param \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration $service - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function ServiceRegister(AgentServiceRegistration $service): ?Error { return $this->ServiceRegisterOpts($service, new ServiceRegisterOpts(['ReplaceExistingChecks' => false])); } - /** - * Remove a service from Consul - * - * @param string $serviceID - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function ServiceDeregister(string $serviceID): ?Error { $r = new Request(HTTP\MethodPut, sprintf('v1/agent/service/deregister/%s', $serviceID), $this->_config, null); return $this->_requireOK($this->_do($r))->Err; } - /** - * Set ttl check status to passing with optional note - * - * @param string $checkID - * @param string $note - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Error|null - * @deprecated use UpdateTTL - */ public function PassTTL(string $checkID, string $note): ?Error { return $this->UpdateTTL($checkID, $note, 'pass'); } - /** - * Set ttl check status to warning with optional note - * - * @param string $checkID - * @param string $note - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Error|null - * @deprecated use UpdateTTL - */ public function WarnTTL(string $checkID, string $note): ?Error { return $this->UpdateTTL($checkID, $note, 'warn'); } - /** - * Set ttl check status to critical with optional note - * - * @param string $checkID - * @param string $note - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Error|null - * @deprecated use UpdateTTL - */ public function FailTTL(string $checkID, string $note): ?Error { return $this->UpdateTTL($checkID, $note, 'fail'); } - /** - * @param string $checkID - * @param string $output - * @param string $status - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function UpdateTTL(string $checkID, string $output, string $status): ?Error { switch ($status) { @@ -398,33 +262,16 @@ public function UpdateTTL(string $checkID, string $output, string $status): ?Err return $this->_requireOK($this->_do($r))->Err; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentCheckRegistration $check - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function CheckRegister(AgentCheckRegistration $check): ?Error { return $this->_executePut('v1/agent/check/register', $check, null)->Err; } - /** - * @param string $checkID - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function CheckDeregister(string $checkID): ?Error { return $this->_executePut(sprintf('v1/agent/check/deregister/%s', $checkID), null, null)->Err; } - /** - * @param string $addr - * @param bool $wan - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function Join(string $addr, bool $wan = false): ?Error { $r = $this->_newPutRequest(sprintf('v1/agent/join/%s', $addr), null, null); @@ -434,31 +281,16 @@ public function Join(string $addr, bool $wan = false): ?Error return $this->_requireOK($this->_do($r))->Err; } - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function Leave(): ?Error { return $this->_executePut('v1/agent/leave', null, null)->Err; } - /** - * @param string $node - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function ForceLeave(string $node): ?Error { return $this->_executePut(sprintf('v1/agent/force-leave/%s', $node), null, null)->Err; } - /** - * @param string $node - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function ForceLeavePrune(string $node): ?Error { $r = $this->_newPutRequest(sprintf('v1/agent/force-leave/%s', $node), null, null); @@ -466,13 +298,6 @@ public function ForceLeavePrune(string $node): ?Error return $this->_requireOK($this->_do($r))->Err; } - /** - * @param string $serviceID - * @param string $reason - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function EnableServiceMaintenance(string $serviceID, string $reason = ''): ?Error { $r = $this->_newPutRequest(sprintf('v1/agent/service/maintenance/%s', $serviceID), null, null); @@ -481,12 +306,6 @@ public function EnableServiceMaintenance(string $serviceID, string $reason = '') return $this->_requireOK($this->_do($r))->Err; } - /** - * @param string $serviceID - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function DisableServiceMaintenance(string $serviceID): ?Error { $r = $this->_newPutRequest(sprintf('v1/agent/service/maintenance/%s', $serviceID), null, null); @@ -494,12 +313,6 @@ public function DisableServiceMaintenance(string $serviceID): ?Error return $this->_requireOK($this->_do($r))->Err; } - /** - * @param string $reason - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function EnableNodeMaintenance(string $reason = ''): ?Error { $r = $this->_newPutRequest('v1/agent/maintenance', null, null); @@ -508,11 +321,6 @@ public function EnableNodeMaintenance(string $reason = ''): ?Error return $this->_requireOK($this->_do($r))->Err; } - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function DisableNodeMaintenance(): ?Error { $r = $this->_newPutRequest('v1/agent/maintenance', null, null); diff --git a/src/Agent/AgentHealthServiceResponse.php b/src/Agent/AgentHealthServiceResponse.php index d968ff70..1da8b3c8 100644 --- a/src/Agent/AgentHealthServiceResponse.php +++ b/src/Agent/AgentHealthServiceResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,24 +24,13 @@ use DCarbone\PHPConsulAPI\Error; use DCarbone\PHPConsulAPI\ErrorContainer; -/** - * Class AgentHealthServiceResponse - */ class AgentHealthServiceResponse extends AbstractResponse { use ErrorContainer; - /** @var string */ public string $AggregatedStatus = ''; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentServiceChecksInfo|null */ public ?AgentServiceChecksInfo $AgentServiceChecksInfo = null; - /** - * AgentHealthServiceResponse constructor. - * @param string $aggregatedStatus - * @param array|null $checkInfo - * @param \DCarbone\PHPConsulAPI\Error|null $err - */ public function __construct(string $aggregatedStatus, ?array $checkInfo, ?Error $err) { $this->AggregatedStatus = $aggregatedStatus; @@ -51,35 +40,21 @@ public function __construct(string $aggregatedStatus, ?array $checkInfo, ?Error $this->Err = $err; } - /** - * @return string - */ public function getAggregatedStatus(): string { return $this->AggregatedStatus; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceChecksInfo[]|null - */ public function getAgentServiceChecksInfos(): ?AgentServiceChecksInfo { return $this->AgentServiceChecksInfo; } - /** - * @param mixed $offset - * @return bool - */ public function offsetExists(mixed $offset): bool { return \is_int($offset) && 0 <= $offset && $offset < 3; } - /** - * @param mixed $offset - * @return \DCarbone\PHPConsulAPI\Error|string|AgentServiceChecksInfo|null - */ public function offsetGet(mixed $offset): Error|string|null|AgentServiceChecksInfo { if (0 === $offset) { diff --git a/src/Agent/AgentHealthServicesResponse.php b/src/Agent/AgentHealthServicesResponse.php index ab2eb2cf..d6d3a4c6 100644 --- a/src/Agent/AgentHealthServicesResponse.php +++ b/src/Agent/AgentHealthServicesResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,24 +24,13 @@ use DCarbone\PHPConsulAPI\Error; use DCarbone\PHPConsulAPI\ErrorContainer; -/** - * Class AgentHealthServiceResponse - */ class AgentHealthServicesResponse extends AbstractResponse { use ErrorContainer; - /** @var string */ public string $AggregatedStatus = ''; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentServiceChecksInfo[]|null */ public ?array $AgentServiceChecksInfos = null; - /** - * AgentHealthServiceResponse constructor. - * @param string $aggregatedStatus - * @param array|null $checkInfos - * @param \DCarbone\PHPConsulAPI\Error|null $err - */ public function __construct(string $aggregatedStatus, ?array $checkInfos, ?Error $err) { $this->AggregatedStatus = $aggregatedStatus; @@ -54,35 +43,21 @@ public function __construct(string $aggregatedStatus, ?array $checkInfos, ?Error $this->Err = $err; } - /** - * @return string - */ public function getAggregatedStatus(): string { return $this->AggregatedStatus; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceChecksInfo[]|null - */ public function getAgentServiceChecksInfos(): ?array { return $this->AgentServiceChecksInfos; } - /** - * @param mixed $offset - * @return bool - */ public function offsetExists(mixed $offset): bool { return \is_int($offset) && 0 <= $offset && $offset < 3; } - /** - * @param mixed $offset - * @return array|\DCarbone\PHPConsulAPI\Agent\AgentServiceChecksInfo[]|\DCarbone\PHPConsulAPI\Error|mixed|string|null - */ public function offsetGet(mixed $offset): mixed { if (0 === $offset) { diff --git a/src/Agent/AgentMember.php b/src/Agent/AgentMember.php index ac772c27..80167a8c 100644 --- a/src/Agent/AgentMember.php +++ b/src/Agent/AgentMember.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,117 +24,71 @@ use DCarbone\PHPConsulAPI\Consul; use DCarbone\PHPConsulAPI\HasStringTags; -/** - * Class AgentMember - */ class AgentMember extends AbstractModel { use HasStringTags; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Addr = ''; - /** @var int */ public int $Port = 0; - /** @var string */ public string $Status = ''; - /** @var int */ public int $ProtocolMin = 0; - /** @var int */ public int $ProtocolMax = 0; - /** @var int */ public int $ProtocolCur = 0; - /** @var int */ public int $DelegateMin = 0; - /** @var int */ public int $DelegateMax = 0; - /** @var int */ public int $DelegateCur = 0; - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @return string - */ public function getAddr(): string { return $this->Addr; } - /** - * @return int - */ public function getPort(): int { return $this->Port; } - /** - * @return string - */ public function getStatus(): string { return $this->Status; } - /** - * @return int - */ public function getProtocolMin(): int { return $this->ProtocolMin; } - /** - * @return int - */ public function getProtocolMax(): int { return $this->ProtocolMax; } - /** - * @return int - */ public function getProtocolCur(): int { return $this->ProtocolCur; } - /** - * @return int - */ public function getDelegateMin(): int { return $this->DelegateMin; } - /** - * @return int - */ public function getDelegateMax(): int { return $this->DelegateMax; } - /** - * @return int - */ public function getDelegateCur(): int { return $this->DelegateCur; } - /** - * @return string - */ public function ACLMode(): string { return match ($this->Tags[Consul::MemberTagKeyACLMode] ?? null) { @@ -145,18 +99,12 @@ public function ACLMode(): string }; } - /** - * @return bool - */ public function IsConsulServer(): bool { return isset($this->Tags[Consul::MemberTagKeyACLMode]) && Consul::MemberTagValueRoleServer === $this->Tags[Consul::MemberTagKeyACLMode]; } - /** - * @return string - */ public function __toString(): string { return $this->Name; diff --git a/src/Agent/AgentMembersResponse.php b/src/Agent/AgentMembersResponse.php index 5b26a5b4..816c924e 100644 --- a/src/Agent/AgentMembersResponse.php +++ b/src/Agent/AgentMembersResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class AgentMembersResponse - */ class AgentMembersResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Agent\AgentMember[]|null */ public ?array $Members = null; - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentMember[]|null - */ public function getValue(): ?array { return $this->Members; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->Members = []; diff --git a/src/Agent/AgentService.php b/src/Agent/AgentService.php index f6d2efa8..dd4de64e 100644 --- a/src/Agent/AgentService.php +++ b/src/Agent/AgentService.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,9 +26,6 @@ use DCarbone\PHPConsulAPI\HasStringTags; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AgentService - */ class AgentService extends AbstractModel { use HasStringTags; @@ -77,43 +74,23 @@ class AgentService extends AbstractModel private const FIELD_NAMESPACE = 'Namespace'; private const FIELD_DATACENTER = 'Datacenter'; - /** @var string */ public string $Kind = ''; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Service = ''; - /** @var \DCarbone\PHPConsulAPI\FakeMap */ public FakeMap $Meta; - /** @var int */ public int $Port = 0; - /** @var string */ public string $Address = ''; - /** @var \DCarbone\PHPConsulAPI\Catalog\ServiceAddress[] */ public array $TaggedAddresses = []; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentWeights */ public AgentWeights $Weights; - /** @var bool */ public bool $EnableTagOverride = false; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** @var string */ public string $ContentHash = ''; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig|null */ public ?AgentServiceConnectProxyConfig $Proxy = null; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentServiceConnect|null */ public ?AgentServiceConnect $Connect = null; - /** @var string */ public string $Namespace = ''; - /** @var string */ public string $Datacenter = ''; - /** - * AgentService constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -125,288 +102,176 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getKind(): string { return $this->Kind; } - /** - * @param string $Kind - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setKind(string $Kind): self { $this->Kind = $Kind; return $this; } - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getService(): string { return $this->Service; } - /** - * @param string $Service - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setService(string $Service): self { $this->Service = $Service; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\FakeMap - */ public function getMeta(): FakeMap { return $this->Meta; } - /** - * @param \DCarbone\PHPConsulAPI\FakeMap $Meta - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setMeta(FakeMap $Meta): self { $this->Meta = $Meta; return $this; } - /** - * @return int - */ public function getPort(): int { return $this->Port; } - /** - * @param int $Port - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setPort(int $Port): self { $this->Port = $Port; return $this; } - /** - * @return string - */ public function getAddress(): string { return $this->Address; } - /** - * @param string $Address - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setAddress(string $Address): self { $this->Address = $Address; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Catalog\ServiceAddress[] - */ public function getTaggedAddresses(): array { return $this->TaggedAddresses; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\ServiceAddress[] $TaggedAddresses - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setTaggedAddresses(array $TaggedAddresses): self { $this->TaggedAddresses = $TaggedAddresses; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentWeights - */ public function getWeights(): AgentWeights { return $this->Weights; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentWeights $Weights - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setWeights(AgentWeights $Weights): self { $this->Weights = $Weights; return $this; } - /** - * @return bool - */ public function isEnableTagOverride(): bool { return $this->EnableTagOverride; } - /** - * @param bool $EnableTagOverride - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setEnableTagOverride(bool $EnableTagOverride): self { $this->EnableTagOverride = $EnableTagOverride; return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; return $this; } - /** - * @return string - */ public function getContentHash(): string { return $this->ContentHash; } - /** - * @param string $ContentHash - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setContentHash(string $ContentHash): self { $this->ContentHash = $ContentHash; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig|null - */ public function getProxy(): ?AgentServiceConnectProxyConfig { return $this->Proxy; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig|null $Proxy - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setProxy(?AgentServiceConnectProxyConfig $Proxy): self { $this->Proxy = $Proxy; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnect|null - */ public function getConnect(): ?AgentServiceConnect { return $this->Connect; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentServiceConnect|null $Connect - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setConnect(?AgentServiceConnect $Connect): self { $this->Connect = $Connect; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @param string $Datacenter - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function setDatacenter(string $Datacenter): self { $this->Datacenter = $Datacenter; diff --git a/src/Agent/AgentServiceCheck.php b/src/Agent/AgentServiceCheck.php index 1ada70b8..c31a3319 100644 --- a/src/Agent/AgentServiceCheck.php +++ b/src/Agent/AgentServiceCheck.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AgentServiceCheck - */ class AgentServiceCheck extends AbstractModel { protected const FIELDS = [ @@ -86,442 +83,266 @@ class AgentServiceCheck extends AbstractModel private const FIELD_FAILURES_BEFORE_CRITICAL = 'FailuresBeforeCritical'; private const FIELD_DEREGISTER_CRITICAL_SERVICE_AFTER = 'DeregisterCriticalServiceAfter'; - /** @var string */ public string $CheckID = ''; - /** @var string */ public string $Name = ''; - /** @var string[] */ public array $ScriptArgs = []; - /** @var string */ public string $DockerContainerID = ''; - /** @var string */ public string $Shell = ''; - /** @var string */ public string $Interval = ''; - /** @var string */ public string $Timeout = ''; - /** @var string */ public string $TTL = ''; - /** @var string */ public string $HTTP = ''; - /** @var array */ public array $Header = []; - /** @var string */ public string $Method = ''; - /** @var string */ public string $TCP = ''; - /** @var string */ public string $Status = ''; - /** @var string */ public string $Notes = ''; - /** @var bool */ public bool $TLSSkipVerify = false; - /** @var string */ public string $GRPC = ''; - /** @var bool */ public bool $GRPCUseTLS = false; - /** @var string */ public string $AliasNode = ''; - /** @var string */ public string $AliasService = ''; - /** @var int */ public int $SuccessBeforePassing = 0; - /** @var int */ public int $FailuresBeforeCritical = 0; - /** @var string */ public string $DeregisterCriticalServiceAfter = ''; - /** - * @return string - */ public function getCheckID(): string { return $this->CheckID; } - /** - * @param string $checkID - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setCheckID(string $checkID): self { $this->CheckID = $checkID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $name - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setName(string $name): self { $this->Name = $name; return $this; } - /** - * @return string[] - */ public function getScriptArgs(): array { return $this->ScriptArgs; } - /** - * @param string[] $args - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setScriptArgs(array $args): self { $this->ScriptArgs = $args; return $this; } - /** - * @return string - */ public function getDockerContainerID(): string { return $this->DockerContainerID; } - /** - * @param string $dockerContainerID - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setDockerContainerID(string $dockerContainerID): self { $this->DockerContainerID = $dockerContainerID; return $this; } - /** - * @return string - */ public function getShell(): string { return $this->Shell; } - /** - * @param string $shell - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setShell(string $shell): self { $this->Shell = $shell; return $this; } - /** - * @return string - */ public function getInterval(): string { return $this->Interval; } - /** - * @param string $interval - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setInterval(string $interval): self { $this->Interval = $interval; return $this; } - /** - * @return string - */ public function getTimeout(): string { return $this->Timeout; } - /** - * @param string $timeout - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setTimeout(string $timeout): self { $this->Timeout = $timeout; return $this; } - /** - * @return string - */ public function getTTL(): string { return $this->TTL; } - /** - * @param string $ttl - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setTTL(string $ttl): self { $this->TTL = $ttl; return $this; } - /** - * @return string - */ public function getHTTP(): string { return $this->HTTP; } - /** - * @param string $http - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setHTTP(string $http): self { $this->HTTP = $http; return $this; } - /** - * @return array - */ public function getHeader(): array { return $this->Header; } - /** - * @param array $header - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setHeader(array $header): self { $this->Header = $header; return $this; } - /** - * @return string - */ public function getMethod(): string { return $this->Method; } - /** - * @param string $method - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setMethod(string $method): self { $this->Method = $method; return $this; } - /** - * @return string - */ public function getTCP(): string { return $this->TCP; } - /** - * @param string $tcp - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setTCP(string $tcp): self { $this->TCP = $tcp; return $this; } - /** - * @return string - */ public function getStatus(): string { return $this->Status; } - /** - * @param string $status - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setStatus(string $status): self { $this->Status = $status; return $this; } - /** - * @return string - */ public function getNotes(): string { return $this->Notes; } - /** - * @param string $notes - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setNotes(string $notes): self { $this->Notes = $notes; return $this; } - /** - * @return bool - */ public function isTLSSkipVerify(): bool { return $this->TLSSkipVerify; } - /** - * @param bool $tlsSkipVerify - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setTLSSkipVerify(bool $tlsSkipVerify): self { $this->TLSSkipVerify = $tlsSkipVerify; return $this; } - /** - * @return string - */ public function getGRPC(): string { return $this->GRPC; } - /** - * @param string $GRPC - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setGRPC(string $GRPC): self { $this->GRPC = $GRPC; return $this; } - /** - * @return bool - */ public function isGRPCUseTLS(): bool { return $this->GRPCUseTLS; } - /** - * @param bool $GRPCUseTLS - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setGRPCUseTLS(bool $GRPCUseTLS): self { $this->GRPCUseTLS = $GRPCUseTLS; return $this; } - /** - * @return string - */ public function getAliasNode(): string { return $this->AliasNode; } - /** - * @param string $AliasNode - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setAliasNode(string $AliasNode): self { $this->AliasNode = $AliasNode; return $this; } - /** - * @return string - */ public function getAliasService(): string { return $this->AliasService; } - /** - * @param string $AliasService - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setAliasService(string $AliasService): self { $this->AliasService = $AliasService; return $this; } - /** - * @return int - */ public function getSuccessBeforePassing(): int { return $this->SuccessBeforePassing; } - /** - * @param int $SuccessBeforePassing - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setSuccessBeforePassing(int $SuccessBeforePassing): self { $this->SuccessBeforePassing = $SuccessBeforePassing; return $this; } - /** - * @return int - */ public function getFailuresBeforeCritical(): int { return $this->FailuresBeforeCritical; } - /** - * @param int $FailuresBeforeCritical - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setFailuresBeforeCritical(int $FailuresBeforeCritical): self { $this->FailuresBeforeCritical = $FailuresBeforeCritical; return $this; } - /** - * @return string - */ public function getDeregisterCriticalServiceAfter(): string { return $this->DeregisterCriticalServiceAfter; } - /** - * @param string $deregisterCriticalServiceAfter - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck - */ public function setDeregisterCriticalServiceAfter(string $deregisterCriticalServiceAfter): self { $this->DeregisterCriticalServiceAfter = $deregisterCriticalServiceAfter; diff --git a/src/Agent/AgentServiceChecks.php b/src/Agent/AgentServiceChecks.php index e5b9835b..314f9339 100644 --- a/src/Agent/AgentServiceChecks.php +++ b/src/Agent/AgentServiceChecks.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,18 +23,10 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\FakeSlice; -/** - * Class AgentServiceChecks - */ class AgentServiceChecks extends FakeSlice { - /** @var string */ protected string $containedClass = AgentServiceCheck::class; - /** - * @param array $data - * @return \DCarbone\PHPConsulAPI\AbstractModel - */ protected function newChild(array $data): AbstractModel { return new AgentServiceCheck($data); diff --git a/src/Agent/AgentServiceChecksInfo.php b/src/Agent/AgentServiceChecksInfo.php index 3226e284..f2fb3dd6 100644 --- a/src/Agent/AgentServiceChecksInfo.php +++ b/src/Agent/AgentServiceChecksInfo.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\Health\HealthChecks; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AgentServiceChecksInfo - */ class AgentServiceChecksInfo extends AbstractModel { protected const FIELDS = [ @@ -44,17 +41,10 @@ class AgentServiceChecksInfo extends AbstractModel private const FIELD_SERVICE = 'Service'; private const FIELD_CHECKS = 'Checks'; - /** @var string */ public string $AggregatedStatus = ''; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentService|null */ public ?AgentService $Service = null; - /** @var \DCarbone\PHPConsulAPI\Health\HealthChecks */ public HealthChecks $Checks; - /** - * AgentServiceChecksInfo constructor. - * @param array|null $data - */ public function __construct(?array $data = null) { parent::__construct($data); @@ -63,62 +53,38 @@ public function __construct(?array $data = null) } } - /** - * @return string - */ public function getAggregatedStatus(): string { return $this->AggregatedStatus; } - /** - * @param string $AggregatedStatus - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceChecksInfo - */ public function setAggregatedStatus(string $AggregatedStatus): self { $this->AggregatedStatus = $AggregatedStatus; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentService|null - */ public function getService(): ?AgentService { return $this->Service; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentService|null $Service - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceChecksInfo - */ public function setService(?AgentService $Service): self { $this->Service = $Service; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Health\HealthChecks - */ public function getChecks(): HealthChecks { return $this->Checks; } - /** - * @param \DCarbone\PHPConsulAPI\Health\HealthChecks $Checks - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceChecksInfo - */ public function setChecks(HealthChecks $Checks): self { $this->Checks = $Checks; return $this; } - /** - * @return string - */ public function __toString(): string { return $this->AggregatedStatus; diff --git a/src/Agent/AgentServiceConnect.php b/src/Agent/AgentServiceConnect.php index bc1febe3..3f629e57 100644 --- a/src/Agent/AgentServiceConnect.php +++ b/src/Agent/AgentServiceConnect.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AgentServiceConnect - */ class AgentServiceConnect extends AbstractModel { protected const FIELDS = [ @@ -40,41 +37,25 @@ class AgentServiceConnect extends AbstractModel private const FIELD_NATIVE = 'Native'; private const FIELD_SIDECAR_SERVICE = 'SidecarService'; - /** @var bool */ public bool $Native = false; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration[] */ public array $SidecarService = []; - /** - * @return bool - */ public function isNative(): bool { return $this->Native; } - /** - * @param bool $Native - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnect - */ public function setNative(bool $Native): self { $this->Native = $Native; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration[] - */ public function getSidecarService(): array { return $this->SidecarService; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration[] $SidecarService - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnect - */ public function setSidecarService(array $SidecarService): self { $this->SidecarService = $SidecarService; diff --git a/src/Agent/AgentServiceConnectProxyConfig.php b/src/Agent/AgentServiceConnectProxyConfig.php index e63092b4..0fc59582 100644 --- a/src/Agent/AgentServiceConnectProxyConfig.php +++ b/src/Agent/AgentServiceConnectProxyConfig.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,9 +26,6 @@ use DCarbone\PHPConsulAPI\FakeMap; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AgentServiceConnectProxyConfig - */ class AgentServiceConnectProxyConfig extends AbstractModel { protected const FIELDS = [ @@ -70,35 +67,19 @@ class AgentServiceConnectProxyConfig extends AbstractModel private const FIELD_MESH_GATEWAY = 'MeshGateway'; private const FIELD_EXPOSE = 'Expose'; - /** @var \DCarbone\PHPConsulAPI\Agent\EnvoyExtension[] */ public array $EnvoyExtensions = []; - /** @var string */ public string $DestinationServiceName = ''; - /** @var string */ public string $DestinationServiceID = ''; - /** @var string */ public string $LocalServiceAddress = ''; - /** @var int */ public int $LocalServicePort = 0; - /** @var \DCarbone\PHPConsulAPI\FakeMap|null */ public ?FakeMap $Config = null; - /** @var string */ public string $LocalServiceSocketPath = ''; - /** @var string */ public string $Mode = ''; - /** @var \DCarbone\PHPConsulAPI\Agent\TransparentProxyConfig|null */ public ?TransparentProxyConfig $TransparentProxy = null; - /** @var \DCarbone\PHPConsulAPI\Agent\Upstream[] */ public array $Upstreams = []; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig */ public MeshGatewayConfig $MeshGateway; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\ExposeConfig */ public ExposeConfig $Expose; - /** - * AgentServiceConnectProxyConfig constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -110,226 +91,138 @@ public function __construct(?array $data = []) } } - /** - * @return array - */ public function getEnvoyExtensions(): array { return $this->EnvoyExtensions; } - /** - * @param EnvoyExtension $envoyExtension - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig - */ public function addEnvoyExtension(EnvoyExtension $envoyExtension): self { $this->EnvoyExtensions[] = $envoyExtension; return $this; } - /** - * @param array $EnvoyExtensions - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig - */ public function setEnvoyExtensions(array $EnvoyExtensions): self { $this->EnvoyExtensions = $EnvoyExtensions; return $this; } - /** - * @return string - */ public function getDestinationServiceName(): string { return $this->DestinationServiceName; } - /** - * @param string $DestinationServiceName - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig - */ public function setDestinationServiceName(string $DestinationServiceName): self { $this->DestinationServiceName = $DestinationServiceName; return $this; } - /** - * @return string - */ public function getDestinationServiceID(): string { return $this->DestinationServiceID; } - /** - * @param string $DestinationServiceID - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig - */ public function setDestinationServiceID(string $DestinationServiceID): self { $this->DestinationServiceID = $DestinationServiceID; return $this; } - /** - * @return string - */ public function getLocalServiceAddress(): string { return $this->LocalServiceAddress; } - /** - * @param string $LocalServiceAddress - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig - */ public function setLocalServiceAddress(string $LocalServiceAddress): self { $this->LocalServiceAddress = $LocalServiceAddress; return $this; } - /** - * @return int - */ public function getLocalServicePort(): int { return $this->LocalServicePort; } - /** - * @param int $LocalServicePort - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig - */ public function setLocalServicePort(int $LocalServicePort): self { $this->LocalServicePort = $LocalServicePort; return $this; } - /** - * @return string - */ public function getLocalServiceSocketPath(): string { return $this->LocalServiceSocketPath; } - /** - * @param string $LocalServiceSocketPath - * @return AgentServiceConnectProxyConfig - */ public function setLocalServiceSocketPath(string $LocalServiceSocketPath): self { $this->LocalServiceSocketPath = $LocalServiceSocketPath; return $this; } - /** - * @return string - */ public function getMode(): string { return $this->Mode; } - /** - * @param string $Mode - * @return AgentServiceConnectProxyConfig - */ public function setMode(string $Mode): self { $this->Mode = $Mode; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\TransparentProxyConfig|null - */ public function getTransparentProxy(): ?TransparentProxyConfig { return $this->TransparentProxy; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\TransparentProxyConfig|null $TransparentProxy - * @return AgentServiceConnectProxyConfig - */ public function setTransparentProxy(?TransparentProxyConfig $TransparentProxy): self { $this->TransparentProxy = $TransparentProxy; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\FakeMap|null - */ public function getConfig(): ?FakeMap { return $this->Config; } - /** - * @param array|\DCarbone\PHPConsulAPI\FakeMap|\stdClass|null $Config - * @return AgentServiceConnectProxyConfig - */ public function setConfig(array|FakeMap|\stdClass|null $Config): self { $this->Config = FakeMap::parse($Config); return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\Upstream[] - */ public function getUpstreams(): array { return $this->Upstreams; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\Upstream[] $Upstreams - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig - */ public function setUpstreams(array $Upstreams): self { $this->Upstreams = $Upstreams; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig - */ public function getMeshGateway(): MeshGatewayConfig { return $this->MeshGateway; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig $MeshGateway - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig - */ public function setMeshGateway(MeshGatewayConfig $MeshGateway): self { $this->MeshGateway = $MeshGateway; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ExposeConfig - */ public function getExpose(): ExposeConfig { return $this->Expose; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\ExposeConfig $Expose - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig - */ public function setExpose(ExposeConfig $Expose): self { $this->Expose = $Expose; diff --git a/src/Agent/AgentServiceRegistration.php b/src/Agent/AgentServiceRegistration.php index e86f6047..f565821b 100644 --- a/src/Agent/AgentServiceRegistration.php +++ b/src/Agent/AgentServiceRegistration.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,9 +26,6 @@ use DCarbone\PHPConsulAPI\HasStringTags; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AgentServiceRegistration - */ class AgentServiceRegistration extends AbstractModel { use HasSettableStringTags; @@ -98,39 +95,21 @@ class AgentServiceRegistration extends AbstractModel private const FIELD_CONNECT = 'Connect'; private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $Kind = ''; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** @var int */ public int $Port = 0; - /** @var string */ public string $Address = ''; - /** @var \DCarbone\PHPConsulAPI\Catalog\ServiceAddress[] */ public array $TaggedAddresses = []; - /** @var bool */ public bool $EnableTagOverride = false; - /** @var array */ public array $Meta = []; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentWeights|null */ public ?AgentWeights $Weights = null; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck|null */ public ?AgentServiceCheck $Check = null; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentServiceChecks */ public AgentServiceChecks $Checks; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig|null */ public ?AgentServiceConnectProxyConfig $Proxy = null; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentServiceConnect|null */ public ?AgentServiceConnect $Connect = null; - /** @var string */ public string $Namespace = ''; - /** - * AgentServiceRegistration constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -139,260 +118,159 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getKind(): string { return $this->Kind; } - /** - * @param string $Kind - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setKind(string $Kind): self { $this->Kind = $Kind; return $this; } - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return int - */ public function getPort(): int { return $this->Port; } - /** - * @param int $Port - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setPort(int $Port): self { $this->Port = $Port; return $this; } - /** - * @return string - */ public function getAddress(): string { return $this->Address; } - /** - * @param string $Address - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setAddress(string $Address): self { $this->Address = $Address; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Catalog\ServiceAddress[]|null - */ public function getTaggedAddresses(): ?array { return $this->TaggedAddresses; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\ServiceAddress[] $TaggedAddresses - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setTaggedAddresses(array $TaggedAddresses): self { $this->TaggedAddresses = $TaggedAddresses; return $this; } - /** - * @return bool - */ public function isEnableTagOverride(): bool { return $this->EnableTagOverride; } - /** - * @param bool $EnableTagOverride - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setEnableTagOverride(bool $EnableTagOverride): self { $this->EnableTagOverride = $EnableTagOverride; return $this; } - /** - * @return array|null - */ public function getMeta(): ?array { return $this->Meta; } - /** - * @param array $Meta - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setMeta(array $Meta): self { $this->Meta = $Meta; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentWeights|null - */ public function getWeights(): ?AgentWeights { return $this->Weights; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentWeights|null $Weights - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setWeights(?AgentWeights $Weights): self { $this->Weights = $Weights; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck|null - */ public function getCheck(): ?AgentServiceCheck { return $this->Check; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentServiceCheck|null $Check - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setCheck(?AgentServiceCheck $Check): self { $this->Check = $Check; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceChecks - */ public function getChecks(): AgentServiceChecks { return $this->Checks; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentServiceChecks $Checks - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setChecks(AgentServiceChecks $Checks): self { $this->Checks = $Checks; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig|null - */ public function getProxy(): ?AgentServiceConnectProxyConfig { return $this->Proxy; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig|null $Proxy - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setProxy(?AgentServiceConnectProxyConfig $Proxy): self { $this->Proxy = $Proxy; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnect|null - */ public function getConnect(): ?AgentServiceConnect { return $this->Connect; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentServiceConnect|null $Connect - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setConnect(?AgentServiceConnect $Connect): self { $this->Connect = $Connect; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceRegistration - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return string - */ public function __toString(): string { return $this->Name; diff --git a/src/Agent/AgentServiceResponse.php b/src/Agent/AgentServiceResponse.php index a6af0d80..35e871ad 100644 --- a/src/Agent/AgentServiceResponse.php +++ b/src/Agent/AgentServiceResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class AgentServicesResponse - */ class AgentServiceResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Agent\AgentService|null */ public ?AgentService $Service = null; - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentService|null - */ public function getValue(): ?AgentService { return $this->Service; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->Service = new AgentService((array)$decodedData); diff --git a/src/Agent/AgentServicesResponse.php b/src/Agent/AgentServicesResponse.php index d77ec5e9..2d559cbb 100644 --- a/src/Agent/AgentServicesResponse.php +++ b/src/Agent/AgentServicesResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class AgentServicesResponse - */ class AgentServicesResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Agent\AgentService[]|null */ public ?array $Services = null; - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentService[]|null - */ public function getValue(): ?array { return $this->Services; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->Services = []; diff --git a/src/Agent/AgentToken.php b/src/Agent/AgentToken.php index a05e8ee8..4f95dba6 100644 --- a/src/Agent/AgentToken.php +++ b/src/Agent/AgentToken.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,26 +22,15 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class AgentToken - */ class AgentToken extends AbstractModel { - /** @var string */ public string $Token = ''; - /** - * @return string - */ public function getToken(): string { return $this->Token; } - /** - * @param string $Token - * @return \DCarbone\PHPConsulAPI\Agent\AgentToken - */ public function setToken(string $Token): self { $this->Token = $Token; diff --git a/src/Agent/AgentWeights.php b/src/Agent/AgentWeights.php index 55e66fd4..19dcb0b4 100644 --- a/src/Agent/AgentWeights.php +++ b/src/Agent/AgentWeights.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,27 +22,16 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class AgentWeights - */ class AgentWeights extends AbstractModel { - /** @var int */ public int $Passing = 0; - /** @var int */ public int $Warning = 0; - /** - * @return int - */ public function getPassing(): int { return $this->Passing; } - /** - * @return int - */ public function getWarning(): int { return $this->Warning; diff --git a/src/Agent/EnvoyExtension.php b/src/Agent/EnvoyExtension.php index fe534a34..e433e843 100644 --- a/src/Agent/EnvoyExtension.php +++ b/src/Agent/EnvoyExtension.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2023 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -32,15 +32,10 @@ class EnvoyExtension extends AbstractModel private const FIELD_ARGUMENTS = 'Arguments'; - /** @var string */ public string $Name = ''; - /** @var bool */ public bool $Required = false; - /** @var \DCarbone\PHPConsulAPI\FakeMap */ public FakeMap $Arguments; - /** @var string */ public string $ConsulVersion = ''; - /** @var string */ public string $EnvoyVersion = ''; public function __construct(?array $data = []) @@ -51,90 +46,55 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return EnvoyExtension - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return bool - */ public function isRequired(): bool { return $this->Required; } - /** - * @param bool $Required - * @return EnvoyExtension - */ public function setRequired(bool $Required): self { $this->Required = $Required; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\FakeMap|null - */ public function getArguments(): ?FakeMap { return $this->Arguments; } - /** - * @param array|\DCarbone\PHPConsulAPI\FakeMap|\stdClass|null $Arguments - * @return EnvoyExtension - */ public function setArguments(array|FakeMap|\stdClass|null $Arguments): self { $this->Arguments = FakeMap::parse($Arguments); return $this; } - /** - * @return string - */ public function getConsulVersion(): string { return $this->ConsulVersion; } - /** - * @param string $ConsulVersion - * @return EnvoyExtension - */ public function setConsulVersion(string $ConsulVersion): self { $this->ConsulVersion = $ConsulVersion; return $this; } - /** - * @return string - */ public function getEnvoyVersion(): string { return $this->EnvoyVersion; } - /** - * @param string $EnvoyVersion - * @return EnvoyExtension - */ public function setEnvoyVersion(string $EnvoyVersion): self { $this->EnvoyVersion = $EnvoyVersion; diff --git a/src/Agent/GaugeValue.php b/src/Agent/GaugeValue.php index 028bb8fe..e1ec1a6b 100644 --- a/src/Agent/GaugeValue.php +++ b/src/Agent/GaugeValue.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,66 +22,39 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class GaugeValue - */ class GaugeValue extends AbstractModel { - /** @var string */ public string $Name = ''; - /** @var float */ public float $Value = 0.0; - /** @var array */ public array $Labels = []; - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $name - * @return \DCarbone\PHPConsulAPI\Agent\GaugeValue - */ public function setName(string $name): self { $this->Name = $name; return $this; } - /** - * @return float - */ public function getValue(): float { return $this->Value; } - /** - * @param float $value - * @return \DCarbone\PHPConsulAPI\Agent\GaugeValue - */ public function setValue(float $value): self { $this->Value = $value; return $this; } - /** - * @return array - */ public function getLabels(): array { return $this->Labels; } - /** - * @param array $labels - * @return \DCarbone\PHPConsulAPI\Agent\GaugeValue - */ public function setLabels(array $labels): self { $this->Labels = $labels; diff --git a/src/Agent/MemberOpts.php b/src/Agent/MemberOpts.php index 8328298d..b9b1e33a 100644 --- a/src/Agent/MemberOpts.php +++ b/src/Agent/MemberOpts.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,46 +22,27 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class MemberOpts - */ class MemberOpts extends AbstractModel { - /** @var bool */ public bool $WAN = false; - /** @var string */ public string $Segment = ''; - /** - * @return bool - */ public function isWAN(): bool { return $this->WAN; } - /** - * @param bool $wan - * @return \DCarbone\PHPConsulAPI\Agent\MemberOpts - */ public function setWAN(bool $wan): self { $this->WAN = $wan; return $this; } - /** - * @return string - */ public function getSegment(): string { return $this->Segment; } - /** - * @param string $segment - * @return \DCarbone\PHPConsulAPI\Agent\MemberOpts - */ public function setSegment(string $segment): self { $this->Segment = $segment; diff --git a/src/Agent/MetricsInfo.php b/src/Agent/MetricsInfo.php index 94b1ae29..d580ab99 100644 --- a/src/Agent/MetricsInfo.php +++ b/src/Agent/MetricsInfo.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class MetricsInfo - */ class MetricsInfo extends AbstractModel { protected const FIELDS = [ @@ -56,101 +53,61 @@ class MetricsInfo extends AbstractModel private const FIELD_COUNTERS = 'Counters'; private const FIELD_SAMPLES = 'Samples'; - /** @var string */ public string $Timestamp = ''; - /** @var \DCarbone\PHPConsulAPI\Agent\GaugeValue[] */ public array $Gauges = []; - /** @var \DCarbone\PHPConsulAPI\Agent\PointValue[] */ public array $Points = []; - /** @var \DCarbone\PHPConsulAPI\Agent\SampledValue[] */ public array $Counters = []; - /** @var \DCarbone\PHPConsulAPI\Agent\SampledValue[] */ public array $Samples = []; - /** - * @return string - */ public function getTimestamp(): string { return $this->Timestamp; } - /** - * @param string $timestamp - * @return \DCarbone\PHPConsulAPI\Agent\MetricsInfo - */ public function setTimestamp(string $timestamp): self { $this->Timestamp = $timestamp; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\GaugeValue[] - */ public function getGauges(): array { return $this->Gauges; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\GaugeValue[] $gauges - * @return \DCarbone\PHPConsulAPI\Agent\MetricsInfo - */ public function setGauges(array $gauges): self { $this->Gauges = $gauges; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\PointValue[] - */ public function getPoints(): array { return $this->Points; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\PointValue[] $points - * @return \DCarbone\PHPConsulAPI\Agent\MetricsInfo - */ public function setPoints(array $points): self { $this->Points = $points; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\SampledValue[] - */ public function getCounters(): array { return $this->Counters; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\SampledValue[] $counters - * @return \DCarbone\PHPConsulAPI\Agent\MetricsInfo - */ public function setCounters(array $counters): self { $this->Counters = $counters; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\SampledValue[] - */ public function getSamples(): array { return $this->Samples; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\SampledValue[] $samples - * @return \DCarbone\PHPConsulAPI\Agent\MetricsInfo - */ public function setSamples(array $samples): self { $this->Samples = $samples; diff --git a/src/Agent/MetricsInfoResponse.php b/src/Agent/MetricsInfoResponse.php index e2a533c2..da7e1ed9 100644 --- a/src/Agent/MetricsInfoResponse.php +++ b/src/Agent/MetricsInfoResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class MetricsInfoResponse - */ class MetricsInfoResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Agent\MetricsInfo|null */ public ?MetricsInfo $MetricsInfo = null; - /** - * @return \DCarbone\PHPConsulAPI\Agent\MetricsInfo|null - */ public function getValue(): ?MetricsInfo { return $this->MetricsInfo; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->MetricsInfo = new MetricsInfo((array)$decodedData); diff --git a/src/Agent/PointValue.php b/src/Agent/PointValue.php index 74115d8d..00cd83fa 100644 --- a/src/Agent/PointValue.php +++ b/src/Agent/PointValue.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,46 +22,27 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class PointValue - */ class PointValue extends AbstractModel { - /** @var string */ public string $Name = ''; - /** @var array */ public array $Points = []; - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $name - * @return \DCarbone\PHPConsulAPI\Agent\PointValue - */ public function setName(string $name): self { $this->Name = $name; return $this; } - /** - * @return array - */ public function getPoints(): array { return $this->Points; } - /** - * @param array $points - * @return \DCarbone\PHPConsulAPI\Agent\PointValue - */ public function setPoints(array $points): self { $this->Points = $points; diff --git a/src/Agent/SampledValue.php b/src/Agent/SampledValue.php index 55d04d21..9c177c95 100644 --- a/src/Agent/SampledValue.php +++ b/src/Agent/SampledValue.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,166 +22,99 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class SampledValue - */ class SampledValue extends AbstractModel { - /** @var string */ public string $Name = ''; - /** @var int */ public int $Count = 0; - /** @var float */ public float $Sum = 0.0; - /** @var float */ public float $Min = 0.0; - /** @var float */ public float $Max = 0.0; - /** @var float */ public float $Mean = 0.0; - /** @var float */ public float $Stddev = 0.0; - /** @var array */ public array $Labels = []; - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $name - * @return \DCarbone\PHPConsulAPI\Agent\SampledValue - */ public function setName(string $name): self { $this->Name = $name; return $this; } - /** - * @return int - */ public function getCount(): int { return $this->Count; } - /** - * @param int $count - * @return \DCarbone\PHPConsulAPI\Agent\SampledValue - */ public function setCount(int $count): self { $this->Count = $count; return $this; } - /** - * @return float - */ public function getSum(): float { return $this->Sum; } - /** - * @param float $sum - * @return \DCarbone\PHPConsulAPI\Agent\SampledValue - */ public function setSum(float $sum): self { $this->Sum = $sum; return $this; } - /** - * @return float - */ public function getMin(): float { return $this->Min; } - /** - * @param float $min - * @return \DCarbone\PHPConsulAPI\Agent\SampledValue - */ public function setMin(float $min): self { $this->Min = $min; return $this; } - /** - * @return float - */ public function getMax(): float { return $this->Max; } - /** - * @param float $max - * @return \DCarbone\PHPConsulAPI\Agent\SampledValue - */ public function setMax(float $max): self { $this->Max = $max; return $this; } - /** - * @return float - */ public function getMean(): float { return $this->Mean; } - /** - * @param float $mean - * @return \DCarbone\PHPConsulAPI\Agent\SampledValue - */ public function setMean(float $mean): self { $this->Mean = $mean; return $this; } - /** - * @return float - */ public function getStddev(): float { return $this->Stddev; } - /** - * @param float $Stddev - * @return \DCarbone\PHPConsulAPI\Agent\SampledValue - */ public function setStddev(float $Stddev): self { $this->Stddev = $Stddev; return $this; } - /** - * @return array - */ public function getLabels(): array { return $this->Labels; } - /** - * @param array $labels - * @return \DCarbone\PHPConsulAPI\Agent\SampledValue - */ public function setLabels(array $labels): self { $this->Labels = $labels; diff --git a/src/Agent/ServiceRegisterOpts.php b/src/Agent/ServiceRegisterOpts.php index 709ce357..f6fe773c 100644 --- a/src/Agent/ServiceRegisterOpts.php +++ b/src/Agent/ServiceRegisterOpts.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,26 +22,15 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class ServiceRegisterOpts - */ class ServiceRegisterOpts extends AbstractModel { - /** @var bool */ public bool $ReplaceExistingChecks = false; - /** - * @return bool - */ public function isReplaceExistingChecks(): bool { return $this->ReplaceExistingChecks; } - /** - * @param bool $replaceExistingChecks - * @return \DCarbone\PHPConsulAPI\Agent\ServiceRegisterOpts - */ public function setReplaceExistingChecks(bool $replaceExistingChecks): self { $this->ReplaceExistingChecks = $replaceExistingChecks; diff --git a/src/Agent/TransparentProxyConfig.php b/src/Agent/TransparentProxyConfig.php index 924f4d5d..eab35eb2 100644 --- a/src/Agent/TransparentProxyConfig.php +++ b/src/Agent/TransparentProxyConfig.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2023 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,23 +24,14 @@ class TransparentProxyConfig extends AbstractModel { - /** @var int */ public int $OutboundListenerPort = 0; - /** @var bool */ public bool $DialedDirectly = false; - /** - * @return int - */ public function getOutboundListenerPort(): int { return $this->OutboundListenerPort; } - /** - * @param int $OutboundListenerPort - * @return TransparentProxyConfig - */ public function setOutboundListenerPort(int $OutboundListenerPort): TransparentProxyConfig { $this->OutboundListenerPort = $OutboundListenerPort; diff --git a/src/Agent/Upstream.php b/src/Agent/Upstream.php index dfa156c2..96672596 100644 --- a/src/Agent/Upstream.php +++ b/src/Agent/Upstream.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Agent; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class Upstream - */ class Upstream extends AbstractModel { protected const FIELDS = [ @@ -55,27 +52,15 @@ class Upstream extends AbstractModel private const FIELD_CONFIG = 'Config'; private const FIELD_MESH_GATEWAY = 'MeshGateway'; - /** @var string */ public string $DestinationType = ''; - /** @var string */ public string $DestinationNamespace = ''; - /** @var string */ public string $DestinationName = ''; - /** @var string */ public string $Datacenter = ''; - /** @var string */ public string $LocalBindAddress = ''; - /** @var int */ public int $LocalBindPort = 0; - /** @var array */ public array $Config = []; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig */ public MeshGatewayConfig $MeshGatewayConfig; - /** - * Upstream constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -84,144 +69,88 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getDestinationType(): string { return $this->DestinationType; } - /** - * @param string $DestinationType - * @return \DCarbone\PHPConsulAPI\Agent\Upstream - */ public function setDestinationType(string $DestinationType): self { $this->DestinationType = $DestinationType; return $this; } - /** - * @return string - */ public function getDestinationNamespace(): string { return $this->DestinationNamespace; } - /** - * @param string $DestinationNamespace - * @return \DCarbone\PHPConsulAPI\Agent\Upstream - */ public function setDestinationNamespace(string $DestinationNamespace): self { $this->DestinationNamespace = $DestinationNamespace; return $this; } - /** - * @return string - */ public function getDestinationName(): string { return $this->DestinationName; } - /** - * @param string $DestinationName - * @return \DCarbone\PHPConsulAPI\Agent\Upstream - */ public function setDestinationName(string $DestinationName): self { $this->DestinationName = $DestinationName; return $this; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @param string $Datacenter - * @return \DCarbone\PHPConsulAPI\Agent\Upstream - */ public function setDatacenter(string $Datacenter): self { $this->Datacenter = $Datacenter; return $this; } - /** - * @return string - */ public function getLocalBindAddress(): string { return $this->LocalBindAddress; } - /** - * @param string $LocalBindAddress - * @return \DCarbone\PHPConsulAPI\Agent\Upstream - */ public function setLocalBindAddress(string $LocalBindAddress): self { $this->LocalBindAddress = $LocalBindAddress; return $this; } - /** - * @return int - */ public function getLocalBindPort(): int { return $this->LocalBindPort; } - /** - * @param int $LocalBindPort - * @return \DCarbone\PHPConsulAPI\Agent\Upstream - */ public function setLocalBindPort(int $LocalBindPort): self { $this->LocalBindPort = $LocalBindPort; return $this; } - /** - * @return array - */ public function getConfig(): array { return $this->Config; } - /** - * @param array $Config - * @return \DCarbone\PHPConsulAPI\Agent\Upstream - */ public function setConfig(array $Config): self { $this->Config = $Config; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig - */ public function getMeshGatewayConfig(): MeshGatewayConfig { return $this->MeshGatewayConfig; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig $MeshGatewayConfig - * @return \DCarbone\PHPConsulAPI\Agent\Upstream - */ public function setMeshGatewayConfig(MeshGatewayConfig $MeshGatewayConfig): self { $this->MeshGatewayConfig = $MeshGatewayConfig; diff --git a/src/Catalog/CatalogClient.php b/src/Catalog/CatalogClient.php index 011010bd..c778c499 100644 --- a/src/Catalog/CatalogClient.php +++ b/src/Catalog/CatalogClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ limitations under the License. */ -use DCarbone\Go\HTTP; use DCarbone\PHPConsulAPI\AbstractClient; use DCarbone\PHPConsulAPI\QueryOptions; use DCarbone\PHPConsulAPI\ValuedQueryStringsResponse; @@ -28,38 +27,18 @@ use DCarbone\PHPConsulAPI\WriteOptions; use DCarbone\PHPConsulAPI\WriteResponse; -/** - * Class CatalogClient - */ class CatalogClient extends AbstractClient { - /** - * @param \DCarbone\PHPConsulAPI\Catalog\CatalogRegistration $catalogRegistration - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Register(CatalogRegistration $catalogRegistration, ?WriteOptions $opts = null): WriteResponse { return $this->_executePut('v1/catalog/register', $catalogRegistration, $opts); } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\CatalogDeregistration $catalogDeregistration - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Deregister(CatalogDeregistration $catalogDeregistration, ?WriteOptions $opts = null): WriteResponse { return $this->_executePut('v1/catalog/deregister', $catalogDeregistration, $opts); } - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedStringsResponse - */ public function Datacenters(): ValuedStringsResponse { $resp = $this->_requireOK($this->_doGet('v1/catalog/datacenters', null)); @@ -68,12 +47,6 @@ public function Datacenters(): ValuedStringsResponse return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Catalog\NodesResponse - */ public function Nodes(?QueryOptions $opts = null): NodesResponse { $resp = $this->_requireOK($this->_doGet('v1/catalog/nodes', $opts)); @@ -82,12 +55,6 @@ public function Nodes(?QueryOptions $opts = null): NodesResponse return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedQueryStringsResponse - */ public function Services(?QueryOptions $opts = null): ValuedQueryStringsResponse { $resp = $this->_requireOK($this->_doGet('v1/catalog/services', $opts)); @@ -96,13 +63,6 @@ public function Services(?QueryOptions $opts = null): ValuedQueryStringsResponse return $ret; } - /** - * @param string $node - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogNodeServicesListResponse - */ public function NodeServicesList(string $node, ?QueryOptions $opts = null): CatalogNodeServicesListResponse { $resp = $this->_requireOK($this->_doGet(sprintf('v1/catalog/node-services/%s', urlencode($node)), $opts)); @@ -111,14 +71,6 @@ public function NodeServicesList(string $node, ?QueryOptions $opts = null): Cata return $ret; } - /** - * @param string $service - * @param array $tags - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogServicesResponse - */ public function ServiceMultipleTags( string $service, array $tags, @@ -134,25 +86,11 @@ public function ServiceMultipleTags( return $ret; } - /** - * @param string $service - * @param string $tag - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogServicesResponse - */ public function Service(string $service, string $tag = '', ?QueryOptions $opts = null): CatalogServicesResponse { return $this->ServiceMultipleTags($service, '' !== $tag ? [$tag] : [], $opts); } - /** - * @param string $node - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogNodeResponse - */ public function Node(string $node, ?QueryOptions $opts = null): CatalogNodeResponse { $resp = $this->_requireOK($this->_doGet(sprintf('v1/catalog/node/%s', $node), $opts)); @@ -161,13 +99,6 @@ public function Node(string $node, ?QueryOptions $opts = null): CatalogNodeRespo return $ret; } - /** - * @param string $gateway - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayServicesResponse - */ public function GatewayServices(string $gateway, ?QueryOptions $opts = null): GatewayServicesResponse { $resp = $this->_requireOK($this->_doGet(sprintf('v1/catalog/gateway-services/%s', urlencode($gateway)), $opts)); diff --git a/src/Catalog/CatalogDeregistration.php b/src/Catalog/CatalogDeregistration.php index fb74d17f..139008fc 100644 --- a/src/Catalog/CatalogDeregistration.php +++ b/src/Catalog/CatalogDeregistration.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class CatalogDeregistration - */ class CatalogDeregistration extends AbstractModel { protected const FIELDS = [ @@ -36,101 +33,61 @@ class CatalogDeregistration extends AbstractModel private const FIELD_ADDRESS = 'Address'; private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $Node = ''; - /** @var string */ public string $Address = ''; - /** @var string */ public string $Datacenter = ''; - /** @var string */ public string $ServiceID = ''; - /** @var string */ public string $CheckID = ''; - /** - * @return string - */ public function getNode(): string { return $this->Node; } - /** - * @param string $node - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogDeregistration - */ public function setNode(string $node): self { $this->Node = $node; return $this; } - /** - * @return string - */ public function getAddress(): string { return $this->Address; } - /** - * @param string $address - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogDeregistration - */ public function setAddress(string $address): self { $this->Address = $address; return $this; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @param string $datacenter - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogDeregistration - */ public function setDatacenter(string $datacenter): self { $this->Datacenter = $datacenter; return $this; } - /** - * @return string - */ public function getServiceID(): string { return $this->ServiceID; } - /** - * @param string $serviceID - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogDeregistration - */ public function setServiceID(string $serviceID): self { $this->ServiceID = $serviceID; return $this; } - /** - * @return string - */ public function getCheckID(): string { return $this->CheckID; } - /** - * @param string $checkID - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogDeregistration - */ public function setCheckID(string $checkID): self { $this->CheckID = $checkID; diff --git a/src/Catalog/CatalogNode.php b/src/Catalog/CatalogNode.php index 3b191639..1f947d62 100644 --- a/src/Catalog/CatalogNode.php +++ b/src/Catalog/CatalogNode.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\Agent\AgentService; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class CatalogNode - */ class CatalogNode extends AbstractModel { protected const FIELDS = [ @@ -44,41 +41,25 @@ class CatalogNode extends AbstractModel private const FIELD_NODE = 'Node'; private const FIELD_SERVICES = 'Services'; - /** @var \DCarbone\PHPConsulAPI\Catalog\Node|null */ public ?Node $Node = null; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentService[] */ public array $Services = []; - /** - * @return \DCarbone\PHPConsulAPI\Catalog\Node|null - */ public function getNode(): ?Node { return $this->Node; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\Node|null $Node - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogNode - */ public function setNode(?Node $Node): self { $this->Node = $Node; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentService[] - */ public function getServices(): array { return $this->Services; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentService[] $Services - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogNode - */ public function setServices(array $Services): self { $this->Services = $Services; diff --git a/src/Catalog/CatalogNodeResponse.php b/src/Catalog/CatalogNodeResponse.php index 0e700a90..b3095658 100644 --- a/src/Catalog/CatalogNodeResponse.php +++ b/src/Catalog/CatalogNodeResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class CatalogNodeResponse - */ class CatalogNodeResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Catalog\CatalogNode|null */ public ?CatalogNode $Node = null; - /** - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogNode|null - */ public function getValue(): ?CatalogNode { return $this->Node; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->Node = new CatalogNode((array)$decodedData); diff --git a/src/Catalog/CatalogNodeServiceList.php b/src/Catalog/CatalogNodeServiceList.php index 5dc59350..abae0f3a 100644 --- a/src/Catalog/CatalogNodeServiceList.php +++ b/src/Catalog/CatalogNodeServiceList.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\Agent\AgentService; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class CatalogNodeServiceList - */ class CatalogNodeServiceList extends AbstractModel { protected const FIELDS = [ @@ -44,41 +41,25 @@ class CatalogNodeServiceList extends AbstractModel private const FIELD_NODE = 'Node'; private const FIELD_SERVICES = 'Services'; - /** @var \DCarbone\PHPConsulAPI\Catalog\Node|null */ public ?Node $Node = null; - /** @var \DCarbone\PHPConsulAPI\Catalog\CatalogService[] */ public array $Services = []; - /** - * @return \DCarbone\PHPConsulAPI\Catalog\Node|null - */ public function getNode(): ?Node { return $this->Node; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\Node|null $Node - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogNodeServiceList - */ public function setNode(?Node $Node): self { $this->Node = $Node; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService[] - */ public function getServices(): array { return $this->Services; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\CatalogService[] $Services - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogNodeServiceList - */ public function setServices(array $Services): self { $this->Services = $Services; diff --git a/src/Catalog/CatalogNodeServicesListResponse.php b/src/Catalog/CatalogNodeServicesListResponse.php index b01832d3..d7f712fd 100644 --- a/src/Catalog/CatalogNodeServicesListResponse.php +++ b/src/Catalog/CatalogNodeServicesListResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class CatalogNodeServicesListResponse - */ class CatalogNodeServicesListResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Catalog\CatalogNodeServiceList|null */ public ?CatalogNodeServiceList $CatalogNodeServiceList = null; - /** - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogNodeServiceList|null - */ public function getValue(): ?CatalogNodeServiceList { return $this->CatalogNodeServiceList; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->CatalogNodeServiceList = new CatalogNodeServiceList((array)$decodedData); diff --git a/src/Catalog/CatalogRegistration.php b/src/Catalog/CatalogRegistration.php index 05197dc5..5175edc2 100644 --- a/src/Catalog/CatalogRegistration.php +++ b/src/Catalog/CatalogRegistration.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -27,9 +27,6 @@ use DCarbone\PHPConsulAPI\Health\HealthChecks; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class CatalogRegistration - */ class CatalogRegistration extends AbstractModel { protected const FIELDS = [ @@ -55,31 +52,17 @@ class CatalogRegistration extends AbstractModel private const FIELD_CHECK = 'Check'; private const FIELD_CHECKS = 'Checks'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Node = ''; - /** @var string */ public string $Address = ''; - /** @var \DCarbone\PHPConsulAPI\FakeMap */ public FakeMap $TaggedAddresses; - /** @var \DCarbone\PHPConsulAPI\FakeMap */ public FakeMap $NodeMeta; - /** @var string */ public string $Datacenter = ''; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentService|null */ public ?AgentService $Service = null; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentCheck|null */ public ?AgentCheck $Check = null; - /** @var \DCarbone\PHPConsulAPI\Health\HealthChecks */ public HealthChecks $Checks; - /** @var bool */ public bool $SkipNodeUpdate = false; - /** - * CatalogRegistration constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -94,180 +77,110 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogRegistration - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getNode(): string { return $this->Node; } - /** - * @param string $Node - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogRegistration - */ public function setNode(string $Node): self { $this->Node = $Node; return $this; } - /** - * @return string - */ public function getAddress(): string { return $this->Address; } - /** - * @param string $Address - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogRegistration - */ public function setAddress(string $Address): self { $this->Address = $Address; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\FakeMap - */ public function getTaggedAddresses(): FakeMap { return $this->TaggedAddresses; } - /** - * @param \DCarbone\PHPConsulAPI\FakeMap $TaggedAddresses - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogRegistration - */ public function setTaggedAddresses(FakeMap $TaggedAddresses): self { $this->TaggedAddresses = $TaggedAddresses; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\FakeMap - */ public function getNodeMeta(): FakeMap { return $this->NodeMeta; } - /** - * @param \DCarbone\PHPConsulAPI\FakeMap $NodeMeta - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogRegistration - */ public function setNodeMeta(FakeMap $NodeMeta): self { $this->NodeMeta = $NodeMeta; return $this; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @param string $Datacenter - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogRegistration - */ public function setDatacenter(string $Datacenter): self { $this->Datacenter = $Datacenter; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentService|null - */ public function getService(): ?AgentService { return $this->Service; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentService|null $Service - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogRegistration - */ public function setService(?AgentService $Service): self { $this->Service = $Service; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentCheck|null - */ public function getCheck(): ?AgentCheck { return $this->Check; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentCheck|null $Check - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogRegistration - */ public function setCheck(?AgentCheck $Check): self { $this->Check = $Check; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Health\HealthChecks - */ public function getChecks(): HealthChecks { return $this->Checks; } - /** - * @param \DCarbone\PHPConsulAPI\Health\HealthChecks $checks - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogRegistration - */ public function setChecks(HealthChecks $checks): self { $this->Checks = $checks; return $this; } - /** - * @return bool - */ public function isSkipNodeUpdate(): bool { return $this->SkipNodeUpdate; } - /** - * @param bool $SkipNodeUpdate - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogRegistration - */ public function setSkipNodeUpdate(bool $SkipNodeUpdate): self { $this->SkipNodeUpdate = $SkipNodeUpdate; diff --git a/src/Catalog/CatalogService.php b/src/Catalog/CatalogService.php index 62f600cc..deb51345 100644 --- a/src/Catalog/CatalogService.php +++ b/src/Catalog/CatalogService.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,9 +25,6 @@ use DCarbone\PHPConsulAPI\Health\HealthChecks; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class CatalogService - */ class CatalogService extends AbstractModel { protected const FIELDS = [ @@ -58,381 +55,229 @@ class CatalogService extends AbstractModel private const FIELD_HEALTH_CHECKS = 'HealthChecks'; private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Node = ''; - /** @var string */ public string $Address = ''; - /** @var string */ public string $Datacenter = ''; - /** @var array */ public array $TaggedAddresses = []; - /** @var array */ public array $NodeMeta = []; - /** @var string */ public string $ServiceID = ''; - /** @var string */ public string $ServiceName = ''; - /** @var string */ public string $ServiceAddress = ''; - /** @var \DCarbone\PHPConsulAPI\Catalog\ServiceAddress[] */ public array $ServiceTaggedAddresses = []; - /** @var string[] */ public array $ServiceTags = []; - /** @var array */ public array $ServiceMeta = []; - /** @var int */ public int $ServicePort = 0; - /** @var \DCarbone\PHPConsulAPI\Catalog\Weights */ public Weights $ServiceWeights; - /** @var bool */ public bool $ServiceEnableTagOverride = false; - /** @var int */ public int $CreateIndex = 0; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig|null */ public ?AgentServiceConnectProxyConfig $ServiceProxy = null; - /** @var int */ public int $ModifyIndex = 0; - /** @var string */ public string $Namespace = ''; - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getNode(): string { return $this->Node; } - /** - * @param string $Node - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setNode(string $Node): self { $this->Node = $Node; return $this; } - /** - * @return string - */ public function getAddress(): string { return $this->Address; } - /** - * @param string $Address - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setAddress(string $Address): self { $this->Address = $Address; return $this; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @param string $Datacenter - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setDatacenter(string $Datacenter): self { $this->Datacenter = $Datacenter; return $this; } - /** - * @return array - */ public function getTaggedAddresses(): array { return $this->TaggedAddresses; } - /** - * @param array $TaggedAddresses - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setTaggedAddresses(array $TaggedAddresses): self { $this->TaggedAddresses = $TaggedAddresses; return $this; } - /** - * @return array - */ public function getNodeMeta(): array { return $this->NodeMeta; } - /** - * @param array $NodeMeta - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setNodeMeta(array $NodeMeta): self { $this->NodeMeta = $NodeMeta; return $this; } - /** - * @return string - */ public function getServiceID(): string { return $this->ServiceID; } - /** - * @param string $ServiceID - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setServiceID(string $ServiceID): self { $this->ServiceID = $ServiceID; return $this; } - /** - * @return string - */ public function getServiceName(): string { return $this->ServiceName; } - /** - * @param string $ServiceName - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setServiceName(string $ServiceName): self { $this->ServiceName = $ServiceName; return $this; } - /** - * @return string - */ public function getServiceAddress(): string { return $this->ServiceAddress; } - /** - * @param string $ServiceAddress - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setServiceAddress(string $ServiceAddress): self { $this->ServiceAddress = $ServiceAddress; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Catalog\ServiceAddress[] - */ public function getServiceTaggedAddresses(): array { return $this->ServiceTaggedAddresses; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\ServiceAddress[] $ServiceTaggedAddresses - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setServiceTaggedAddresses(array $ServiceTaggedAddresses): self { $this->ServiceTaggedAddresses = $ServiceTaggedAddresses; return $this; } - /** - * @return string[] - */ public function getServiceTags(): array { return $this->ServiceTags; } - /** - * @param string[] $ServiceTags - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setServiceTags(array $ServiceTags): self { $this->ServiceTags = $ServiceTags; return $this; } - /** - * @return array - */ public function getServiceMeta(): array { return $this->ServiceMeta; } - /** - * @param array $ServiceMeta - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setServiceMeta(array $ServiceMeta): self { $this->ServiceMeta = $ServiceMeta; return $this; } - /** - * @return int - */ public function getServicePort(): int { return $this->ServicePort; } - /** - * @param int $ServicePort - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setServicePort(int $ServicePort): self { $this->ServicePort = $ServicePort; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Catalog\Weights - */ public function getServiceWeights(): Weights { return $this->ServiceWeights; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\Weights $ServiceWeights - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setServiceWeights(Weights $ServiceWeights): self { $this->ServiceWeights = $ServiceWeights; return $this; } - /** - * @return bool - */ public function isServiceEnableTagOverride(): bool { return $this->ServiceEnableTagOverride; } - /** - * @param bool $ServiceEnableTagOverride - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setServiceEnableTagOverride(bool $ServiceEnableTagOverride): self { $this->ServiceEnableTagOverride = $ServiceEnableTagOverride; return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig|null - */ public function getServiceProxy(): ?AgentServiceConnectProxyConfig { return $this->ServiceProxy; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentServiceConnectProxyConfig|null $ServiceProxy - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setServiceProxy(?AgentServiceConnectProxyConfig $ServiceProxy): self { $this->ServiceProxy = $ServiceProxy; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; return $this; } - /** - * @return string|null - */ public function getNamespace(): ?string { return $this->Namespace; } - /** - * @param string|null $Namespace - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService - */ public function setNamespace(?string $Namespace): self { $this->Namespace = $Namespace; diff --git a/src/Catalog/CatalogServicesResponse.php b/src/Catalog/CatalogServicesResponse.php index 4d035446..6cbbc8f1 100644 --- a/src/Catalog/CatalogServicesResponse.php +++ b/src/Catalog/CatalogServicesResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class CatalogServicesResponse - */ class CatalogServicesResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Catalog\CatalogService[]|null */ public ?array $Services = null; - /** - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService[]|null - */ public function getValue(): ?array { return $this->Services; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->Services = []; diff --git a/src/Catalog/CompoundServiceName.php b/src/Catalog/CompoundServiceName.php index 7844c4d3..31d32162 100644 --- a/src/Catalog/CompoundServiceName.php +++ b/src/Catalog/CompoundServiceName.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class CompoundServiceName - */ class CompoundServiceName extends AbstractModel { protected const FIELDS = [ @@ -34,41 +31,25 @@ class CompoundServiceName extends AbstractModel private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Namespace = ''; - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\Catalog\CompoundServiceName - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\Catalog\CompoundServiceName - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; diff --git a/src/Catalog/GatewayService.php b/src/Catalog/GatewayService.php index 6fe8ce80..2a47bee2 100644 --- a/src/Catalog/GatewayService.php +++ b/src/Catalog/GatewayService.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class GatewayService - */ class GatewayService extends AbstractModel { protected const FIELDS = [ @@ -48,7 +45,7 @@ class GatewayService extends AbstractModel self::FIELD_CERT_FILE => Transcoding::OMITEMPTY_STRING_FIELD, self::FIELD_KEY_FILE => Transcoding::OMITEMPTY_STRING_FIELD, self::FIELD_SNI => Transcoding::OMITEMPTY_STRING_FIELD, - self::FIELD_FROM_WILDCARD=> Transcoding::OMITEMPTY_BOOLEAN_FIELD, + self::FIELD_FROM_WILDCARD => Transcoding::OMITEMPTY_BOOLEAN_FIELD, ]; private const FIELD_GATEWAY = 'Gateway'; @@ -62,33 +59,18 @@ class GatewayService extends AbstractModel private const FIELD_SNI = 'SNI'; private const FIELD_FROM_WILDCARD = 'FromWildcard'; - /** @var \DCarbone\PHPConsulAPI\Catalog\CompoundServiceName */ public CompoundServiceName $Gateway; - /** @var \DCarbone\PHPConsulAPI\Catalog\CompoundServiceName */ public CompoundServiceName $Service; - /** @var string */ public string $GatewayKind = ''; - /** @var int */ public int $Port = 0; - /** @var string */ public string $Protocol = ''; - /** @var string[] */ public array $Hosts = []; - /** @var string */ public string $CAFile = ''; - /** @var string */ public string $CertFile = ''; - /** @var string */ public string $KeyFile = ''; - /** @var string */ public string $SNI = ''; - /** @var string */ public string $FromWildCard = ''; - /** - * GatewayService constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -100,198 +82,121 @@ public function __construct(?array $data = []) } } - /** - * @return \DCarbone\PHPConsulAPI\Catalog\CompoundServiceName - */ public function getGateway(): CompoundServiceName { return $this->Gateway; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\CompoundServiceName $Gateway - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayService - */ public function setGateway(CompoundServiceName $Gateway): self { $this->Gateway = $Gateway; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Catalog\CompoundServiceName - */ public function getService(): CompoundServiceName { return $this->Service; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\CompoundServiceName $Service - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayService - */ public function setService(CompoundServiceName $Service): self { $this->Service = $Service; return $this; } - /** - * @return string - */ public function getGatewayKind(): string { return $this->GatewayKind; } - /** - * @param string $GatewayKind - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayService - */ public function setGatewayKind(string $GatewayKind): self { $this->GatewayKind = $GatewayKind; return $this; } - /** - * @return int - */ public function getPort(): int { return $this->Port; } - /** - * @param int $Port - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayService - */ public function setPort(int $Port): self { $this->Port = $Port; return $this; } - /** - * @return string - */ public function getProtocol(): string { return $this->Protocol; } - /** - * @param string $Protocol - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayService - */ public function setProtocol(string $Protocol): self { $this->Protocol = $Protocol; return $this; } - /** - * @return string[] - */ public function getHosts(): array { return $this->Hosts; } - /** - * @param string[] $Hosts - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayService - */ public function setHosts(array $Hosts): self { $this->Hosts = $Hosts; return $this; } - /** - * @return string - */ public function getCAFile(): string { return $this->CAFile; } - /** - * @param string $CAFile - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayService - */ public function setCAFile(string $CAFile): self { $this->CAFile = $CAFile; return $this; } - /** - * @return string - */ public function getCertFile(): string { return $this->CertFile; } - /** - * @param string $CertFile - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayService - */ public function setCertFile(string $CertFile): self { $this->CertFile = $CertFile; return $this; } - /** - * @return string - */ public function getKeyFile(): string { return $this->KeyFile; } - /** - * @param string $KeyFile - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayService - */ public function setKeyFile(string $KeyFile): self { $this->KeyFile = $KeyFile; return $this; } - /** - * @return string - */ public function getSNI(): string { return $this->SNI; } - /** - * @param string $SNI - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayService - */ public function setSNI(string $SNI): self { $this->SNI = $SNI; return $this; } - /** - * @return string - */ public function getFromWildCard(): string { return $this->FromWildCard; } - /** - * @param string $FromWildCard - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayService - */ public function setFromWildCard(string $FromWildCard): self { $this->FromWildCard = $FromWildCard; diff --git a/src/Catalog/GatewayServicesResponse.php b/src/Catalog/GatewayServicesResponse.php index 74267c88..cbf9d620 100644 --- a/src/Catalog/GatewayServicesResponse.php +++ b/src/Catalog/GatewayServicesResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class GatewayServicesResponse - */ class GatewayServicesResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Catalog\GatewayService[]|null */ public ?array $GatewayServices = null; - /** - * @return \DCarbone\PHPConsulAPI\Catalog\GatewayService[]|mixed|null - */ public function getValue(): mixed { return $this->GatewayServices; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->GatewayServices = []; diff --git a/src/Catalog/Node.php b/src/Catalog/Node.php index 766c4855..2a6d19fa 100644 --- a/src/Catalog/Node.php +++ b/src/Catalog/Node.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\FakeMap; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class Node - */ class Node extends AbstractModel { protected const FIELDS = [ @@ -37,27 +34,15 @@ class Node extends AbstractModel private const FIELD_TAGGED_ADDRESSES = 'TaggedAddresses'; private const FIELD_META = 'Meta'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Node = ''; - /** @var string */ public string $Address = ''; - /** @var string */ public string $Datacenter = ''; - /** @var \DCarbone\PHPConsulAPI\FakeMap */ public FakeMap $TaggedAddresses; - /** @var \DCarbone\PHPConsulAPI\FakeMap */ public FakeMap $Meta; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** - * Node constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -66,144 +51,88 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\Catalog\Node - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getNode(): string { return $this->Node; } - /** - * @param string $Node - * @return \DCarbone\PHPConsulAPI\Catalog\Node - */ public function setNode(string $Node): self { $this->Node = $Node; return $this; } - /** - * @return string - */ public function getAddress(): string { return $this->Address; } - /** - * @param string $Address - * @return \DCarbone\PHPConsulAPI\Catalog\Node - */ public function setAddress(string $Address): self { $this->Address = $Address; return $this; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @param string $Datacenter - * @return \DCarbone\PHPConsulAPI\Catalog\Node - */ public function setDatacenter(string $Datacenter): self { $this->Datacenter = $Datacenter; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\FakeMap - */ public function getTaggedAddresses(): FakeMap { return $this->TaggedAddresses; } - /** - * @param \DCarbone\PHPConsulAPI\FakeMap $TaggedAddresses - * @return \DCarbone\PHPConsulAPI\Catalog\Node - */ public function setTaggedAddresses(FakeMap $TaggedAddresses): self { $this->TaggedAddresses = $TaggedAddresses; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\FakeMap - */ public function getMeta(): FakeMap { return $this->Meta; } - /** - * @param \DCarbone\PHPConsulAPI\FakeMap $Meta - * @return \DCarbone\PHPConsulAPI\Catalog\Node - */ public function setMeta(FakeMap $Meta): self { $this->Meta = $Meta; return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\Catalog\Node - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\Catalog\Node - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; diff --git a/src/Catalog/NodesResponse.php b/src/Catalog/NodesResponse.php index 428dcc0d..f38cddd9 100644 --- a/src/Catalog/NodesResponse.php +++ b/src/Catalog/NodesResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class NodesResponse - */ class NodesResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Catalog\Node[]|null */ public ?array $Nodes = null; - /** - * @return \DCarbone\PHPConsulAPI\Catalog\Node[]|mixed|null - */ public function getValue(): mixed { return $this->Nodes; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->Nodes = []; diff --git a/src/Catalog/ServiceAddress.php b/src/Catalog/ServiceAddress.php index 2a1bfd11..27d1fb6b 100644 --- a/src/Catalog/ServiceAddress.php +++ b/src/Catalog/ServiceAddress.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,46 +22,27 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class ServiceAddress - */ class ServiceAddress extends AbstractModel { - /** @var string */ public string $Address = ''; - /** @var int */ public int $Port = 0; - /** - * @return string - */ public function getAddress(): string { return $this->Address; } - /** - * @param string $address - * @return \DCarbone\PHPConsulAPI\Catalog\ServiceAddress - */ public function setAddress(string $address): self { $this->Address = $address; return $this; } - /** - * @return int - */ public function getPort(): int { return $this->Port; } - /** - * @param int $port - * @return \DCarbone\PHPConsulAPI\Catalog\ServiceAddress - */ public function setPort(int $port): self { $this->Port = $port; diff --git a/src/Catalog/Weights.php b/src/Catalog/Weights.php index 057ceab4..08021e75 100644 --- a/src/Catalog/Weights.php +++ b/src/Catalog/Weights.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Catalog; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,46 +22,27 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class Weights - */ class Weights extends AbstractModel { - /** @var int */ public int $Passing = 0; - /** @var int */ public int $Warning = 0; - /** - * @return int - */ public function getPassing(): int { return $this->Passing; } - /** - * @param int $Passing - * @return \DCarbone\PHPConsulAPI\Catalog\Weights - */ public function setPassing(int $Passing): self { $this->Passing = $Passing; return $this; } - /** - * @return int - */ public function getWarning(): int { return $this->Warning; } - /** - * @param int $Warning - * @return \DCarbone\PHPConsulAPI\Catalog\Weights - */ public function setWarning(int $Warning): self { $this->Warning = $Warning; diff --git a/src/Config.php b/src/Config.php index 5a995217..7f652148 100644 --- a/src/Config.php +++ b/src/Config.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,9 +25,6 @@ use GuzzleHttp\ClientInterface; use GuzzleHttp\RequestOptions; -/** - * Class Config - */ class Config { use Unmarshaller; @@ -71,23 +68,10 @@ class Config */ public string $Address = ''; - /** - * The scheme to use. Currently only HTTP and HTTPS are supported. - * - * @var string - */ public string $Scheme = ''; - /** - * The name of the datacenter you wish all queries to be made against by default - * - * @var string - */ public string $Datacenter = ''; - /** - * @var string - */ public string $Namespace = ''; /** @@ -97,18 +81,8 @@ class Config */ public ?HttpAuth $HttpAuth = null; - /** - * Time to wait on certain blockable endpoints - * - * @var \DCarbone\Go\Time\Duration|null - */ public ?Time\Duration $WaitTime = null; - /** - * ACL token to use by default - * - * @var string - */ public string $Token = ''; /** @@ -120,11 +94,6 @@ class Config */ public string $TokenFile = ''; - /** - * Optional path to CA certificate - * - * @var string - */ public string $CAFile = ''; /** @@ -141,31 +110,12 @@ class Config */ public string $KeyFile = ''; - /** - * Whether to skip SSL validation. This does nothing unless you use it within your HttpClient of choice. - * - * @var bool - */ public bool $InsecureSkipVerify = false; - /** - * Your HttpClient of choice. - * - * @var \GuzzleHttp\ClientInterface - */ public ClientInterface $HttpClient; - /** - * Bitwise options to provide to JSON encoder when encoding request bodies - * - * @var int - */ public int $JSONEncodeOpts = 0; - /** - * Config constructor. - * @param array $config - */ public function __construct(array $config = []) { foreach ($config + self::_getDefaultConfig() as $k => $v) { @@ -192,10 +142,6 @@ public function __construct(array $config = []) } } - /** - * @param \DCarbone\PHPConsulAPI\Config|null $inc - * @return \DCarbone\PHPConsulAPI\Config - */ public static function merge(?self $inc): self { $actual = static::newDefaultConfig(); @@ -247,170 +193,103 @@ public static function merge(?self $inc): self return $actual; } - /** - * Construct a configuration object from Environment Variables and use bare guzzle client instance - * - * @return \DCarbone\PHPConsulAPI\Config - */ public static function newDefaultConfig(): self { return new static(self::_getDefaultConfig()); } - /** - * @return string - */ public function getAddress(): string { return $this->Address; } - /** - * @param string $address - * @return \DCarbone\PHPConsulAPI\Config - */ public function setAddress(string $address): self { $this->Address = $address; return $this; } - /** - * @return string - */ public function getScheme(): string { return $this->Scheme; } - /** - * @param string $scheme - * @return \DCarbone\PHPConsulAPI\Config - */ public function setScheme(string $scheme): self { $this->Scheme = $scheme; return $this; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @param string $datacenter - * @return \DCarbone\PHPConsulAPI\Config - */ public function setDatacenter(string $datacenter): self { $this->Datacenter = $datacenter; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $namespace - */ public function setNamespace(string $namespace): void { $this->Namespace = $namespace; } - /** - * @return \DCarbone\Go\Time\Duration - */ public function getWaitTime(): Time\Duration { return $this->WaitTime; } - /** - * @param mixed $waitTime - * @return \DCarbone\PHPConsulAPI\Config - */ public function setWaitTime(mixed $waitTime): self { $this->WaitTime = Time::Duration($waitTime); return $this; } - /** - * @return string - */ public function getToken(): string { return $this->Token; } - /** - * @param string $token - * @return \DCarbone\PHPConsulAPI\Config - */ public function setToken(string $token): self { $this->Token = $token; return $this; } - /** - * @return string - */ public function getTokenFile(): string { return $this->TokenFile; } - /** - * @param string $tokenFile - * @return \DCarbone\PHPConsulAPI\Config - */ public function setTokenFile(string $tokenFile): self { $this->TokenFile = $tokenFile; return $this; } - /** - * @return bool - */ public function isInsecureSkipVerify(): bool { return $this->InsecureSkipVerify; } - /** - * @param bool $insecureSkipVerify - * @return \DCarbone\PHPConsulAPI\Config - */ public function setInsecureSkipVerify(bool $insecureSkipVerify): self { $this->InsecureSkipVerify = $insecureSkipVerify; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\HttpAuth - */ public function getHttpAuth(): HttpAuth { return $this->HttpAuth; } - /** - * @param \DCarbone\PHPConsulAPI\HttpAuth|string $httpAuth - * @return \DCarbone\PHPConsulAPI\Config - */ public function setHttpAuth(HttpAuth|string $httpAuth): self { if (\is_string($httpAuth)) { @@ -439,99 +318,61 @@ public function setHttpAuth(HttpAuth|string $httpAuth): self ); } - /** - * @return string - */ public function getCAFile(): string { return $this->CAFile; } - /** - * @param string $caFile - * @return \DCarbone\PHPConsulAPI\Config - */ public function setCAFile(string $caFile): self { $this->CAFile = $caFile; return $this; } - /** - * @return string - */ public function getCertFile(): string { return $this->CertFile; } - /** - * @param string $certFile - * @return \DCarbone\PHPConsulAPI\Config - */ public function setCertFile(string $certFile): self { $this->CertFile = $certFile; return $this; } - /** - * @return string - */ public function getKeyFile(): string { return $this->KeyFile; } - /** - * @param string $keyFile - * @return \DCarbone\PHPConsulAPI\Config - */ public function setKeyFile(string $keyFile): self { $this->KeyFile = $keyFile; return $this; } - /** - * @return \GuzzleHttp\ClientInterface - */ public function getHttpClient(): ClientInterface { return $this->HttpClient; } - /** - * @param \GuzzleHttp\ClientInterface $httpClient - * @return \DCarbone\PHPConsulAPI\Config - */ public function setHttpClient(ClientInterface $httpClient): self { $this->HttpClient = $httpClient; return $this; } - /** - * @return int - */ public function getJSONEncodeOpts(): int { return $this->JSONEncodeOpts; } - /** - * @param int $jsonEncodeOpts - * @return \DCarbone\PHPConsulAPI\Config - */ public function setJSONEncodeOpts(int $jsonEncodeOpts): self { $this->JSONEncodeOpts = $jsonEncodeOpts; return $this; } - /** - * @return array - */ public static function getEnvironmentConfig(): array { $ret = []; @@ -555,10 +396,6 @@ public static function getEnvironmentConfig(): array return $ret; } - /** - * @param string $param - * @return string|null - */ protected static function _tryGetEnvParam(string $param): ?string { if (isset($_ENV[$param])) { @@ -576,9 +413,6 @@ protected static function _tryGetEnvParam(string $param): ?string return null; } - /** - * @return array - */ private static function _getDefaultConfig(): array { $conf = self::DEFAULT_CONFIG; diff --git a/src/ConfigEntry/ConfigEntry.php b/src/ConfigEntry/ConfigEntry.php index eb9b642a..23789581 100644 --- a/src/ConfigEntry/ConfigEntry.php +++ b/src/ConfigEntry/ConfigEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -39,33 +39,15 @@ interface ConfigEntry public const FIELD_NAMESPACE = 'Namespace'; public const FIELD_META = 'Meta'; - /** - * @return string - */ public function GetKind(): string; - /** - * @return string - */ public function GetName(): string; - /** - * @return string - */ public function GetNamespace(): string; - /** - * @return \DCarbone\PHPConsulAPI\FakeMap|null - */ public function GetMeta(): ?FakeMap; - /** - * @return int - */ public function GetCreateIndex(): int; - /** - * @return int - */ public function GetModifyIndex(): int; } diff --git a/src/ConfigEntry/ConfigEntryTrait.php b/src/ConfigEntry/ConfigEntryTrait.php index 7d208398..3a302dc1 100644 --- a/src/ConfigEntry/ConfigEntryTrait.php +++ b/src/ConfigEntry/ConfigEntryTrait.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,126 +22,75 @@ use DCarbone\PHPConsulAPI\FakeMap; -/** - * Trait ConfigEntryTrait - */ trait ConfigEntryTrait { - /** @var string */ public string $Kind = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Namespace = ''; - /** @var \DCarbone\PHPConsulAPI\FakeMap|null */ public ?FakeMap $Meta = null; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** - * @return string - */ public function getKind(): string { return $this->Kind; } - /** - * @param string $Kind - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ConfigEntry - */ public function setKind(string $Kind): ConfigEntry { $this->Kind = $Kind; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ConfigEntry - */ public function setName(string $Name): ConfigEntry { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ConfigEntry - */ public function setNamespace(string $Namespace): ConfigEntry { $this->Namespace = $Namespace; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\FakeMap|null - */ public function getMeta(): ?FakeMap { return $this->Meta; } - /** - * @param mixed $Meta - * @return ProxyConfigEntry - */ public function setMeta(mixed $Meta): ProxyConfigEntry { $this->Meta = FakeMap::parse($Meta); return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return ProxyConfigEntry - */ public function setCreateIndex(int $CreateIndex): ProxyConfigEntry { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return ProxyConfigEntry - */ public function setModifyIndex(int $ModifyIndex): ProxyConfigEntry { $this->ModifyIndex = $ModifyIndex; diff --git a/src/ConfigEntry/ExposeConfig.php b/src/ConfigEntry/ExposeConfig.php index c48e6ffe..de9d7867 100644 --- a/src/ConfigEntry/ExposeConfig.php +++ b/src/ConfigEntry/ExposeConfig.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ExposeConfig - */ class ExposeConfig extends AbstractModel { protected const FIELDS = [ @@ -41,41 +38,25 @@ class ExposeConfig extends AbstractModel private const FIELD_CHECKS = 'Checks'; private const FIELD_PATHS = 'Paths'; - /** @var bool */ public bool $Checks = false; - /** @var array */ public array $Paths = []; - /** - * @return bool - */ public function isChecks(): bool { return $this->Checks; } - /** - * @param bool $Checks - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ExposeConfig - */ public function setChecks(bool $Checks): self { $this->Checks = $Checks; return $this; } - /** - * @return array - */ public function getPaths(): array { return $this->Paths; } - /** - * @param array $Paths - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ExposeConfig - */ public function setPaths(array $Paths): self { $this->Paths = $Paths; diff --git a/src/ConfigEntry/ExposePath.php b/src/ConfigEntry/ExposePath.php index 39445cc1..78d0ddb4 100644 --- a/src/ConfigEntry/ExposePath.php +++ b/src/ConfigEntry/ExposePath.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ExposePath - */ class ExposePath extends AbstractModel { protected const FIELDS = [ @@ -40,101 +37,61 @@ class ExposePath extends AbstractModel private const FIELD_LOCAL_PORT_PATH = 'LocalPortPath'; private const FIELD_PROTOCOL = 'Protocol'; - /** @var int */ public int $ListenerPort = 0; - /** @var string */ public string $Path = ''; - /** @var int */ public int $LocalPathPort = 0; - /** @var string */ public string $Protocol = ''; - /** @var bool */ public bool $ParsedFromCheck = false; - /** - * @return int - */ public function getListenerPort(): int { return $this->ListenerPort; } - /** - * @param int $ListenerPort - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ExposePath - */ public function setListenerPort(int $ListenerPort): self { $this->ListenerPort = $ListenerPort; return $this; } - /** - * @return string - */ public function getPath(): string { return $this->Path; } - /** - * @param string $Path - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ExposePath - */ public function setPath(string $Path): self { $this->Path = $Path; return $this; } - /** - * @return int - */ public function getLocalPathPort(): int { return $this->LocalPathPort; } - /** - * @param int $LocalPathPort - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ExposePath - */ public function setLocalPathPort(int $LocalPathPort): self { $this->LocalPathPort = $LocalPathPort; return $this; } - /** - * @return string - */ public function getProtocol(): string { return $this->Protocol; } - /** - * @param string $Protocol - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ExposePath - */ public function setProtocol(string $Protocol): self { $this->Protocol = $Protocol; return $this; } - /** - * @return bool - */ public function isParsedFromCheck(): bool { return $this->ParsedFromCheck; } - /** - * @param bool $ParsedFromCheck - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ExposePath - */ public function setParsedFromCheck(bool $ParsedFromCheck): self { $this->ParsedFromCheck = $ParsedFromCheck; diff --git a/src/ConfigEntry/MeshConfigEntry.php b/src/ConfigEntry/MeshConfigEntry.php index 6212e6a3..27414433 100644 --- a/src/ConfigEntry/MeshConfigEntry.php +++ b/src/ConfigEntry/MeshConfigEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class MeshConfigEntry - */ class MeshConfigEntry extends AbstractModel implements ConfigEntry { use ConfigEntryTrait; @@ -43,18 +40,11 @@ class MeshConfigEntry extends AbstractModel implements ConfigEntry public TransparentProxyConfig $TransparentProxy; - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\TransparentProxyConfig - */ public function getTransparentProxy(): TransparentProxyConfig { return $this->TransparentProxy; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\TransparentProxyConfig $TransparentProxy - * @return MeshConfigEntry - */ public function setTransparentProxy(TransparentProxyConfig $TransparentProxy): self { $this->TransparentProxy = $TransparentProxy; diff --git a/src/ConfigEntry/MeshGatewayConfig.php b/src/ConfigEntry/MeshGatewayConfig.php index 42e9079e..68074e57 100644 --- a/src/ConfigEntry/MeshGatewayConfig.php +++ b/src/ConfigEntry/MeshGatewayConfig.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class MeshGatewayConfig - */ class MeshGatewayConfig extends AbstractModel { protected const FIELDS = [ @@ -34,21 +31,13 @@ class MeshGatewayConfig extends AbstractModel private const FIELD_MODE = 'Mode'; - /** @var string */ public string $Mode = ''; - /** - * @return string - */ public function getMode(): string { return $this->Mode; } - /** - * @param string $mode - * @return \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig - */ public function setMode(string $mode): self { $this->Mode = $mode; diff --git a/src/ConfigEntry/PassiveHealthCheck.php b/src/ConfigEntry/PassiveHealthCheck.php index 8a62c388..cec65118 100644 --- a/src/ConfigEntry/PassiveHealthCheck.php +++ b/src/ConfigEntry/PassiveHealthCheck.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class PassiveHealthCheck - */ class PassiveHealthCheck extends AbstractModel { protected const FIELDS = [ @@ -38,14 +35,9 @@ class PassiveHealthCheck extends AbstractModel private const FIELD_INTERVAL = 'Interval'; - /** @var \DCarbone\Go\Time\Duration */ public Time\Duration $Interval; - /** @var int */ public int $MaxFailures = 0; - /** - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -54,36 +46,22 @@ public function __construct(?array $data = []) } } - /** - * @return \DCarbone\Go\Time\Duration - */ public function getInterval(): Time\Duration { return $this->Interval; } - /** - * @param \DCarbone\Go\Time\Duration $Interval - * @return PassiveHealthCheck - */ public function setInterval(Time\Duration $Interval): self { $this->Interval = $Interval; return $this; } - /** - * @return int - */ public function getMaxFailures(): int { return $this->MaxFailures; } - /** - * @param int $MaxFailures - * @return PassiveHealthCheck - */ public function setMaxFailures(int $MaxFailures): self { $this->MaxFailures = $MaxFailures; diff --git a/src/ConfigEntry/ProxyConfigEntry.php b/src/ConfigEntry/ProxyConfigEntry.php index c16dc595..d8896dd8 100644 --- a/src/ConfigEntry/ProxyConfigEntry.php +++ b/src/ConfigEntry/ProxyConfigEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\FakeMap; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ProxyConfigEntry - */ class ProxyConfigEntry extends AbstractModel implements ConfigEntry { use ConfigEntryTrait; @@ -58,101 +55,61 @@ class ProxyConfigEntry extends AbstractModel implements ConfigEntry private const FIELD_MESH_GATEWAY = 'MeshGateway'; private const FIELD_EXPOSE = 'Expose'; - /** @var string */ public string $Mode = ''; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\TransparentProxyConfig|null */ public ?TransparentProxyConfig $TransparentProxy = null; - /** @var \DCarbone\PHPConsulAPI\FakeMap|null */ public ?FakeMap $Config = null; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig */ public MeshGatewayConfig $MeshGateway; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\ExposeConfig */ public ExposeConfig $Expose; - /** - * @return string - */ public function getMode(): string { return $this->Mode; } - /** - * @param string $Mode - * @return ProxyConfigEntry - */ public function setMode(string $Mode): self { $this->Mode = $Mode; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\TransparentProxyConfig|null - */ public function getTransparentProxy(): ?TransparentProxyConfig { return $this->TransparentProxy; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\TransparentProxyConfig|null $TransparentProxy - * @return ProxyConfigEntry - */ public function setTransparentProxy(?TransparentProxyConfig $TransparentProxy): self { $this->TransparentProxy = $TransparentProxy; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\FakeMap|null - */ public function getConfig(): ?FakeMap { return $this->Config; } - /** - * @param mixed $Config - * @return ProxyConfigEntry - */ public function setConfig(mixed $Config): self { $this->Config = FakeMap::parse($Config); return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig - */ public function getMeshGateway(): MeshGatewayConfig { return $this->MeshGateway; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig $MeshGateway - * @return ProxyConfigEntry - */ public function setMeshGateway(MeshGatewayConfig $MeshGateway): self { $this->MeshGateway = $MeshGateway; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ExposeConfig - */ public function getExpose(): ExposeConfig { return $this->Expose; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\ExposeConfig $Expose - * @return ProxyConfigEntry - */ public function setExpose(ExposeConfig $Expose): self { $this->Expose = $Expose; diff --git a/src/ConfigEntry/RingHashConfig.php b/src/ConfigEntry/RingHashConfig.php index de86d150..6b7fad97 100644 --- a/src/ConfigEntry/RingHashConfig.php +++ b/src/ConfigEntry/RingHashConfig.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class RingHashConfig - */ class RingHashConfig extends AbstractModel { protected const FIELDS = [ diff --git a/src/ConfigEntry/ServiceConfigEntry.php b/src/ConfigEntry/ServiceConfigEntry.php index 2de4a248..750fe4ce 100644 --- a/src/ConfigEntry/ServiceConfigEntry.php +++ b/src/ConfigEntry/ServiceConfigEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceConfigEntry - */ class ServiceConfigEntry extends AbstractModel implements ConfigEntry { use ConfigEntryTrait; @@ -66,142 +63,85 @@ class ServiceConfigEntry extends AbstractModel implements ConfigEntry private const FIELD_EXTERNAL_SNI = 'ExternalSNI'; private const FIELD_UPSTREAM_CONFIG = 'UpstreamConfig'; - /** @var string */ public string $Protocol = ''; - /** @var string */ public string $Mode = ''; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\TransparentProxyConfig|null */ public ?TransparentProxyConfig $TransparentProxy = null; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig */ public MeshGatewayConfig $MeshGateway; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\ExposeConfig */ public ExposeConfig $Expose; - /** @var string */ public string $ExternalSNI = ''; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\UpstreamConfiguration|null */ public ?UpstreamConfiguration $UpstreamConfig = null; - /** @var \DCarbone\PHPConsulAPI\FakeMap|null */ - /** - * @return string - */ public function getProtocol(): string { return $this->Protocol; } - /** - * @param string $Protocol - * @return ServiceConfigEntry - */ public function setProtocol(string $Protocol): self { $this->Protocol = $Protocol; return $this; } - /** - * @return string - */ public function getMode(): string { return $this->Mode; } - /** - * @param string $Mode - * @return ServiceConfigEntry - */ public function setMode(string $Mode): self { $this->Mode = $Mode; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\TransparentProxyConfig|null - */ public function getTransparentProxy(): ?TransparentProxyConfig { return $this->TransparentProxy; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\TransparentProxyConfig|null $TransparentProxy - * @return ServiceConfigEntry - */ public function setTransparentProxy(?TransparentProxyConfig $TransparentProxy): self { $this->TransparentProxy = $TransparentProxy; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig - */ public function getMeshGateway(): MeshGatewayConfig { return $this->MeshGateway; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig $MeshGateway - * @return ServiceConfigEntry - */ public function setMeshGateway(MeshGatewayConfig $MeshGateway): self { $this->MeshGateway = $MeshGateway; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ExposeConfig - */ public function getExpose(): ExposeConfig { return $this->Expose; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\ExposeConfig $Expose - * @return ServiceConfigEntry - */ public function setExpose(ExposeConfig $Expose): self { $this->Expose = $Expose; return $this; } - /** - * @return string - */ public function getExternalSNI(): string { return $this->ExternalSNI; } - /** - * @param string $ExternalSNI - * @return ServiceConfigEntry - */ public function setExternalSNI(string $ExternalSNI): self { $this->ExternalSNI = $ExternalSNI; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\UpstreamConfiguration|null - */ public function getUpstreamConfig(): ?UpstreamConfiguration { return $this->UpstreamConfig; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\UpstreamConfiguration|null $UpstreamConfig - * @return ServiceConfigEntry - */ public function setUpstreamConfig(?UpstreamConfiguration $UpstreamConfig): self { $this->UpstreamConfig = $UpstreamConfig; diff --git a/src/ConfigEntry/ServiceResolverConfigEntry.php b/src/ConfigEntry/ServiceResolverConfigEntry.php index 6cf2f558..7766fbd2 100644 --- a/src/ConfigEntry/ServiceResolverConfigEntry.php +++ b/src/ConfigEntry/ServiceResolverConfigEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,9 +22,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class ServiceResolverConfigEntry - */ class ServiceResolverConfigEntry extends AbstractModel implements ConfigEntry { use ConfigEntryTrait; diff --git a/src/ConfigEntry/ServiceResolverFailover.php b/src/ConfigEntry/ServiceResolverFailover.php index 5b8302e8..54fad4ca 100644 --- a/src/ConfigEntry/ServiceResolverFailover.php +++ b/src/ConfigEntry/ServiceResolverFailover.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceResolverFailover - */ class ServiceResolverFailover extends AbstractModel { protected const FIELDS = [ @@ -40,81 +37,49 @@ class ServiceResolverFailover extends AbstractModel private const FIELD_NAMESPACE = 'Namespace'; private const FIELD_DATACENTERS = 'Datacenters'; - /** @var string */ public string $Service = ''; - /** @var string */ public string $ServiceSubset = ''; - /** @var string */ public string $Namespace = ''; - /** @var string[] */ public array $Datacenters = []; - /** - * @return string - */ public function getService(): string { return $this->Service; } - /** - * @param string $Service - * @return ServiceResolverFailover - */ public function setService(string $Service): self { $this->Service = $Service; return $this; } - /** - * @return string - */ public function getServiceSubset(): string { return $this->ServiceSubset; } - /** - * @param string $ServiceSubset - * @return ServiceResolverFailover - */ public function setServiceSubset(string $ServiceSubset): self { $this->ServiceSubset = $ServiceSubset; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return ServiceResolverFailover - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return string[] - */ public function getDatacenters(): array { return $this->Datacenters; } - /** - * @param string[] $Datacenters - * @return ServiceResolverFailover - */ public function setDatacenters(array $Datacenters): self { $this->Datacenters = $Datacenters; diff --git a/src/ConfigEntry/ServiceResolverRedirect.php b/src/ConfigEntry/ServiceResolverRedirect.php index 60dcf266..a8410274 100644 --- a/src/ConfigEntry/ServiceResolverRedirect.php +++ b/src/ConfigEntry/ServiceResolverRedirect.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceResolverSubset - */ class ServiceResolverRedirect extends AbstractModel { protected const FIELDS = [ @@ -40,81 +37,49 @@ class ServiceResolverRedirect extends AbstractModel private const FIELD_NAMESPACE = 'Namespace'; private const FIELD_DATACENTER = 'Datacenter'; - /** @var string */ public string $Service = ''; - /** @var string */ public string $ServiceSubset = ''; - /** @var string */ public string $Namespace = ''; - /** @var string */ public string $Datacenter = ''; - /** - * @return string - */ public function getService(): string { return $this->Service; } - /** - * @param string $Service - * @return ServiceResolverRedirect - */ public function setService(string $Service): self { $this->Service = $Service; return $this; } - /** - * @return string - */ public function getServiceSubset(): string { return $this->ServiceSubset; } - /** - * @param string $ServiceSubset - * @return ServiceResolverRedirect - */ public function setServiceSubset(string $ServiceSubset): self { $this->ServiceSubset = $ServiceSubset; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return ServiceResolverRedirect - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @param string $Datacenter - * @return ServiceResolverRedirect - */ public function setDatacenter(string $Datacenter): self { $this->Datacenter = $Datacenter; diff --git a/src/ConfigEntry/ServiceResolverSubset.php b/src/ConfigEntry/ServiceResolverSubset.php index a2e3f3e2..7a1f8909 100644 --- a/src/ConfigEntry/ServiceResolverSubset.php +++ b/src/ConfigEntry/ServiceResolverSubset.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceResolverSubset - */ class ServiceResolverSubset extends AbstractModel { protected const FIELDS = [ @@ -36,41 +33,25 @@ class ServiceResolverSubset extends AbstractModel private const FIELD_FILTER = 'Filter'; private const FIELD_ONLY_PASSING = 'OnlyPassing'; - /** @var string */ public string $Filter = ''; - /** @var bool */ public bool $OnlyPassing = false; - /** - * @return string - */ public function getFilter(): string { return $this->Filter; } - /** - * @param string $Filter - * @return ServiceResolverSubset - */ public function setFilter(string $Filter): self { $this->Filter = $Filter; return $this; } - /** - * @return bool - */ public function isOnlyPassing(): bool { return $this->OnlyPassing; } - /** - * @param bool $OnlyPassing - * @return ServiceResolverSubset - */ public function setOnlyPassing(bool $OnlyPassing): self { $this->OnlyPassing = $OnlyPassing; diff --git a/src/ConfigEntry/ServiceRoute.php b/src/ConfigEntry/ServiceRoute.php index 2c9a5b3d..c8c60400 100644 --- a/src/ConfigEntry/ServiceRoute.php +++ b/src/ConfigEntry/ServiceRoute.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,9 +22,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * class ServiceRoute - */ class ServiceRoute extends AbstractModel { protected const FIELDS = []; diff --git a/src/ConfigEntry/ServiceRouteDestination.php b/src/ConfigEntry/ServiceRouteDestination.php index be2ed593..22db2b68 100644 --- a/src/ConfigEntry/ServiceRouteDestination.php +++ b/src/ConfigEntry/ServiceRouteDestination.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceRouteDestination - */ class ServiceRouteDestination extends AbstractModel { protected const FIELDS = [ @@ -52,161 +49,97 @@ class ServiceRouteDestination extends AbstractModel private const FIELD_RETRY_ON_CONNECT_FAILURE = 'RetryOnConnectFailure'; private const FIELD_RETRY_ON_STATUS_CODES = 'RetryOnStatusCodes'; - /** @var string */ public string $Service = ''; - /** @var string */ public string $ServiceSubset = ''; - /** @var string */ public string $Namespace = ''; - /** @var string */ public string $PrefixRewrite = ''; - /** @var \DCarbone\Go\Time\Duration */ public Time\Duration $RequestTimeout; - /** @var int */ public int $NumRetries = 0; - /** @var bool */ public bool $RetryOnConnectFailure = false; - /** @var int[] */ public array $RetryOnStatusCodes = []; - /** - * @return string - */ public function getService(): string { return $this->Service; } - /** - * @param string $Service - * @return ServiceRouteDestination - */ public function setService(string $Service): self { $this->Service = $Service; return $this; } - /** - * @return string - */ public function getServiceSubset(): string { return $this->ServiceSubset; } - /** - * @param string $ServiceSubset - * @return ServiceRouteDestination - */ public function setServiceSubset(string $ServiceSubset): self { $this->ServiceSubset = $ServiceSubset; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return ServiceRouteDestination - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return string - */ public function getPrefixRewrite(): string { return $this->PrefixRewrite; } - /** - * @param string $PrefixRewrite - * @return ServiceRouteDestination - */ public function setPrefixRewrite(string $PrefixRewrite): self { $this->PrefixRewrite = $PrefixRewrite; return $this; } - /** - * @return \DCarbone\Go\Time\Duration - */ public function getRequestTimeout(): Time\Duration { return $this->RequestTimeout; } - /** - * @param \DCarbone\Go\Time\Duration $RequestTimeout - * @return ServiceRouteDestination - */ public function setRequestTimeout(Time\Duration $RequestTimeout): self { $this->RequestTimeout = $RequestTimeout; return $this; } - /** - * @return int - */ public function getNumRetries(): int { return $this->NumRetries; } - /** - * @param int $NumRetries - * @return ServiceRouteDestination - */ public function setNumRetries(int $NumRetries): self { $this->NumRetries = $NumRetries; return $this; } - /** - * @return bool - */ public function isRetryOnConnectFailure(): bool { return $this->RetryOnConnectFailure; } - /** - * @param bool $RetryOnConnectFailure - * @return ServiceRouteDestination - */ public function setRetryOnConnectFailure(bool $RetryOnConnectFailure): self { $this->RetryOnConnectFailure = $RetryOnConnectFailure; return $this; } - /** - * @return int[] - */ public function getRetryOnStatusCodes(): array { return $this->RetryOnStatusCodes; } - /** - * @param int[] $RetryOnStatusCodes - * @return ServiceRouteDestination - */ public function setRetryOnStatusCodes(array $RetryOnStatusCodes): self { $this->RetryOnStatusCodes = $RetryOnStatusCodes; diff --git a/src/ConfigEntry/ServiceRouteHTTPMatch.php b/src/ConfigEntry/ServiceRouteHTTPMatch.php index 9d9a1ad0..6e0e4211 100644 --- a/src/ConfigEntry/ServiceRouteHTTPMatch.php +++ b/src/ConfigEntry/ServiceRouteHTTPMatch.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * class ServiceRouteHTTPMatch - */ class ServiceRouteHTTPMatch extends AbstractModel { protected const FIELDS = [ @@ -54,121 +51,73 @@ class ServiceRouteHTTPMatch extends AbstractModel private const FIELD_QUERY_PARAM = 'QueryParam'; private const FIELD_METHODS = 'Methods'; - /** @var string */ public string $PathExact = ''; - /** @var string */ public string $PathPrefix = ''; - /** @var string */ public string $PathRegex = ''; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\ServiceRouteHTTPMatchHeader[] */ public array $Header = []; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\ServiceRouteHTTPMatchQueryParam[] */ public array $QueryParam = []; - /** @var string[] */ public array $Methods = []; - /** - * @return string - */ public function getPathExact(): string { return $this->PathExact; } - /** - * @param string $PathExact - * @return ServiceRouteHTTPMatch - */ public function setPathExact(string $PathExact): self { $this->PathExact = $PathExact; return $this; } - /** - * @return string - */ public function getPathPrefix(): string { return $this->PathPrefix; } - /** - * @param string $PathPrefix - * @return ServiceRouteHTTPMatch - */ public function setPathPrefix(string $PathPrefix): self { $this->PathPrefix = $PathPrefix; return $this; } - /** - * @return string - */ public function getPathRegex(): string { return $this->PathRegex; } - /** - * @param string $PathRegex - * @return ServiceRouteHTTPMatch - */ public function setPathRegex(string $PathRegex): self { $this->PathRegex = $PathRegex; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ServiceRouteHTTPMatchHeader[] - */ public function getHeader(): array { return $this->Header; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\ServiceRouteHTTPMatchHeader[] $Header - * @return ServiceRouteHTTPMatch - */ public function setHeader(array $Header): self { $this->Header = $Header; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ServiceRouteHTTPMatchQueryParam[] - */ public function getQueryParam(): array { return $this->QueryParam; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\ServiceRouteHTTPMatchQueryParam[] $QueryParam - * @return ServiceRouteHTTPMatch - */ public function setQueryParam(array $QueryParam): self { $this->QueryParam = $QueryParam; return $this; } - /** - * @return string[] - */ public function getMethods(): array { return $this->Methods; } - /** - * @param string[] $Methods - * @return ServiceRouteHTTPMatch - */ public function setMethods(array $Methods): self { $this->Methods = $Methods; diff --git a/src/ConfigEntry/ServiceRouteHTTPMatchHeader.php b/src/ConfigEntry/ServiceRouteHTTPMatchHeader.php index a7aab309..b7181eea 100644 --- a/src/ConfigEntry/ServiceRouteHTTPMatchHeader.php +++ b/src/ConfigEntry/ServiceRouteHTTPMatchHeader.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceRouteHTTPMatchHeader - */ class ServiceRouteHTTPMatchHeader extends AbstractModel { protected const FIELDS = [ @@ -44,141 +41,85 @@ class ServiceRouteHTTPMatchHeader extends AbstractModel private const FIELD_REGEX = 'Regex'; private const FIELD_INVERT = 'Invert'; - /** @var string */ public string $Name = ''; - /** @var bool */ public bool $Present = false; - /** @var string */ public string $Exact = ''; - /** @var string */ public string $Prefix = ''; - /** @var string */ public string $Suffix = ''; - /** @var string */ public string $Regex = ''; - /** @var bool|string */ public bool $Invert = false; - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return ServiceRouteHTTPMatchHeader - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return bool - */ public function isPresent(): bool { return $this->Present; } - /** - * @param bool $Present - * @return ServiceRouteHTTPMatchHeader - */ public function setPresent(bool $Present): self { $this->Present = $Present; return $this; } - /** - * @return string - */ public function getExact(): string { return $this->Exact; } - /** - * @param string $Exact - * @return ServiceRouteHTTPMatchHeader - */ public function setExact(string $Exact): self { $this->Exact = $Exact; return $this; } - /** - * @return string - */ public function getPrefix(): string { return $this->Prefix; } - /** - * @param string $Prefix - * @return ServiceRouteHTTPMatchHeader - */ public function setPrefix(string $Prefix): self { $this->Prefix = $Prefix; return $this; } - /** - * @return string - */ public function getSuffix(): string { return $this->Suffix; } - /** - * @param string $Suffix - * @return ServiceRouteHTTPMatchHeader - */ public function setSuffix(string $Suffix): self { $this->Suffix = $Suffix; return $this; } - /** - * @return string - */ public function getRegex(): string { return $this->Regex; } - /** - * @param string $Regex - * @return ServiceRouteHTTPMatchHeader - */ public function setRegex(string $Regex): self { $this->Regex = $Regex; return $this; } - /** - * @return bool|string - */ public function getInvert(): bool|string { return $this->Invert; } - /** - * @param bool|string $Invert - * @return ServiceRouteHTTPMatchHeader - */ public function setInvert(bool|string $Invert): static { $this->Invert = $Invert; diff --git a/src/ConfigEntry/ServiceRouteHTTPMatchQueryParam.php b/src/ConfigEntry/ServiceRouteHTTPMatchQueryParam.php index 4b74f7b3..0063f23b 100644 --- a/src/ConfigEntry/ServiceRouteHTTPMatchQueryParam.php +++ b/src/ConfigEntry/ServiceRouteHTTPMatchQueryParam.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceRouteHTTPMatchQueryParam - */ class ServiceRouteHTTPMatchQueryParam extends AbstractModel { protected const FIELDS = [ @@ -38,81 +35,49 @@ class ServiceRouteHTTPMatchQueryParam extends AbstractModel private const FIELD_EXACT = 'Exact'; private const FIELD_REGEX = 'Regex'; - /** @var string */ public string $Name = ''; - /** @var bool */ public bool $Present = false; - /** @var string */ public string $Exact = ''; - /** @var string */ public string $Regex = ''; - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return ServiceRouteHTTPMatchQueryParam - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return bool - */ public function isPresent(): bool { return $this->Present; } - /** - * @param bool $Present - * @return ServiceRouteHTTPMatchQueryParam - */ public function setPresent(bool $Present): self { $this->Present = $Present; return $this; } - /** - * @return string - */ public function getExact(): string { return $this->Exact; } - /** - * @param string $Exact - * @return ServiceRouteHTTPMatchQueryParam - */ public function setExact(string $Exact): self { $this->Exact = $Exact; return $this; } - /** - * @return string - */ public function getRegex(): string { return $this->Regex; } - /** - * @param string $Regex - * @return ServiceRouteHTTPMatchQueryParam - */ public function setRegex(string $Regex): self { $this->Regex = $Regex; diff --git a/src/ConfigEntry/ServiceRouteMatch.php b/src/ConfigEntry/ServiceRouteMatch.php index 65a8aae1..dfb7f5d6 100644 --- a/src/ConfigEntry/ServiceRouteMatch.php +++ b/src/ConfigEntry/ServiceRouteMatch.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceRouteMatch - */ class ServiceRouteMatch extends AbstractModel { protected const FIELDS = [ @@ -39,21 +36,13 @@ class ServiceRouteMatch extends AbstractModel private const FIELD_HTTP = 'HTTP'; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\ServiceRouteHTTPMatch|null */ public ?ServiceRouteHTTPMatch $HTTP = null; - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ServiceRouteHTTPMatch|null - */ public function getHTTP(): ?ServiceRouteHTTPMatch { return $this->HTTP; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\ServiceRouteHTTPMatch|null $HTTP - * @return ServiceRouteMatch - */ public function setHTTP(?ServiceRouteHTTPMatch $HTTP): self { $this->HTTP = $HTTP; diff --git a/src/ConfigEntry/ServiceRouterConfigEntry.php b/src/ConfigEntry/ServiceRouterConfigEntry.php index cedc14fd..5ae2d93c 100644 --- a/src/ConfigEntry/ServiceRouterConfigEntry.php +++ b/src/ConfigEntry/ServiceRouterConfigEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceRouterConfigEntry - */ class ServiceRouterConfigEntry extends AbstractModel implements ConfigEntry { use ConfigEntryTrait; @@ -41,21 +38,13 @@ class ServiceRouterConfigEntry extends AbstractModel implements ConfigEntry private const FIELD_ROUTES = 'Routes'; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\ServiceRoute[] */ public array $Routes = []; - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ServiceRoute[] - */ public function getRoutes(): array { return $this->Routes; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\ServiceRoute[] $Routes - * @return ServiceRouterConfigEntry - */ public function setRoutes(array $Routes): self { $this->Routes = $Routes; diff --git a/src/ConfigEntry/ServiceSplit.php b/src/ConfigEntry/ServiceSplit.php index ad790b40..96319b07 100644 --- a/src/ConfigEntry/ServiceSplit.php +++ b/src/ConfigEntry/ServiceSplit.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceSplit - */ class ServiceSplit extends AbstractModel { protected const FIELDS = [ @@ -38,81 +35,49 @@ class ServiceSplit extends AbstractModel private const FIELD_SERVICE_SUBSET = 'ServiceSubset'; private const FIELD_NAMESPACE = 'Namespace'; - /** @var float */ public float $Weight = 0.0; - /** @var string */ public string $Service = ''; - /** @var string */ public string $ServiceSubset = ''; - /** @var string */ public string $Namespace = ''; - /** - * @return float - */ public function getWeight(): float { return $this->Weight; } - /** - * @param float $Weight - * @return ServiceSplit - */ public function setWeight(float $Weight): self { $this->Weight = $Weight; return $this; } - /** - * @return string - */ public function getService(): string { return $this->Service; } - /** - * @param string $Service - * @return ServiceSplit - */ public function setService(string $Service): self { $this->Service = $Service; return $this; } - /** - * @return string - */ public function getServiceSubset(): string { return $this->ServiceSubset; } - /** - * @param string $ServiceSubset - * @return ServiceSplit - */ public function setServiceSubset(string $ServiceSubset): self { $this->ServiceSubset = $ServiceSubset; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return ServiceSplit - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; diff --git a/src/ConfigEntry/ServiceSplitterConfigEntry.php b/src/ConfigEntry/ServiceSplitterConfigEntry.php index da83e6bb..b821f2cb 100644 --- a/src/ConfigEntry/ServiceSplitterConfigEntry.php +++ b/src/ConfigEntry/ServiceSplitterConfigEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceSplitterConfigEntry - */ class ServiceSplitterConfigEntry extends AbstractModel implements ConfigEntry { use ConfigEntryTrait; @@ -41,21 +38,13 @@ class ServiceSplitterConfigEntry extends AbstractModel implements ConfigEntry private const FIELD_SPLITS = 'Splits'; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\ServiceSplit[] */ public array $Splits = []; - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\ServiceSplit[] - */ public function getSplits(): array { return $this->Splits; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\ServiceSplit[] $Splits - * @return ServiceSplitterConfigEntry - */ public function setSplits(array $Splits): self { $this->Splits = $Splits; diff --git a/src/ConfigEntry/TransparentProxyConfig.php b/src/ConfigEntry/TransparentProxyConfig.php index d1c23664..0f6d5b30 100644 --- a/src/ConfigEntry/TransparentProxyConfig.php +++ b/src/ConfigEntry/TransparentProxyConfig.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class TransparentProxyConfig - */ class TransparentProxyConfig extends AbstractModel { protected const FIELDS = [ @@ -36,41 +33,25 @@ class TransparentProxyConfig extends AbstractModel private const FIELD_OUTBOUND_LISTENER_PORT = 'OutboundListenerPort'; private const FIELD_DIALED_DIRECTLY = 'DialedDirectly'; - /** @var int */ public int $OutboundListenerPort = 0; - /** @var bool */ public bool $DialedDirectly = false; - /** - * @return int - */ public function getOutboundListenerPort(): int { return $this->OutboundListenerPort; } - /** - * @param int $OutboundListenerPort - * @return TransparentProxyConfig - */ public function setOutboundListenerPort(int $OutboundListenerPort): self { $this->OutboundListenerPort = $OutboundListenerPort; return $this; } - /** - * @return bool - */ public function isDialedDirectly(): bool { return $this->DialedDirectly; } - /** - * @param bool $DialedDirectly - * @return TransparentProxyConfig - */ public function setDialedDirectly(bool $DialedDirectly): self { $this->DialedDirectly = $DialedDirectly; diff --git a/src/ConfigEntry/UpstreamConfiguration.php b/src/ConfigEntry/UpstreamConfiguration.php index 095e44c1..7aa0b584 100644 --- a/src/ConfigEntry/UpstreamConfiguration.php +++ b/src/ConfigEntry/UpstreamConfiguration.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class UpstreamConfiguration - */ class UpstreamConfiguration extends AbstractModel { protected const FIELDS = [ @@ -65,181 +62,109 @@ class UpstreamConfiguration extends AbstractModel private const FIELD_PASSIVE_HEALTH_CHECK = 'PassiveHealthCheck'; private const FIELD_MESH_GATEWAY = 'MeshGateway'; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Namespace = ''; - /** @var string */ public string $EnvoyListenerJSON = ''; - /** @var string */ public string $EnvoyClusterJSON = ''; - /** @var string */ public string $Protocol = ''; - /** @var int */ public int $ConnectTimeoutMs = 0; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\UpstreamLimits|null */ public ?UpstreamLimits $UpstreamLimits = null; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\PassiveHealthCheck|null */ public ?PassiveHealthCheck $PassiveHealthCheck = null; - /** @var \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig|null */ public ?MeshGatewayConfig $MeshGateway = null; - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return UpstreamConfiguration - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return UpstreamConfiguration - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return string - */ public function getEnvoyListenerJSON(): string { return $this->EnvoyListenerJSON; } - /** - * @param string $EnvoyListenerJSON - * @return UpstreamConfiguration - */ public function setEnvoyListenerJSON(string $EnvoyListenerJSON): self { $this->EnvoyListenerJSON = $EnvoyListenerJSON; return $this; } - /** - * @return string - */ public function getEnvoyClusterJSON(): string { return $this->EnvoyClusterJSON; } - /** - * @param string $EnvoyClusterJSON - * @return UpstreamConfiguration - */ public function setEnvoyClusterJSON(string $EnvoyClusterJSON): self { $this->EnvoyClusterJSON = $EnvoyClusterJSON; return $this; } - /** - * @return string - */ public function getProtocol(): string { return $this->Protocol; } - /** - * @param string $Protocol - * @return UpstreamConfiguration - */ public function setProtocol(string $Protocol): self { $this->Protocol = $Protocol; return $this; } - /** - * @return int - */ public function getConnectTimeoutMs(): int { return $this->ConnectTimeoutMs; } - /** - * @param int $ConnectTimeoutMs - * @return UpstreamConfiguration - */ public function setConnectTimeoutMs(int $ConnectTimeoutMs): self { $this->ConnectTimeoutMs = $ConnectTimeoutMs; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\UpstreamLimits|null - */ public function getUpstreamLimits(): ?UpstreamLimits { return $this->UpstreamLimits; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\UpstreamLimits|null $UpstreamLimits - * @return UpstreamConfiguration - */ public function setUpstreamLimits(?UpstreamLimits $UpstreamLimits): self { $this->UpstreamLimits = $UpstreamLimits; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\PassiveHealthCheck|null - */ public function getPassiveHealthCheck(): ?PassiveHealthCheck { return $this->PassiveHealthCheck; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\PassiveHealthCheck|null $PassiveHealthCheck - * @return UpstreamConfiguration - */ public function setPassiveHealthCheck(?PassiveHealthCheck $PassiveHealthCheck): self { $this->PassiveHealthCheck = $PassiveHealthCheck; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig|null - */ public function getMeshGateway(): ?MeshGatewayConfig { return $this->MeshGateway; } - /** - * @param \DCarbone\PHPConsulAPI\ConfigEntry\MeshGatewayConfig|null $MeshGateway - * @return UpstreamConfiguration - */ public function setMeshGateway(?MeshGatewayConfig $MeshGateway): self { $this->MeshGateway = $MeshGateway; diff --git a/src/ConfigEntry/UpstreamLimits.php b/src/ConfigEntry/UpstreamLimits.php index c606cc63..10868d89 100644 --- a/src/ConfigEntry/UpstreamLimits.php +++ b/src/ConfigEntry/UpstreamLimits.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\ConfigEntry; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class UpstreamLimits - */ class UpstreamLimits extends AbstractModel { protected const FIELDS = [ @@ -44,61 +41,37 @@ class UpstreamLimits extends AbstractModel private const FIELD_MAX_PENDING_REQUESTS = 'MaxPendingRequests'; private const FIELD_MAX_CONCURRENT_REQUESTS = 'MaxConcurrentRequests'; - /** @var int|null */ public ?int $MaxConnections = null; - /** @var int|null */ public ?int $MaxPendingRequests = null; - /** @var int|null */ public ?int $MaxConcurrentRequests = null; - /** - * @return int|null - */ public function getMaxConnections(): ?int { return $this->MaxConnections; } - /** - * @param int|null $MaxConnections - * @return UpstreamLimits - */ public function setMaxConnections(?int $MaxConnections): self { $this->MaxConnections = $MaxConnections; return $this; } - /** - * @return int|null - */ public function getMaxPendingRequests(): ?int { return $this->MaxPendingRequests; } - /** - * @param int|null $MaxPendingRequests - * @return UpstreamLimits - */ public function setMaxPendingRequests(?int $MaxPendingRequests): self { $this->MaxPendingRequests = $MaxPendingRequests; return $this; } - /** - * @return int|null - */ public function getMaxConcurrentRequests(): ?int { return $this->MaxConcurrentRequests; } - /** - * @param int|null $MaxConcurrentRequests - * @return UpstreamLimits - */ public function setMaxConcurrentRequests(?int $MaxConcurrentRequests): self { $this->MaxConcurrentRequests = $MaxConcurrentRequests; diff --git a/src/Consul.php b/src/Consul.php index e3522542..0f1725fa 100644 --- a/src/Consul.php +++ b/src/Consul.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -32,9 +32,6 @@ use DCarbone\PHPConsulAPI\Session\SessionClient; use DCarbone\PHPConsulAPI\Status\StatusClient; -/** - * Class Consul - */ class Consul { // "public" constants @@ -145,33 +142,18 @@ class Consul public const _headerConsulTranslateAddresses = self::_headerConsulPrefix . 'Translate-Addresses'; public const _headerCache = 'X-Cache'; - /** @var \DCarbone\PHPConsulAPI\ACL\ACLClient */ public ACLClient $ACL; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentClient */ public AgentClient $Agent; - /** @var \DCarbone\PHPConsulAPI\Catalog\CatalogClient */ public CatalogClient $Catalog; - /** @var \DCarbone\PHPConsulAPI\Coordinate\CoordinateClient */ public CoordinateClient $Coordinate; - /** @var \DCarbone\PHPConsulAPI\Event\EventClient */ public EventClient $Event; - /** @var \DCarbone\PHPConsulAPI\Health\HealthClient */ public HealthClient $Health; - /** @var \DCarbone\PHPConsulAPI\KV\KVClient */ public KVClient $KV; - /** @var \DCarbone\PHPConsulAPI\Operator\OperatorClient */ public OperatorClient $Operator; - /** @var \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryClient */ public PreparedQueryClient $PreparedQuery; - /** @var \DCarbone\PHPConsulAPI\Session\SessionClient */ public SessionClient $Session; - /** @var \DCarbone\PHPConsulAPI\Status\StatusClient */ public StatusClient $Status; - /** - * Client constructor. - * @param \DCarbone\PHPConsulAPI\Config|null $config - */ public function __construct(Config $config = null) { $config = Config::merge($config); @@ -204,89 +186,56 @@ public function __construct(Config $config = null) $this->Status = new StatusClient($config); } - /** - * @return \DCarbone\PHPConsulAPI\ACL\ACLClient - */ public function ACL(): ACLClient { return $this->ACL; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentClient - */ public function Agent(): AgentClient { return $this->Agent; } - /** - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogClient - */ public function Catalog(): CatalogClient { return $this->Catalog; } - /** - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateClient - */ public function Coordinate(): CoordinateClient { return $this->Coordinate; } - /** - * @return \DCarbone\PHPConsulAPI\Event\EventClient - */ public function Event(): EventClient { return $this->Event; } - /** - * @return \DCarbone\PHPConsulAPI\Health\HealthClient - */ public function Health(): HealthClient { return $this->Health; } - /** - * @return \DCarbone\PHPConsulAPI\KV\KVClient - */ public function KV(): KVClient { return $this->KV; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\OperatorClient - */ public function Operator(): OperatorClient { return $this->Operator; } - /** - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryClient - */ public function PreparedQuery(): PreparedQueryClient { return $this->PreparedQuery; } - /** - * @return \DCarbone\PHPConsulAPI\Session\SessionClient - */ public function Session(): SessionClient { return $this->Session; } - /** - * @return \DCarbone\PHPConsulAPI\Status\StatusClient - */ public function Status(): StatusClient { return $this->Status; diff --git a/src/Coordinate/Coordinate.php b/src/Coordinate/Coordinate.php index e23c9d4c..5ccb6a58 100644 --- a/src/Coordinate/Coordinate.php +++ b/src/Coordinate/Coordinate.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Coordinate; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -30,19 +30,11 @@ */ class Coordinate extends AbstractModel { - /** @var int[] */ public array $Vec = []; - /** @var float */ public float $Error = 0.0; - /** @var float */ public float $Adjustment = 0.0; - /** @var float */ public float $Height = 0.0; - /** - * Coordinate constructor. - * @param array|\DCarbone\PHPConsulAPI\Coordinate\CoordinateConfig $data - */ public function __construct($data = []) { if (\is_array($data)) { @@ -64,33 +56,21 @@ public function __construct($data = []) } } - /** - * @return int[] - */ public function getVec(): array { return $this->Vec; } - /** - * @return float - */ public function getError(): float { return $this->Error; } - /** - * @return float - */ public function getAdjustment(): float { return $this->Adjustment; } - /** - * @return float - */ public function getHeight(): float { return $this->Height; @@ -106,9 +86,6 @@ public function Clone(): Coordinate|static return clone $this; } - /** - * @return bool - */ public function IsValid(): bool { foreach ($this->Vec as $vec) { @@ -119,21 +96,11 @@ public function IsValid(): bool return is_finite($this->Error) && is_finite($this->Adjustment) && is_finite($this->Height); } - /** - * @param \DCarbone\PHPConsulAPI\Coordinate\Coordinate $other - * @return bool - */ public function IsCompatibleWith(self $other): bool { return \count($this->Vec) === \count($other->Vec); } - /** - * @param \DCarbone\PHPConsulAPI\Coordinate\CoordinateConfig $config - * @param float $force - * @param \DCarbone\PHPConsulAPI\Coordinate\Coordinate $other - * @return \DCarbone\PHPConsulAPI\Coordinate\Coordinate - */ public function ApplyForce(CoordinateConfig $config, float $force, self $other): self { if (!$this->IsCompatibleWith($other)) { @@ -150,10 +117,6 @@ public function ApplyForce(CoordinateConfig $config, float $force, self $other): return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\Coordinate\Coordinate $other - * @return \DCarbone\Go\Time\Duration - */ public function DistanceTo(self $other): Time\Duration { static $secondsToNanoseconds = 1.0e9; @@ -170,10 +133,6 @@ public function DistanceTo(self $other): Time\Duration return Time::Duration($dist * $secondsToNanoseconds); } - /** - * @param \DCarbone\PHPConsulAPI\Coordinate\Coordinate $other - * @return float - */ protected function rawDistanceTo(self $other): float { return magnitude(diff($this->Vec, $other->Vec)) + $this->Height + $other->Height; diff --git a/src/Coordinate/CoordinateClient.php b/src/Coordinate/CoordinateClient.php index af55b676..42aed10e 100644 --- a/src/Coordinate/CoordinateClient.php +++ b/src/Coordinate/CoordinateClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Coordinate; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,16 +26,8 @@ use DCarbone\PHPConsulAPI\WriteOptions; use DCarbone\PHPConsulAPI\WriteResponse; -/** - * Class CoordinateClient - */ class CoordinateClient extends AbstractClient { - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateDatacentersResponse - */ public function Datacenters(): CoordinateDatacentersResponse { $resp = $this->_requireOK($this->_doGet('v1/coordinate/datacenters', null)); @@ -44,12 +36,6 @@ public function Datacenters(): CoordinateDatacentersResponse return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateEntriesResponse - */ public function Nodes(?QueryOptions $opts = null): CoordinateEntriesResponse { $resp = $this->_requireOK($this->_doGet('v1/coordinate/nodes', $opts)); @@ -58,24 +44,11 @@ public function Nodes(?QueryOptions $opts = null): CoordinateEntriesResponse return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\Coordinate\CoordinateEntry $coordinateEntry - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Update(CoordinateEntry $coordinateEntry, ?WriteOptions $opts = null): WriteResponse { return $this->_executePut('v1/coordinate/update', $coordinateEntry, $opts); } - /** - * @param string $node - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateEntriesResponse - */ public function Node(string $node, ?QueryOptions $opts = null): CoordinateEntriesResponse { $resp = $this->_requireOK($this->_doGet(sprintf('v1/coordinate/node/%s', $node), $opts)); diff --git a/src/Coordinate/CoordinateConfig.php b/src/Coordinate/CoordinateConfig.php index 2a7c1b2f..9ec4d450 100644 --- a/src/Coordinate/CoordinateConfig.php +++ b/src/Coordinate/CoordinateConfig.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Coordinate; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,9 +22,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class CoordinateConfig - */ class CoordinateConfig extends AbstractModel { public const DefaultDimensionality = 8; @@ -36,26 +33,15 @@ class CoordinateConfig extends AbstractModel public const DefaultLatencyFilterSize = 3; public const DefaultGravityRho = 150.0; - /** @var int */ public int $Dimensionality = 0; - /** @var float */ public float $VivaldiErrorMax = 0.0; - /** @var float */ public float $VivaldiCE = 0.0; - /** @var float */ public float $VivaldiCC = 0.0; - /** @var int */ public int $AdjustmentWindowSize = 0; - /** @var float */ public float $HeightMin = 0.0; - /** @var int */ public int $LatencyFilterSize = 0; - /** @var float */ public float $GravityRho = 0.0; - /** - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateConfig - */ public static function Default(): self { return new static( @@ -72,144 +58,88 @@ public static function Default(): self ); } - /** - * @return int - */ public function getDimensionality(): int { return $this->Dimensionality; } - /** - * @param int $dimensionality - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateConfig - */ public function setDimensionality(int $dimensionality): self { $this->Dimensionality = $dimensionality; return $this; } - /** - * @return float - */ public function getVivaldiErrorMax(): float { return $this->VivaldiErrorMax; } - /** - * @param float $vivaldiErrorMax - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateConfig - */ public function setVivaldiErrorMax(float $vivaldiErrorMax): self { $this->VivaldiErrorMax = $vivaldiErrorMax; return $this; } - /** - * @return float - */ public function getVivaldiCE(): float { return $this->VivaldiCE; } - /** - * @param float $vivaldiCE - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateConfig - */ public function setVivaldiCE(float $vivaldiCE): self { $this->VivaldiCE = $vivaldiCE; return $this; } - /** - * @return float - */ public function getVivaldiCC(): float { return $this->VivaldiCC; } - /** - * @param float $vivaldiCC - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateConfig - */ public function setVivaldiCC(float $vivaldiCC): self { $this->VivaldiCC = $vivaldiCC; return $this; } - /** - * @return int - */ public function getAdjustmentWindowSize(): int { return $this->AdjustmentWindowSize; } - /** - * @param int $adjustmentWindowSize - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateConfig - */ public function setAdjustmentWindowSize(int $adjustmentWindowSize): self { $this->AdjustmentWindowSize = $adjustmentWindowSize; return $this; } - /** - * @return float - */ public function getHeightMin(): float { return $this->HeightMin; } - /** - * @param float $heightMin - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateConfig - */ public function setHeightMin(float $heightMin): self { $this->HeightMin = $heightMin; return $this; } - /** - * @return int - */ public function getLatencyFilterSize(): int { return $this->LatencyFilterSize; } - /** - * @param int $latencyFilterSize - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateConfig - */ public function setLatencyFilterSize(int $latencyFilterSize): self { $this->LatencyFilterSize = $latencyFilterSize; return $this; } - /** - * @return float - */ public function getGravityRho(): float { return $this->GravityRho; } - /** - * @param float $gravityRho - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateConfig - */ public function setGravityRho(float $gravityRho): self { $this->GravityRho = $gravityRho; diff --git a/src/Coordinate/CoordinateDatacenterMap.php b/src/Coordinate/CoordinateDatacenterMap.php index 3f1ceb8d..6cf83530 100644 --- a/src/Coordinate/CoordinateDatacenterMap.php +++ b/src/Coordinate/CoordinateDatacenterMap.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Coordinate; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class CoordinateDatacenterMap - */ class CoordinateDatacenterMap extends AbstractModel { protected const FIELDS = [ @@ -38,32 +35,20 @@ class CoordinateDatacenterMap extends AbstractModel private const FIELD_COORDINATES = 'Coordinates'; - /** @var string */ public string $Datacenter = ''; - /** @var string */ public string $AreaID = ''; - /** @var \DCarbone\PHPConsulAPI\Coordinate\Coordinate[] */ public array $Coordinates = []; - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @return string - */ public function getAreaID(): string { return $this->AreaID; } - /** - * @return \DCarbone\PHPConsulAPI\Coordinate\Coordinate[] - */ public function getCoordinates(): array { return $this->Coordinates; diff --git a/src/Coordinate/CoordinateDatacentersResponse.php b/src/Coordinate/CoordinateDatacentersResponse.php index 420c5caa..7953d3b4 100644 --- a/src/Coordinate/CoordinateDatacentersResponse.php +++ b/src/Coordinate/CoordinateDatacentersResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Coordinate; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class CoordinateDatacentersResponse - */ class CoordinateDatacentersResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Coordinate\CoordinateDatacenterMap[]|null */ public ?array $DatacenterMap = null; - /** - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateDatacenterMap[]|null - */ public function getValue(): ?array { return $this->DatacenterMap; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->DatacenterMap = []; diff --git a/src/Coordinate/CoordinateEntriesResponse.php b/src/Coordinate/CoordinateEntriesResponse.php index aaf4faa5..af95e426 100644 --- a/src/Coordinate/CoordinateEntriesResponse.php +++ b/src/Coordinate/CoordinateEntriesResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Coordinate; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class CoordinateEntriesResponse - */ class CoordinateEntriesResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Coordinate\CoordinateEntry[]|null */ public ?array $Nodes = null; - /** - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateEntry[]|null - */ public function getValue(): ?array { return $this->Nodes; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->Nodes = []; diff --git a/src/Coordinate/CoordinateEntry.php b/src/Coordinate/CoordinateEntry.php index ddbfdd34..d6503694 100644 --- a/src/Coordinate/CoordinateEntry.php +++ b/src/Coordinate/CoordinateEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Coordinate; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class CoordinateEntry - */ class CoordinateEntry extends AbstractModel { protected const FIELDS = [ @@ -38,61 +35,37 @@ class CoordinateEntry extends AbstractModel private const FIELD_COORDINATE = 'Coord'; - /** @var string */ public string $Node = ''; - /** @var string */ public string $Segment = ''; - /** @var \DCarbone\PHPConsulAPI\Coordinate\Coordinate|null */ public ?Coordinate $Coord = null; - /** - * @return string - */ public function getNode(): string { return $this->Node; } - /** - * @param string $Node - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateEntry - */ public function setNode(string $Node): self { $this->Node = $Node; return $this; } - /** - * @return string - */ public function getSegment(): string { return $this->Segment; } - /** - * @param string $Segment - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateEntry - */ public function setSegment(string $Segment): self { $this->Segment = $Segment; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Coordinate\Coordinate|null - */ public function getCoord(): ?Coordinate { return $this->Coord; } - /** - * @param \DCarbone\PHPConsulAPI\Coordinate\Coordinate|null $Coord - * @return \DCarbone\PHPConsulAPI\Coordinate\CoordinateEntry - */ public function setCoord(?Coordinate $Coord): self { $this->Coord = $Coord; diff --git a/src/Coordinate/DimensionalityConflictException.php b/src/Coordinate/DimensionalityConflictException.php index 782bd634..01fdaf39 100644 --- a/src/Coordinate/DimensionalityConflictException.php +++ b/src/Coordinate/DimensionalityConflictException.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Coordinate; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,19 +20,10 @@ limitations under the License. */ -/** - * Class DimensionalityConflictException - */ class DimensionalityConflictException extends \DomainException { public const DefaultMessage = 'coordinate dimensionality does not match'; - /** - * DimensionalityConflictException constructor. - * @param string $message - * @param int $code - * @param \Throwable|null $previous - */ public function __construct(string $message = '', int $code = 0, \Throwable $previous = null) { parent::__construct('' === $message ? static::DefaultMessage : $message, $code, $previous); diff --git a/src/Coordinate/funcs.php b/src/Coordinate/funcs.php index ce3a24d4..88d0eadd 100644 --- a/src/Coordinate/funcs.php +++ b/src/Coordinate/funcs.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Coordinate; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -81,11 +81,6 @@ function diff(array $vec1, array $vec2): array return $ret; } -/** - * @param array $vec - * @param float $factor - * @return array - */ function mul(array $vec, float $factor): array { $ret = []; @@ -95,10 +90,6 @@ function mul(array $vec, float $factor): array return $ret; } -/** - * @param array $vec - * @return float - */ function magnitude(array $vec): float { $sum = 0.0; diff --git a/src/Debug/DebugClient.php b/src/Debug/DebugClient.php index e2221b90..a96f89aa 100644 --- a/src/Debug/DebugClient.php +++ b/src/Debug/DebugClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Debug; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,16 +25,8 @@ use DCarbone\PHPConsulAPI\Error; use DCarbone\PHPConsulAPI\ValuedStringResponse; -/** - * Class DebugClient - */ class DebugClient extends AbstractClient { - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedStringResponse - */ public function Heap(): ValuedStringResponse { $ret = new ValuedStringResponse(); @@ -50,12 +42,6 @@ public function Heap(): ValuedStringResponse return $ret; } - /** - * @param int $seconds - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedStringResponse - */ public function Profile(int $seconds): ValuedStringResponse { $ret = new ValuedStringResponse(); @@ -74,12 +60,6 @@ public function Profile(int $seconds): ValuedStringResponse return $ret; } - /** - * @param int $seconds - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedStringResponse - */ public function Trace(int $seconds): ValuedStringResponse { $ret = new ValuedStringResponse(); @@ -98,11 +78,6 @@ public function Trace(int $seconds): ValuedStringResponse return $ret; } - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedStringResponse - */ public function Goroutine(): ValuedStringResponse { $ret = new ValuedStringResponse(); diff --git a/src/DecodedBody.php b/src/DecodedBody.php index 1ee0f6bf..da120b52 100644 --- a/src/DecodedBody.php +++ b/src/DecodedBody.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,30 +20,18 @@ limitations under the License. */ -/** - * Class DecodedBody - */ final class DecodedBody { use ErrorContainer; - /** @var mixed */ public mixed $Decoded = null; - /** - * DecodedBody constructor. - * @param mixed $decoded - * @param \DCarbone\PHPConsulAPI\Error|null $err - */ public function __construct(mixed $decoded, ?Error $err) { $this->Decoded = $decoded; $this->Err = $err; } - /** - * @return mixed - */ public function getDecoded(): mixed { return $this->Decoded; diff --git a/src/Error.php b/src/Error.php index 265db498..ce2cd9d8 100644 --- a/src/Error.php +++ b/src/Error.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -32,28 +32,16 @@ class Error implements \JsonSerializable private const FIELD_MESSAGE = 'message'; private const FIELD_TIMESTAMP = 'timestamp'; - /** @var \DCarbone\Go\Time\Time */ private Time\Time $time; - /** @var string */ private string $message; - /** - * Error constructor. - * @param string $message - * @throws \Exception - */ public function __construct(string $message) { $this->time = Time::Now(); $this->message = $message; } - /** - * @param \DCarbone\PHPConsulAPI\RequestResponse $resp - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Error - */ public static function unexpectedResponseCodeError(RequestResponse $resp): self { return new static( @@ -66,25 +54,16 @@ public static function unexpectedResponseCodeError(RequestResponse $resp): self ); } - /** - * @return \DCarbone\Go\Time\Time - */ public function getTime(): Time\Time { return $this->time; } - /** - * @return string - */ public function getMessage(): string { return $this->message; } - /** - * @return array - */ public function jsonSerialize(): array { return [ @@ -93,9 +72,6 @@ public function jsonSerialize(): array ]; } - /** - * @return string - */ public function __toString(): string { return $this->message; diff --git a/src/ErrorContainer.php b/src/ErrorContainer.php index 7bec9edc..0eb20750 100644 --- a/src/ErrorContainer.php +++ b/src/ErrorContainer.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,17 +20,10 @@ limitations under the License. */ -/** - * Trait ErrorContainer - */ trait ErrorContainer { - /** @var \DCarbone\PHPConsulAPI\Error|null */ public ?Error $Err = null; - /** - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function getErr(): ?Error { return $this->Err; diff --git a/src/Event/EventClient.php b/src/Event/EventClient.php index 6d0f1f58..aa76bed0 100644 --- a/src/Event/EventClient.php +++ b/src/Event/EventClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Event; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,18 +24,8 @@ use DCarbone\PHPConsulAPI\QueryOptions; use DCarbone\PHPConsulAPI\WriteOptions; -/** - * Class EventClient - */ class EventClient extends AbstractClient { - /** - * @param \DCarbone\PHPConsulAPI\Event\UserEvent $event - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Event\UserEventResponse - */ public function Fire(UserEvent $event, ?WriteOptions $opts = null): UserEventResponse { $r = $this->_newPutRequest(sprintf('v1/event/fire/%s', $event->Name), '' !== $event->Payload ? $event->Payload : null, $opts); @@ -54,13 +44,6 @@ public function Fire(UserEvent $event, ?WriteOptions $opts = null): UserEventRes return $ret; } - /** - * @param string $name - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Event\UserEventsResponse - */ public function List(string $name = '', ?QueryOptions $opts = null): UserEventsResponse { $r = $this->_newGetRequest('v1/event/list', $opts); @@ -73,10 +56,6 @@ public function List(string $name = '', ?QueryOptions $opts = null): UserEventsR return $ret; } - /** - * @param string $uuid - * @return int - */ public function IDToIndex(string $uuid): int { if (36 !== \strlen($uuid)) { diff --git a/src/Event/UserEvent.php b/src/Event/UserEvent.php index 1e6d5b81..ae640733 100644 --- a/src/Event/UserEvent.php +++ b/src/Event/UserEvent.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Event; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,26 +22,15 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class UserEvent - */ class UserEvent extends AbstractModel { - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Payload = ''; - /** @var string */ public string $NodeFilter = ''; - /** @var string */ public string $ServiceFilter = ''; - /** @var string */ public string $TagFilter = ''; - /** @var int */ public int $Version = 0; - /** @var int */ public int $LTime = 0; /** @@ -62,65 +51,41 @@ public function __construct(array $data = [], bool $_decodeValue = false) } } - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @return string - */ public function getPayload(): string { return $this->Payload; } - /** - * @return string - */ public function getNodeFilter(): string { return $this->NodeFilter; } - /** - * @return string - */ public function getServiceFilter(): string { return $this->ServiceFilter; } - /** - * @return string - */ public function getTagFilter(): string { return $this->TagFilter; } - /** - * @return int - */ public function getVersion(): int { return $this->Version; } - /** - * @return int - */ public function getLTime(): int { return $this->LTime; diff --git a/src/Event/UserEventResponse.php b/src/Event/UserEventResponse.php index 3ec5a165..1b854d71 100644 --- a/src/Event/UserEventResponse.php +++ b/src/Event/UserEventResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Event; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedWriteResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class UserEventResponse - */ class UserEventResponse extends AbstractValuedWriteResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Event\UserEvent|null */ public ?UserEvent $UserEvent = null; - /** - * @return \DCarbone\PHPConsulAPI\Event\UserEvent|null - */ public function getValue(): ?UserEvent { return $this->UserEvent; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->UserEvent = new UserEvent((array)$decodedData); diff --git a/src/Event/UserEventsResponse.php b/src/Event/UserEventsResponse.php index 6a62c5b8..b9eb5f61 100644 --- a/src/Event/UserEventsResponse.php +++ b/src/Event/UserEventsResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Event; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class UserEventsResponse - */ class UserEventsResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Event\UserEvent[]|null */ public ?array $UserEvents = null; - /** - * @return \DCarbone\PHPConsulAPI\Event\UserEvent[]|null - */ public function getValue(): ?array { return $this->UserEvents; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->UserEvents = []; diff --git a/src/FakeMap.php b/src/FakeMap.php index ac730a0b..5376a1b2 100644 --- a/src/FakeMap.php +++ b/src/FakeMap.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,18 +20,10 @@ limitations under the License. */ -/** - * Class FakeMap - */ class FakeMap extends \ArrayIterator implements \ArrayAccess, \Countable, \Iterator, \JsonSerializable { - /** @var array */ private array $_map = []; - /** - * Map constructor. - * @param array|null $data - */ public function __construct(?array $data) { if (null === $data || [] === $data) { @@ -40,10 +32,6 @@ public function __construct(?array $data) $this->_map = $data; } - /** - * @param array|\DCarbone\PHPConsulAPI\FakeMap|\stdClass|null $input - * @return \DCarbone\PHPConsulAPI\FakeMap|null - */ public static function parse(array|FakeMap|\stdClass|null $input): ?self { if (null === $input) { @@ -63,9 +51,6 @@ public static function parse(array|FakeMap|\stdClass|null $input): ?self ); } - /** - * @return mixed - */ public function current(): mixed { return current($this->_map); @@ -76,17 +61,11 @@ public function next(): void next($this->_map); } - /** - * @return int|string|null - */ public function key(): int|string|null { return key($this->_map); } - /** - * @return bool - */ public function valid(): bool { return null !== key($this->_map); @@ -97,52 +76,31 @@ public function rewind(): void reset($this->_map); } - /** - * @param mixed $offset - * @return bool - */ public function offsetExists(mixed $offset): bool { return isset($this->_map[$offset]) || \array_key_exists($offset, $this->_map); } - /** - * @param mixed $offset - * @return mixed - */ public function offsetGet(mixed $offset): mixed { return $this->_map[$offset] ?? null; } - /** - * @param mixed $offset - * @param mixed $value - */ public function offsetSet(mixed $offset, mixed $value): void { $this->_map[$offset] = $value; } - /** - * @param mixed $offset - */ public function offsetUnset(mixed $offset): void { unset($this->_map[$offset]); } - /** - * @return int - */ public function count(): int { return \count($this->_map); } - /** - * @return object - */ public function jsonSerialize(): object { return (object)$this->getArrayCopy(); diff --git a/src/FakeSlice.php b/src/FakeSlice.php index 2a59fd35..255bdf4d 100644 --- a/src/FakeSlice.php +++ b/src/FakeSlice.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,24 +20,14 @@ limitations under the License. */ -/** - * Class FakeSlice - */ abstract class FakeSlice implements \Iterator, \ArrayAccess, \Countable, \JsonSerializable { - /** @var string */ protected string $containedClass; - /** @var \DCarbone\PHPConsulAPI\AbstractModel[] */ private array $_list = []; - /** @var int */ private int $_size = 0; - /** - * AbstractModels constructor. - * @param array|null $children - */ public function __construct(?array $children = []) { if (!isset($this->containedClass)) { @@ -57,9 +47,6 @@ public function __construct(?array $children = []) } } - /** - * @param array|\DCarbone\PHPConsulAPI\AbstractModel|null $value - */ public function append(array|AbstractModel|null $value): void { // validate provided value is either null or instance of allowed child class @@ -72,9 +59,6 @@ public function append(array|AbstractModel|null $value): void $this->_list[$offset] = $value; } - /** - * @return \DCarbone\PHPConsulAPI\AbstractModel|false - */ public function current(): bool|AbstractModel { return current($this->_list); @@ -85,17 +69,11 @@ public function next(): void next($this->_list); } - /** - * @return int|null - */ public function key(): ?int { return key($this->_list); } - /** - * @return bool - */ public function valid(): bool { return null !== key($this->_list); @@ -106,29 +84,17 @@ public function rewind(): void reset($this->_list); } - /** - * @param mixed $offset - * @return bool - */ public function offsetExists(mixed $offset): bool { return \is_int($offset) && isset($this->_list[$offset]); } - /** - * @param mixed $offset - * @return \DCarbone\PHPConsulAPI\AbstractModel|null - */ public function offsetGet(mixed $offset): ?AbstractModel { $this->_validateOffset($offset); return $this->_list[$offset]; } - /** - * @param mixed $offset - * @param mixed $value - */ public function offsetSet(mixed $offset, mixed $value): void { // if incoming offset is null, assume [] (append) operation. @@ -144,9 +110,6 @@ public function offsetSet(mixed $offset, mixed $value): void $this->_list[$offset] = $this->_validateValue($value); } - /** - * @param mixed $offset - */ public function offsetUnset(mixed $offset): void { // validate provided offset value @@ -156,17 +119,11 @@ public function offsetUnset(mixed $offset): void $this->_list[$offset] = null; } - /** - * @return int - */ public function count(): int { return $this->_size; } - /** - * @return \DCarbone\PHPConsulAPI\AbstractModel[] - */ public function jsonSerialize(): array { if (0 === $this->_size) { @@ -184,15 +141,8 @@ public function jsonSerialize(): array return $out; } - /** - * @param array $data - * @return \DCarbone\PHPConsulAPI\AbstractModel - */ abstract protected function newChild(array $data): AbstractModel; - /** - * @param mixed $offset - */ private function _validateOffset(mixed $offset): void { if (!\is_int($offset)) { @@ -209,10 +159,6 @@ private function _validateOffset(mixed $offset): void } } - /** - * @param mixed $value - * @return \DCarbone\PHPConsulAPI\AbstractModel|null - */ private function _validateValue(mixed $value): ?AbstractModel { // fast path for null values diff --git a/src/HasSettableStringTags.php b/src/HasSettableStringTags.php index 680908ae..c617b70d 100644 --- a/src/HasSettableStringTags.php +++ b/src/HasSettableStringTags.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,25 +20,14 @@ limitations under the License. */ -/** - * Class HasSettableStringTags - */ trait HasSettableStringTags { - /** - * @param array $tags - * @return $this - */ public function setTags(array $tags): static { $this->Tags = $tags; return $this; } - /** - * @param string $tag - * @return $this - */ public function addTag(string $tag): static { $this->Tags[] = $tag; diff --git a/src/HasStringTags.php b/src/HasStringTags.php index 290874c4..9546a477 100644 --- a/src/HasStringTags.php +++ b/src/HasStringTags.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,17 +20,10 @@ limitations under the License. */ -/** - * Class HasStringTags - */ trait HasStringTags { - /** @var string[] */ public array $Tags = []; - /** - * @return string[] - */ public function getTags(): array { return $this->Tags; diff --git a/src/Health/HealthCheck.php b/src/Health/HealthCheck.php index 03dfb0a8..6b6e88c1 100644 --- a/src/Health/HealthCheck.php +++ b/src/Health/HealthCheck.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Health; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class HealthCheck - */ class HealthCheck extends AbstractModel { protected const FIELDS = [ @@ -39,39 +36,21 @@ class HealthCheck extends AbstractModel private const FIELD_NAMESPACE = 'Namespace'; private const FIELD_DEFINITION = 'Definition'; - /** @var string */ public string $Node = ''; - /** @var string */ public string $CheckID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Status = ''; - /** @var string */ public string $Notes = ''; - /** @var string */ public string $Output = ''; - /** @var string */ public string $ServiceID = ''; - /** @var string */ public string $ServiceName = ''; - /** @var string[] */ public array $ServiceTags = []; - /** @var string */ public string $Type = ''; - /** @var string */ public string $Namespace = ''; - /** @var \DCarbone\PHPConsulAPI\Health\HealthCheckDefinition */ public HealthCheckDefinition $Definition; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** - * HealthCheck constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -80,252 +59,154 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getNode(): string { return $this->Node; } - /** - * @param string $Node - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setNode(string $Node): self { $this->Node = $Node; return $this; } - /** - * @return string - */ public function getCheckID(): string { return $this->CheckID; } - /** - * @param string $CheckID - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setCheckID(string $CheckID): self { $this->CheckID = $CheckID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getStatus(): string { return $this->Status; } - /** - * @param string $Status - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setStatus(string $Status): self { $this->Status = $Status; return $this; } - /** - * @return string - */ public function getNotes(): string { return $this->Notes; } - /** - * @param string $Notes - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setNotes(string $Notes): self { $this->Notes = $Notes; return $this; } - /** - * @return string - */ public function getOutput(): string { return $this->Output; } - /** - * @param string $Output - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setOutput(string $Output): self { $this->Output = $Output; return $this; } - /** - * @return string - */ public function getServiceID(): string { return $this->ServiceID; } - /** - * @param string $ServiceID - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setServiceID(string $ServiceID): self { $this->ServiceID = $ServiceID; return $this; } - /** - * @return string - */ public function getServiceName(): string { return $this->ServiceName; } - /** - * @param string $ServiceName - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setServiceName(string $ServiceName): self { $this->ServiceName = $ServiceName; return $this; } - /** - * @return string[] - */ public function getServiceTags(): array { return $this->ServiceTags; } - /** - * @param string[] $ServiceTags - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setServiceTags(array $ServiceTags): self { $this->ServiceTags = $ServiceTags; return $this; } - /** - * @return string - */ public function getType(): string { return $this->Type; } - /** - * @param string $Type - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setType(string $Type): self { $this->Type = $Type; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Health\HealthCheckDefinition - */ public function getDefinition(): HealthCheckDefinition { return $this->Definition; } - /** - * @param \DCarbone\PHPConsulAPI\Health\HealthCheckDefinition $Definition - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setDefinition(HealthCheckDefinition $Definition): self { $this->Definition = $Definition; return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; diff --git a/src/Health/HealthCheckDefinition.php b/src/Health/HealthCheckDefinition.php index cd78638d..1c6a1e1e 100644 --- a/src/Health/HealthCheckDefinition.php +++ b/src/Health/HealthCheckDefinition.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Health; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,9 +26,6 @@ use DCarbone\PHPConsulAPI\Operator\ReadableDuration; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class HealthCheckDefinition - */ class HealthCheckDefinition extends AbstractModel implements \JsonSerializable { protected const FIELDS = [ @@ -68,45 +65,20 @@ class HealthCheckDefinition extends AbstractModel implements \JsonSerializable private const FIELD_TIMEOUT = 'Timeout'; private const FIELD_DEREGISTER_CRITICAL_SERVICE_AFTER = 'DeregisterCriticalServiceAfter'; - /** @var string */ public string $HTTP = ''; - /** @var array */ public array $Header = []; - /** @var string */ public string $Method = ''; - /** @var string */ public string $Body = ''; - /** @var bool */ public bool $TLSSkipVerify = false; - /** @var string */ public string $TCP = ''; - /** @var \DCarbone\Go\Time\Duration */ public Duration $IntervalDuration; - /** @var \DCarbone\Go\Time\Duration */ public Duration $TimeoutDuration; - /** @var \DCarbone\Go\Time\Duration */ public Duration $DeregisterCriticalServiceAfterDuration; - /** - * @var \DCarbone\PHPConsulAPI\Operator\ReadableDuration - * @deprecated use $IntervalDuration - */ public ReadableDuration $Interval; - /** - * @var \DCarbone\PHPConsulAPI\Operator\ReadableDuration - * @deprecated use $TimeoutDuration - */ public ReadableDuration $Timeout; - /** - * @var \DCarbone\PHPConsulAPI\Operator\ReadableDuration - * @deprecated use $DeregisterCriticalServiceAfterDuration - */ public ReadableDuration $DeregisterCriticalServiceAfter; - /** - * HealthCheckDefinition constructor. - * @param array|null $data - */ public function __construct(?array $data = null) { parent::__construct($data); @@ -141,107 +113,67 @@ public function __construct(?array $data = null) } } - /** - * @return string - */ public function getHTTP(): string { return $this->HTTP; } - /** - * @return array - */ public function getHeader(): array { return $this->Header; } - /** - * @return string - */ public function getMethod(): string { return $this->Method; } - /** - * @return string - */ public function getBody(): string { return $this->Body; } - /** - * @param string $Body - * @return \DCarbone\PHPConsulAPI\Health\HealthCheckDefinition - */ public function setBody(string $Body): self { $this->Body = $Body; return $this; } - /** - * @return bool - */ public function isTLSSkipVerify(): bool { return $this->TLSSkipVerify; } - /** - * @return string - */ public function getTCP(): string { return $this->TCP; } - /** - * @return \DCarbone\Go\Time\Duration|null - */ public function getIntervalDuration(): ?Duration { return $this->IntervalDuration; } - /** - * @return \DCarbone\Go\Time\Duration|null - */ public function getTimeoutDuration(): ?Duration { return $this->TimeoutDuration; } - /** - * @return \DCarbone\Go\Time\Duration|null - */ public function getDeregisterCriticalServiceAfterDuration(): ?Duration { return $this->DeregisterCriticalServiceAfterDuration; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null - */ public function getInterval(): ?ReadableDuration { return $this->Interval; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null - */ public function getTimeout(): ?ReadableDuration { return $this->Timeout; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null - */ public function getDeregisterCriticalServiceAfter(): ?ReadableDuration { return $this->DeregisterCriticalServiceAfter; diff --git a/src/Health/HealthChecks.php b/src/Health/HealthChecks.php index 1b96222a..f764dd26 100644 --- a/src/Health/HealthChecks.php +++ b/src/Health/HealthChecks.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Health; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,22 +24,14 @@ use DCarbone\PHPConsulAPI\Consul; use DCarbone\PHPConsulAPI\FakeSlice; -/** - * Class HealthChecks - */ class HealthChecks extends FakeSlice { - /** @var string */ protected string $containedClass = HealthCheck::class; - /** - * @return string - */ public function AggregatedStatus(): string { $passing = $warning = $critical = $maintenance = false; foreach ($this as $check) { - /** @var \DCarbone\PHPConsulAPI\Health\HealthCheck $check */ if (Consul::NodeMaint === $check->CheckID || 0 === strpos($check->CheckID, Consul::ServiceMaintPrefix)) { // TODO: Maybe just return maintenance right now...? $maintenance = true; @@ -76,10 +68,6 @@ public function AggregatedStatus(): string return Consul::HealthPassing; } - /** - * @param array $data - * @return \DCarbone\PHPConsulAPI\AbstractModel - */ protected function newChild(array $data): AbstractModel { return new HealthCheck($data); diff --git a/src/Health/HealthChecksResponse.php b/src/Health/HealthChecksResponse.php index 96d728d5..54852a40 100644 --- a/src/Health/HealthChecksResponse.php +++ b/src/Health/HealthChecksResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Health; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class HealthChecksResponse - */ class HealthChecksResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Health\HealthChecks|null */ public ?HealthChecks $HealthChecks = null; - /** - * @return \DCarbone\PHPConsulAPI\Health\HealthChecks|null - */ public function getValue(): ?HealthChecks { return $this->HealthChecks; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->HealthChecks = new HealthChecks((array)$decodedData); diff --git a/src/Health/HealthClient.php b/src/Health/HealthClient.php index e962a644..b7ff2704 100644 --- a/src/Health/HealthClient.php +++ b/src/Health/HealthClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Health; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,45 +24,22 @@ use DCarbone\PHPConsulAPI\Error; use DCarbone\PHPConsulAPI\QueryOptions; -/** - * Class HealthClient - */ class HealthClient extends AbstractClient { private const serviceHealth = 'service'; private const connectHealth = 'connect'; private const ingressHealth = 'ingress'; - /** - * @param string $node - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Health\HealthChecksResponse - */ public function Node(string $node, ?QueryOptions $opts = null): HealthChecksResponse { return $this->_getHealthChecks(sprintf('v1/health/node/%s', $node), $opts); } - /** - * @param string $service - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Health\HealthChecksResponse - */ public function Checks(string $service, ?QueryOptions $opts = null): HealthChecksResponse { return $this->_getHealthChecks(sprintf('v1/health/checks/%s', $service), $opts); } - /** - * @param string $service - * @param array $tags - * @param bool $passingOnly - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Health\ServiceEntriesResponse - */ public function ServiceMultipleTags( string $service, array $tags = [], @@ -72,14 +49,6 @@ public function ServiceMultipleTags( return $this->_getServiceEntries($service, $tags, $passingOnly, $opts, self::serviceHealth); } - /** - * @param string $service - * @param string $tag - * @param bool $passingOnly - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Health\ServiceEntriesResponse - */ public function Service( string $service, string $tag = '', @@ -89,14 +58,6 @@ public function Service( return $this->ServiceMultipleTags($service, '' !== $tag ? [$tag] : [], $passingOnly, $opts); } - /** - * @param string $service - * @param array $tags - * @param bool $passingOnly - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Health\ServiceEntriesResponse - */ public function IngressMultipleTags( string $service, array $tags = [], @@ -106,14 +67,6 @@ public function IngressMultipleTags( return $this->_getServiceEntries($service, $tags, $passingOnly, $opts, self::ingressHealth); } - /** - * @param string $service - * @param string $tag - * @param bool $passingOnly - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Health\ServiceEntriesResponse - */ public function Ingress( string $service, string $tag = '', @@ -123,14 +76,6 @@ public function Ingress( return $this->IngressMultipleTags($service, '' !== $tag ? [$tag] : [], $passingOnly, $opts); } - /** - * @param string $service - * @param array $tags - * @param bool $passingOnly - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Health\ServiceEntriesResponse - */ public function ConnectMultipleTags( string $service, array $tags = [], @@ -140,14 +85,6 @@ public function ConnectMultipleTags( return $this->_getServiceEntries($service, $tags, $passingOnly, $opts, self::connectHealth); } - /** - * @param string $service - * @param string $tag - * @param bool $passingOnly - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Health\ServiceEntriesResponse - */ public function Connect( string $service, string $tag = '', @@ -157,13 +94,6 @@ public function Connect( return $this->ConnectMultipleTags($service, '' !== $tag ? [$tag] : [], $passingOnly, $opts); } - /** - * @param string $state - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @return \DCarbone\PHPConsulAPI\Health\HealthChecksResponse - * @throws \Exception - * @throws \GuzzleHttp\Exception\GuzzleException - */ public function State(string $state, ?QueryOptions $opts = null): HealthChecksResponse { static $validStates = ['any', 'warning', 'critical', 'passing', 'unknown']; @@ -184,13 +114,6 @@ public function State(string $state, ?QueryOptions $opts = null): HealthChecksRe return $this->_getHealthChecks(sprintf('v1/health/state/%s', $state), $opts); } - /** - * @param string $path - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Health\HealthChecksResponse - */ protected function _getHealthChecks(string $path, ?QueryOptions $opts): HealthChecksResponse { $resp = $this->_requireOK($this->_doGet($path, $opts)); @@ -199,16 +122,6 @@ protected function _getHealthChecks(string $path, ?QueryOptions $opts): HealthCh return $ret; } - /** - * @param string $service - * @param array $tags - * @param bool $passingOnly - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @param string $healthType - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Health\ServiceEntriesResponse - */ private function _getServiceEntries( string $service, array $tags, diff --git a/src/Health/ServiceEntriesResponse.php b/src/Health/ServiceEntriesResponse.php index a9a05c8c..5ed674ea 100644 --- a/src/Health/ServiceEntriesResponse.php +++ b/src/Health/ServiceEntriesResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Health; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class ServiceEntriesResponse - */ class ServiceEntriesResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Health\ServiceEntry[]|null */ public ?array $ServiceEntries = null; - /** - * @return \DCarbone\PHPConsulAPI\Health\ServiceEntry[]|null - */ public function getValue(): ?array { return $this->ServiceEntries; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ServiceEntries = []; diff --git a/src/Health/ServiceEntry.php b/src/Health/ServiceEntry.php index 0839131b..96773463 100644 --- a/src/Health/ServiceEntry.php +++ b/src/Health/ServiceEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Health; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,9 +25,6 @@ use DCarbone\PHPConsulAPI\Catalog\Node; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceEntry - */ class ServiceEntry extends AbstractModel { protected const FIELDS = [ @@ -51,17 +48,10 @@ class ServiceEntry extends AbstractModel private const FIELD_SERVICE = 'Service'; private const FIELD_CHECKS = 'Checks'; - /** @var \DCarbone\PHPConsulAPI\Catalog\Node|null */ public ?Node $Node = null; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentService|null */ public ?AgentService $Service = null; - /** @var \DCarbone\PHPConsulAPI\Health\HealthChecks */ public HealthChecks $Checks; - /** - * ServiceEntry constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -70,54 +60,33 @@ public function __construct(?array $data = []) } } - /** - * @return \DCarbone\PHPConsulAPI\Catalog\Node|null - */ public function getNode(): ?Node { return $this->Node; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\Node|null $Node - * @return \DCarbone\PHPConsulAPI\Health\ServiceEntry - */ public function setNode(?Node $Node): self { $this->Node = $Node; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentService|null - */ public function getService(): ?AgentService { return $this->Service; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentService|null $Service - * @return \DCarbone\PHPConsulAPI\Health\ServiceEntry - */ public function setService(?AgentService $Service): self { $this->Service = $Service; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Health\HealthChecks - */ public function getChecks(): HealthChecks { return $this->Checks; } - /** - * @param \DCarbone\PHPConsulAPI\Health\HealthChecks $Checks - * @return \DCarbone\PHPConsulAPI\Health\ServiceEntry - */ public function setChecks(HealthChecks $Checks): self { $this->Checks = $Checks; diff --git a/src/HttpAuth.php b/src/HttpAuth.php index 1719b909..0e26216f 100644 --- a/src/HttpAuth.php +++ b/src/HttpAuth.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,73 +20,45 @@ limitations under the License. */ -/** - * Class HttpAuth - */ class HttpAuth implements \JsonSerializable { private const FIELD_USERNAME = 'username'; private const FIELD_PASSWORD = 'password'; - /** @var string */ public string $username = ''; - /** @var string */ public string $password = ''; - /** - * ConsulHttpAuth constructor. - * @param string $username - * @param string $password - */ public function __construct(string $username = '', string $password = '') { $this->username = $username; $this->password = $password; } - /** - * @return string - */ public function getUsername(): string { return $this->username; } - /** - * @return string - */ public function getPassword(): string { return $this->password; } - /** - * @return string - */ public function compileAuthString(): string { return (string)$this; } - /** - * @return array - */ public function jsonSerialize(): array { return [self::FIELD_USERNAME => $this->username, self::FIELD_PASSWORD => $this->password]; } - /** - * @return array - */ public function __debugInfo(): array { return [self::FIELD_USERNAME => $this->username]; } - /** - * @return string - */ public function __toString(): string { return trim(sprintf('%s:%s', $this->username, $this->password), ':'); diff --git a/src/KV/CheckTxnOp.php b/src/KV/CheckTxnOp.php index 9e165d99..0ffce250 100644 --- a/src/KV/CheckTxnOp.php +++ b/src/KV/CheckTxnOp.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\Health\HealthCheck; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class CheckTxnOp - */ class CheckTxnOp extends AbstractModel { protected const FIELDS = [ @@ -38,15 +35,9 @@ class CheckTxnOp extends AbstractModel private const FIELD_CHECK = 'Check'; - /** @var string */ public string $Verb = ''; - /** @var \DCarbone\PHPConsulAPI\Health\HealthCheck */ public HealthCheck $Check; - /** - * CheckTxnOp constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -55,36 +46,22 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getVerb(): string { return $this->Verb; } - /** - * @param string $Verb - * @return \DCarbone\PHPConsulAPI\KV\CheckTxnOp - */ public function setVerb(string $Verb): self { $this->Verb = $Verb; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck - */ public function getCheck(): HealthCheck { return $this->Check; } - /** - * @param \DCarbone\PHPConsulAPI\Health\HealthCheck $Check - * @return \DCarbone\PHPConsulAPI\KV\CheckTxnOp - */ public function setCheck(HealthCheck $Check): self { $this->Check = $Check; diff --git a/src/KV/KVClient.php b/src/KV/KVClient.php index b8c3ce16..2fb51783 100644 --- a/src/KV/KVClient.php +++ b/src/KV/KVClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -29,18 +29,8 @@ use DCarbone\PHPConsulAPI\WriteOptions; use DCarbone\PHPConsulAPI\WriteResponse; -/** - * Class KVClient - */ class KVClient extends AbstractClient { - /** - * @param string $key - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\KV\KVPairResponse - */ public function Get(string $key, ?QueryOptions $opts = null): KVPairResponse { $resp = $this->_doGet(sprintf('v1/kv/%s', $key), $opts); @@ -69,13 +59,6 @@ public function Get(string $key, ?QueryOptions $opts = null): KVPairResponse return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\KV\KVPair $p - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Put(KVPair $p, ?WriteOptions $opts = null): WriteResponse { $r = $this->_newPutRequest(sprintf('v1/kv/%s', $p->Key), $p->Value, $opts); @@ -88,24 +71,11 @@ public function Put(KVPair $p, ?WriteOptions $opts = null): WriteResponse return $ret; } - /** - * @param string $key - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Delete(string $key, ?WriteOptions $opts = null): WriteResponse { return $this->_executeDelete(sprintf('v1/kv/%s', $key), $opts); } - /** - * @param string $prefix - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\KV\KVPairsResponse - */ public function List(string $prefix = '', ?QueryOptions $opts = null): KVPairsResponse { $r = $this->_newGetRequest(sprintf('v1/kv/%s', $prefix), $opts); @@ -116,13 +86,6 @@ public function List(string $prefix = '', ?QueryOptions $opts = null): KVPairsRe return $ret; } - /** - * @param string $prefix - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedQueryStringsResponse - */ public function Keys(string $prefix = '', ?QueryOptions $opts = null): ValuedQueryStringsResponse { $r = $this->_newGetRequest(sprintf('v1/kv/%s', $prefix), $opts); @@ -133,13 +96,6 @@ public function Keys(string $prefix = '', ?QueryOptions $opts = null): ValuedQue return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\KV\KVPair $p - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedWriteBoolResponse - */ public function CAS(KVPair $p, ?WriteOptions $opts = null): ValuedWriteBoolResponse { $r = $this->_newPutRequest(sprintf('v1/kv/%s', $p->Key), $p->Value, $opts); @@ -153,13 +109,6 @@ public function CAS(KVPair $p, ?WriteOptions $opts = null): ValuedWriteBoolRespo return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\KV\KVPair $p - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Acquire(KVPair $p, ?WriteOptions $opts = null): WriteResponse { $r = $this->_newPutRequest(sprintf('v1/kv/%s', $p->Key), $p->Value, $opts); @@ -173,13 +122,6 @@ public function Acquire(KVPair $p, ?WriteOptions $opts = null): WriteResponse return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\KV\KVPair $p - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedWriteBoolResponse - */ public function DeleteCAS(KVPair $p, ?WriteOptions $opts = null): ValuedWriteBoolResponse { $r = $this->_newDeleteRequest(sprintf('v1/kv/%s', ltrim($p->Key, '/')), $opts); @@ -190,13 +132,6 @@ public function DeleteCAS(KVPair $p, ?WriteOptions $opts = null): ValuedWriteBoo return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\KV\KVPair $p - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Release(KVPair $p, ?WriteOptions $opts = null): WriteResponse { $r = $this->_newPutRequest(sprintf('v1/kv/%s', $p->Key), $p->Value, $opts); @@ -210,13 +145,6 @@ public function Release(KVPair $p, ?WriteOptions $opts = null): WriteResponse return $ret; } - /** - * @param string $prefix - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function DeleteTree(string $prefix, ?WriteOptions $opts = null): WriteResponse { $r = $this->_newDeleteRequest(sprintf('v1/kv/%s', $prefix), $opts); @@ -227,13 +155,6 @@ public function DeleteTree(string $prefix, ?WriteOptions $opts = null): WriteRes return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\KV\KVTxnOps $txn - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\KV\KVTxnAPIResponse - */ public function Txn(KVTxnOps $txn, ?QueryOptions $opts = null): KVTxnAPIResponse { $txnOps = new KVTxnOps(); @@ -294,7 +215,6 @@ public function Tree(string $prefix = '', ?QueryOptions $opts = null): array } $treeHierarchy = []; - /** @var KVPair $kvp */ foreach ($valueList as $kvp) { $path = $kvp->getKey(); $slashPos = strpos($path, '/'); diff --git a/src/KV/KVPair.php b/src/KV/KVPair.php index 0c3439d8..0a81ec7a 100644 --- a/src/KV/KVPair.php +++ b/src/KV/KVPair.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class KVPair - */ class KVPair extends AbstractModel { protected const FIELDS = [ @@ -34,21 +31,13 @@ class KVPair extends AbstractModel private const FIELD_NAMESPACE = 'Namespace'; - /** @var string */ public string $Key = ''; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** @var int */ public int $LockIndex = 0; - /** @var int */ public int $Flags = 0; - /** @var string */ public string $Value = ''; - /** @var string */ public string $Session = ''; - /** @var string */ public string $Namespace = ''; /** @@ -68,153 +57,94 @@ public function __construct(array $data = [], bool $_decodeValue = false) } } - /** - * @return string - */ public function getKey(): string { return $this->Key; } - /** - * @param string $key - * @return \DCarbone\PHPConsulAPI\KV\KVPair - */ public function setKey(string $key): self { $this->Key = $key; return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $createIndex - * @return \DCarbone\PHPConsulAPI\KV\KVPair - */ public function setCreateIndex(int $createIndex): self { $this->CreateIndex = $createIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $modifyIndex - * @return \DCarbone\PHPConsulAPI\KV\KVPair - */ public function setModifyIndex(int $modifyIndex): self { $this->ModifyIndex = $modifyIndex; return $this; } - /** - * @return int - */ public function getLockIndex(): int { return $this->LockIndex; } - /** - * @param int $lockIndex - * @return \DCarbone\PHPConsulAPI\KV\KVPair - */ public function setLockIndex(int $lockIndex): self { $this->LockIndex = $lockIndex; return $this; } - /** - * @return int - */ public function getFlags(): int { return $this->Flags; } - /** - * @param int $flags - * @return \DCarbone\PHPConsulAPI\KV\KVPair - */ public function setFlags(int $flags): self { $this->Flags = $flags; return $this; } - /** - * @return string - */ public function getValue(): string { return $this->Value; } - /** - * @param string $value - * @return \DCarbone\PHPConsulAPI\KV\KVPair - */ public function setValue(string $value): self { $this->Value = $value; return $this; } - /** - * @return string - */ public function getSession(): string { return $this->Session; } - /** - * @param string $session - * @return \DCarbone\PHPConsulAPI\KV\KVPair - */ public function setSession(string $session): self { $this->Session = $session; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $namespace - * @return \DCarbone\PHPConsulAPI\KV\KVPair - */ public function setNamespace(string $namespace): self { $this->Namespace = $namespace; return $this; } - /** - * @return string - */ public function __toString(): string { return $this->Value; diff --git a/src/KV/KVPairResponse.php b/src/KV/KVPairResponse.php index d23e38be..f6abca82 100644 --- a/src/KV/KVPairResponse.php +++ b/src/KV/KVPairResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class KVPairResponse - */ class KVPairResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\KV\KVPair|null */ public ?KVPair $KVPair = null; - /** - * @return \DCarbone\PHPConsulAPI\KV\KVPair|null - */ public function getValue(): ?KVPair { return $this->KVPair; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->KVPair = new KVPair((array)$decodedData, true); diff --git a/src/KV/KVPairs.php b/src/KV/KVPairs.php index d1bfea68..1003b6aa 100644 --- a/src/KV/KVPairs.php +++ b/src/KV/KVPairs.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,18 +23,10 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\FakeSlice; -/** - * Class KVPairs - */ class KVPairs extends FakeSlice { - /** @var string */ protected string $containedClass = KVPair::class; - /** - * @param array $data - * @return \DCarbone\PHPConsulAPI\AbstractModel - */ protected function newChild(array $data): AbstractModel { return new KVPair($data, true); diff --git a/src/KV/KVPairsResponse.php b/src/KV/KVPairsResponse.php index ea2325b0..2c5a1a65 100644 --- a/src/KV/KVPairsResponse.php +++ b/src/KV/KVPairsResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class KVPairsResponse - */ class KVPairsResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\KV\KVPairs|null */ public ?KVPairs $KVPairs = null; - /** - * @return \DCarbone\PHPConsulAPI\KV\KVPairs|null - */ public function getValue(): ?KVPairs { return $this->KVPairs; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->KVPairs = new KVPairs((array)$decodedData); diff --git a/src/KV/KVTree.php b/src/KV/KVTree.php index 53946296..ecfd21e9 100644 --- a/src/KV/KVTree.php +++ b/src/KV/KVTree.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,37 +20,22 @@ limitations under the License. */ -/** - * Class KVTree - */ class KVTree implements \RecursiveIterator, \Countable, \JsonSerializable, \ArrayAccess { - /** @var string */ private string $_prefix; - /** @var \DCarbone\PHPConsulAPI\KV\KVPair[]|\DCarbone\PHPConsulAPI\KV\KVTree[] */ private array $_children = []; - /** - * KVTree constructor. - * @param string $prefix - */ public function __construct(string $prefix) { $this->_prefix = $prefix; } - /** - * @return string - */ public function getPrefix(): string { return $this->_prefix; } - /** - * @return \DCarbone\PHPConsulAPI\KV\KVPair|\DCarbone\PHPConsulAPI\KV\KVTree can return any type - */ public function current(): KVTree|KVPair { return current($this->_children); @@ -69,10 +54,6 @@ public function key(): string return key($this->_children); } - /** - * @return bool The return value will be casted to boolean and then evaluated. - * Returns true on success or false on failure. - */ public function valid(): bool { return null !== key($this->_children); @@ -91,26 +72,16 @@ public function hasChildren(): bool return $this->current() instanceof self; } - /** - * @return \RecursiveIterator|\DCarbone\PHPConsulAPI\KV\KVTree|\DCarbone\PHPConsulAPI\KV\KVPair an iterator for the current entry - */ public function getChildren(): \RecursiveIterator|KVTree|KVPair { return $this->current(); } - /** - * @return int the custom count as an integer - */ public function count(): int { return \count($this->_children); } - /** - * @param mixed $offset an offset to check for - * @return bool true on success or false on failure - */ public function offsetExists(mixed $offset): bool { if (\is_string($offset)) { @@ -128,10 +99,6 @@ public function offsetExists(mixed $offset): bool return isset($this->_children[$offset]) || \array_key_exists($offset, $this->_children); } - /** - * @param mixed $offset the offset to retrieve - * @return \DCarbone\PHPConsulAPI\KV\KVTree|\DCarbone\PHPConsulAPI\KV\KVPair|null - */ public function offsetGet(mixed $offset): KVTree|KVPair|null { if (\is_string($offset)) { @@ -161,10 +128,6 @@ public function offsetGet(mixed $offset): KVTree|KVPair|null return null; } - /** - * @param mixed $offset the offset to assign the value to - * @param mixed $value the value to set - */ public function offsetSet(mixed $offset, mixed $value): void { if ('string' === \gettype($offset)) { @@ -184,17 +147,11 @@ public function offsetSet(mixed $offset, mixed $value): void } } - /** - * @param mixed $offset the offset to unset - */ public function offsetUnset(mixed $offset): void { // do nothing, yo... } - /** - * @return array - */ public function jsonSerialize(): array { $json = [$this->_prefix => []]; @@ -208,9 +165,6 @@ public function jsonSerialize(): array return $json; } - /** - * @return string - */ public function __toString() { return $this->_prefix; diff --git a/src/KV/KVTxnAPIResponse.php b/src/KV/KVTxnAPIResponse.php index c90d8b13..d64b2515 100644 --- a/src/KV/KVTxnAPIResponse.php +++ b/src/KV/KVTxnAPIResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,30 +23,19 @@ use DCarbone\PHPConsulAPI\ErrorContainer; use DCarbone\PHPConsulAPI\QueryMetaContainer; -/** - * Class KVTxnAPIResponse - */ class KVTxnAPIResponse { use QueryMetaContainer; use ErrorContainer; - /** @var bool */ public bool $OK = false; - /** @var \DCarbone\PHPConsulAPI\KV\KVTxnResponse|null */ public ?KVTxnResponse $KVTxnResponse = null; - /** - * @return bool - */ public function isOK(): bool { return $this->OK; } - /** - * @return \DCarbone\PHPConsulAPI\KV\KVTxnResponse|null - */ public function getKVTxnResponse(): ?KVTxnResponse { return $this->KVTxnResponse; diff --git a/src/KV/KVTxnOp.php b/src/KV/KVTxnOp.php index 92567080..f7cf0622 100644 --- a/src/KV/KVTxnOp.php +++ b/src/KV/KVTxnOp.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,22 +22,13 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class KVTxnOp - */ class KVTxnOp extends AbstractModel { - /** @var string */ public string $Verb = ''; - /** @var string */ public string $Key = ''; - /** @var string */ public string $Value = ''; - /** @var int */ public int $Flags = 0; - /** @var int */ public int $Index = 0; - /** @var string */ public string $Session = ''; /** @@ -57,49 +48,31 @@ public function __construct(array $data = [], bool $_decodeValue = false) } } - /** - * @return string - */ public function getVerb(): string { return $this->Verb; } - /** - * @return string - */ public function getKey(): string { return $this->Key; } - /** - * @return string - */ public function getValue(): string { return $this->Value; } - /** - * @return int - */ public function getFlags(): int { return $this->Flags; } - /** - * @return int - */ public function getIndex(): int { return $this->Index; } - /** - * @return string - */ public function getSession(): string { return $this->Session; diff --git a/src/KV/KVTxnOps.php b/src/KV/KVTxnOps.php index 6b5a7c26..a1c1ac8f 100644 --- a/src/KV/KVTxnOps.php +++ b/src/KV/KVTxnOps.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,18 +23,10 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\FakeSlice; -/** - * Class KVTxnOps - */ class KVTxnOps extends FakeSlice { - /** @var string */ protected string $containedClass = KVTxnOp::class; - /** - * @param array $data - * @return \DCarbone\PHPConsulAPI\AbstractModel - */ protected function newChild(array $data): AbstractModel { return new KVTxnOp($data); diff --git a/src/KV/KVTxnResponse.php b/src/KV/KVTxnResponse.php index 1b0e229c..dfd2d9f1 100644 --- a/src/KV/KVTxnResponse.php +++ b/src/KV/KVTxnResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class KVTxnResponse - */ class KVTxnResponse extends AbstractModel { protected const FIELDS = [ @@ -43,22 +40,14 @@ class KVTxnResponse extends AbstractModel private const FIELD_RESULTS = 'Results'; private const FIELD_ERRORS = 'Errors'; - /** @var \DCarbone\PHPConsulAPI\KV\KVPair[] */ public array $Results = []; - /** @var \DCarbone\PHPConsulAPI\KV\TxnErrors|null */ public ?TxnErrors $Errors = null; - /** - * @return \DCarbone\PHPConsulAPI\KV\KVPair[] - */ public function getResults(): array { return $this->Results; } - /** - * @return \DCarbone\PHPConsulAPI\KV\TxnErrors|null - */ public function getErrors(): ?TxnErrors { return $this->Errors; diff --git a/src/KV/NodeTxnOp.php b/src/KV/NodeTxnOp.php index e0821933..872f7d5d 100644 --- a/src/KV/NodeTxnOp.php +++ b/src/KV/NodeTxnOp.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\Catalog\Node; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class NodeTxnOp - */ class NodeTxnOp extends AbstractModel { protected const FIELDS = [ @@ -38,15 +35,9 @@ class NodeTxnOp extends AbstractModel private const FIELD_NODE = 'Node'; - /** @var string */ public string $Verb = ''; - /** @var \DCarbone\PHPConsulAPI\Catalog\Node */ public Node $Node; - /** - * NodeTxnOp constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -55,36 +46,22 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getVerb(): string { return $this->Verb; } - /** - * @param string $Verb - * @return \DCarbone\PHPConsulAPI\KV\NodeTxnOp - */ public function setVerb(string $Verb): self { $this->Verb = $Verb; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Catalog\Node - */ public function getNode(): Node { return $this->Node; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\Node $Node - * @return \DCarbone\PHPConsulAPI\KV\NodeTxnOp - */ public function setNode(Node $Node): self { $this->Node = $Node; diff --git a/src/KV/ServiceTxnOp.php b/src/KV/ServiceTxnOp.php index ad68d0d2..52c50964 100644 --- a/src/KV/ServiceTxnOp.php +++ b/src/KV/ServiceTxnOp.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\Agent\AgentService; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceTxnOp - */ class ServiceTxnOp extends AbstractModel { protected const FIELDS = [ @@ -38,71 +35,43 @@ class ServiceTxnOp extends AbstractModel private const FIELD_SERVICE = 'Service'; - /** @var string */ public string $Verb = ''; - /** @var string */ public string $Node = ''; - /** @var \DCarbone\PHPConsulAPI\Agent\AgentService */ public AgentService $Service; - /** - * ServiceTxnOp constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); $this->Service = new AgentService(null); } - /** - * @return string - */ public function getVerb(): string { return $this->Verb; } - /** - * @param string $Verb - * @return \DCarbone\PHPConsulAPI\KV\ServiceTxnOp - */ public function setVerb(string $Verb): self { $this->Verb = $Verb; return $this; } - /** - * @return string - */ public function getNode(): string { return $this->Node; } - /** - * @param string $Node - * @return \DCarbone\PHPConsulAPI\KV\ServiceTxnOp - */ public function setNode(string $Node): self { $this->Node = $Node; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Agent\AgentService - */ public function getService(): AgentService { return $this->Service; } - /** - * @param \DCarbone\PHPConsulAPI\Agent\AgentService $Service - * @return \DCarbone\PHPConsulAPI\KV\ServiceTxnOp - */ public function setService(AgentService $Service): self { $this->Service = $Service; diff --git a/src/KV/TxnError.php b/src/KV/TxnError.php index 12e463f3..d0add265 100644 --- a/src/KV/TxnError.php +++ b/src/KV/TxnError.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,46 +22,27 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class TxnError - */ class TxnError extends AbstractModel { - /** @var int */ public int $OpIndex = 0; - /** @var string */ public string $What = ''; - /** - * @return int - */ public function getOpIndex(): int { return $this->OpIndex; } - /** - * @param int $OpIndex - * @return \DCarbone\PHPConsulAPI\KV\TxnError - */ public function setOpIndex(int $OpIndex): self { $this->OpIndex = $OpIndex; return $this; } - /** - * @return string - */ public function getWhat(): string { return $this->What; } - /** - * @param string $What - * @return \DCarbone\PHPConsulAPI\KV\TxnError - */ public function setWhat(string $What): self { $this->What = $What; diff --git a/src/KV/TxnErrors.php b/src/KV/TxnErrors.php index 0e3651d4..e09430bb 100644 --- a/src/KV/TxnErrors.php +++ b/src/KV/TxnErrors.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,18 +23,10 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\FakeSlice; -/** - * Class TxnErrors - */ class TxnErrors extends FakeSlice { - /** @var string */ protected string $containedClass = TxnError::class; - /** - * @param array $data - * @return \DCarbone\PHPConsulAPI\AbstractModel - */ protected function newChild(array $data): AbstractModel { return new TxnError($data); diff --git a/src/KV/TxnOp.php b/src/KV/TxnOp.php index d5e9a9e1..f5f50a44 100644 --- a/src/KV/TxnOp.php +++ b/src/KV/TxnOp.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class TxnOp - */ class TxnOp extends AbstractModel { protected const FIELDS = [ @@ -56,81 +53,49 @@ class TxnOp extends AbstractModel private const FIELD_SERVICE = 'Service'; private const FIELD_CHECK = 'Check'; - /** @var \DCarbone\PHPConsulAPI\KV\KVTxnOp|null */ public ?KVTxnOp $KV = null; - /** @var \DCarbone\PHPConsulAPI\KV\NodeTxnOp|null */ public ?NodeTxnOp $Node = null; - /** @var \DCarbone\PHPConsulAPI\KV\ServiceTxnOp|null */ public ?ServiceTxnOp $Service = null; - /** @var \DCarbone\PHPConsulAPI\KV\CheckTxnOp|null */ public ?CheckTxnOp $Check = null; - /** - * @return \DCarbone\PHPConsulAPI\KV\KVTxnOp|null - */ public function getKV(): ?KVTxnOp { return $this->KV; } - /** - * @param \DCarbone\PHPConsulAPI\KV\KVTxnOp|null $KV - * @return \DCarbone\PHPConsulAPI\KV\TxnOp - */ public function setKV(?KVTxnOp $KV): self { $this->KV = $KV; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\KV\NodeTxnOp|null - */ public function getNode(): ?NodeTxnOp { return $this->Node; } - /** - * @param \DCarbone\PHPConsulAPI\KV\NodeTxnOp|null $Node - * @return \DCarbone\PHPConsulAPI\KV\TxnOp - */ public function setNode(?NodeTxnOp $Node): self { $this->Node = $Node; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\KV\ServiceTxnOp|null - */ public function getService(): ?ServiceTxnOp { return $this->Service; } - /** - * @param \DCarbone\PHPConsulAPI\KV\ServiceTxnOp|null $Service - * @return \DCarbone\PHPConsulAPI\KV\TxnOp - */ public function setService(?ServiceTxnOp $Service): self { $this->Service = $Service; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\KV\CheckTxnOp|null - */ public function getCheck(): ?CheckTxnOp { return $this->Check; } - /** - * @param \DCarbone\PHPConsulAPI\KV\CheckTxnOp|null $Check - * @return \DCarbone\PHPConsulAPI\KV\TxnOp - */ public function setCheck(?CheckTxnOp $Check): self { $this->Check = $Check; diff --git a/src/KV/TxnOps.php b/src/KV/TxnOps.php index b3b5a308..28a37cc1 100644 --- a/src/KV/TxnOps.php +++ b/src/KV/TxnOps.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,18 +23,10 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\FakeSlice; -/** - * Class TxnOps - */ class TxnOps extends FakeSlice { - /** @var string */ protected string $containedClass = TxnOp::class; - /** - * @param array $data - * @return \DCarbone\PHPConsulAPI\AbstractModel - */ protected function newChild(array $data): AbstractModel { return new TxnOp($data); diff --git a/src/KV/TxnResponse.php b/src/KV/TxnResponse.php index d9dab0e7..7bcdfd9c 100644 --- a/src/KV/TxnResponse.php +++ b/src/KV/TxnResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class TxnResponse - */ class TxnResponse extends AbstractModel { protected const FIELDS = [ @@ -42,15 +39,9 @@ class TxnResponse extends AbstractModel private const FIELD_RESULTS = 'Results'; private const FIELD_ERRORS = 'Errors'; - /** @var \DCarbone\PHPConsulAPI\KV\TxnResults */ public TxnResults $Results; - /** @var \DCarbone\PHPConsulAPI\KV\TxnErrors */ public TxnErrors $Errors; - /** - * TxnResponse constructor. - * @param array|null $data - */ public function __construct(?array $data = null) { parent::__construct($data); @@ -62,36 +53,22 @@ public function __construct(?array $data = null) } } - /** - * @return \DCarbone\PHPConsulAPI\KV\TxnResults - */ public function getResults(): TxnResults { return $this->Results; } - /** - * @param \DCarbone\PHPConsulAPI\KV\TxnResults $Results - * @return \DCarbone\PHPConsulAPI\KV\TxnResponse - */ public function setResults(TxnResults $Results): self { $this->Results = $Results; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\KV\TxnErrors - */ public function getErrors(): TxnErrors { return $this->Errors; } - /** - * @param \DCarbone\PHPConsulAPI\KV\TxnErrors $Errors - * @return \DCarbone\PHPConsulAPI\KV\TxnResponse - */ public function setErrors(TxnErrors $Errors): self { $this->Errors = $Errors; diff --git a/src/KV/TxnResult.php b/src/KV/TxnResult.php index 1e23a0ed..1f7af537 100644 --- a/src/KV/TxnResult.php +++ b/src/KV/TxnResult.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,9 +26,6 @@ use DCarbone\PHPConsulAPI\Health\HealthCheck; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class TxnResult - */ class TxnResult extends AbstractModel { protected const FIELDS = [ @@ -59,81 +56,49 @@ class TxnResult extends AbstractModel private const FIELD_SERVICE = 'Service'; private const FIELD_CHECK = 'Check'; - /** @var \DCarbone\PHPConsulAPI\KV\KVPair|null */ public ?KVPair $KV = null; - /** @var \DCarbone\PHPConsulAPI\Catalog\Node|null */ public ?Node $Node = null; - /** @var \DCarbone\PHPConsulAPI\Catalog\CatalogService|null */ public ?CatalogService $Service = null; - /** @var \DCarbone\PHPConsulAPI\Health\HealthCheck|null */ public ?HealthCheck $Check = null; - /** - * @return \DCarbone\PHPConsulAPI\KV\KVPair|null - */ public function getKV(): ?KVPair { return $this->KV; } - /** - * @param \DCarbone\PHPConsulAPI\KV\KVPair|null $KV - * @return \DCarbone\PHPConsulAPI\KV\TxnResult - */ public function setKV(?KVPair $KV): self { $this->KV = $KV; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Catalog\Node|null - */ public function getNode(): ?Node { return $this->Node; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\Node|null $Node - * @return \DCarbone\PHPConsulAPI\KV\TxnResult - */ public function setNode(?Node $Node): self { $this->Node = $Node; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Catalog\CatalogService|null - */ public function getService(): ?CatalogService { return $this->Service; } - /** - * @param \DCarbone\PHPConsulAPI\Catalog\CatalogService|null $Service - * @return \DCarbone\PHPConsulAPI\KV\TxnResult - */ public function setService(?CatalogService $Service): self { $this->Service = $Service; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Health\HealthCheck|null - */ public function getCheck(): ?HealthCheck { return $this->Check; } - /** - * @param \DCarbone\PHPConsulAPI\Health\HealthCheck|null $Check - * @return \DCarbone\PHPConsulAPI\KV\TxnResult - */ public function setCheck(?HealthCheck $Check): self { $this->Check = $Check; diff --git a/src/KV/TxnResults.php b/src/KV/TxnResults.php index ea7f1d83..d4a87fb5 100644 --- a/src/KV/TxnResults.php +++ b/src/KV/TxnResults.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\KV; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,18 +23,10 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\FakeSlice; -/** - * Class TxnResults - */ class TxnResults extends FakeSlice { - /** @var string */ protected string $containedClass = TxnResult::class; - /** - * @param array $data - * @return \DCarbone\PHPConsulAPI\AbstractModel - */ protected function newChild(array $data): AbstractModel { return new TxnResult($data); diff --git a/src/MapResponse.php b/src/MapResponse.php index b3e355c8..cecfec0f 100644 --- a/src/MapResponse.php +++ b/src/MapResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,25 +20,15 @@ limitations under the License. */ -/** - * Class MapResponse - */ class MapResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { - /** @var array|null */ public ?array $Map = null; - /** - * @return array|null - */ public function getValue(): ?array { return $this->Map; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->Map = $decodedData; diff --git a/src/Marshaller.php b/src/Marshaller.php index 9986807d..bc9b5ce0 100644 --- a/src/Marshaller.php +++ b/src/Marshaller.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,11 +22,6 @@ use DCarbone\Go\Time; -/** - * Used to assist with marshalling types into json - * - * Trait Marshaller - */ trait Marshaller { /** diff --git a/src/Operator/Area.php b/src/Operator/Area.php index 2ad91851..d922cf5c 100644 --- a/src/Operator/Area.php +++ b/src/Operator/Area.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,86 +22,51 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class Area - */ class Area extends AbstractModel { - /** @var string */ public string $ID = ''; - /** @var string */ public string $PeerDatacenter = ''; - /** @var string[] */ public array $RetryJoin = []; - /** @var bool */ public bool $UseTLS = false; - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $id - * @return \DCarbone\PHPConsulAPI\Operator\Area - */ public function setID(string $id): self { $this->ID = $id; return $this; } - /** - * @return string - */ public function getPeerDatacenter(): string { return $this->PeerDatacenter; } - /** - * @param string $peerDatacenter - * @return \DCarbone\PHPConsulAPI\Operator\Area - */ public function setPeerDatacenter(string $peerDatacenter): self { $this->PeerDatacenter = $peerDatacenter; return $this; } - /** - * @return string[] - */ public function getRetryJoin(): array { return $this->RetryJoin; } - /** - * @param string[] $retryJoin - * @return \DCarbone\PHPConsulAPI\Operator\Area - */ public function setRetryJoin(array $retryJoin): self { $this->RetryJoin = $retryJoin; return $this; } - /** - * @return bool - */ public function isUseTLS(): bool { return $this->UseTLS; } - /** - * @param bool $useTLS - * @return \DCarbone\PHPConsulAPI\Operator\Area - */ public function setUseTLS(bool $useTLS): self { $this->UseTLS = $useTLS; diff --git a/src/Operator/AreaJoinResponse.php b/src/Operator/AreaJoinResponse.php index 01417cc5..895c24e5 100644 --- a/src/Operator/AreaJoinResponse.php +++ b/src/Operator/AreaJoinResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,37 +22,22 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class AreaJoinResponse - */ class AreaJoinResponse extends AbstractModel { - /** @var string */ public string $Address = ''; - /** @var bool */ public bool $Joined = false; - /** @var string */ public string $Error = ''; - /** - * @return string - */ public function getAddress(): string { return $this->Address; } - /** - * @return bool - */ public function isJoined(): bool { return $this->Joined; } - /** - * @return string - */ public function getError(): string { return $this->Error; diff --git a/src/Operator/AutopilotConfiguration.php b/src/Operator/AutopilotConfiguration.php index e1260d07..0e2916f6 100644 --- a/src/Operator/AutopilotConfiguration.php +++ b/src/Operator/AutopilotConfiguration.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AutopilotConfiguration - */ class AutopilotConfiguration extends AbstractModel { protected const FIELDS = [ @@ -42,201 +39,121 @@ class AutopilotConfiguration extends AbstractModel private const FIELD_LAST_CONTACT_THRESHOLD = 'LastContactThreshold'; private const FIELD_SERVER_STABILIZATION_TIME = 'ServerStabilizationTime'; - /** @var bool */ public bool $CleanupDeadServers = false; - /** @var \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null */ public ?ReadableDuration $LastContactThreshold = null; - /** @var int */ public int $MaxTrailingLogs = 0; - /** @var int */ public int $MinQuorum = 0; - /** @var \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null */ public ?ReadableDuration $ServerStabilizationTime = null; - /** @var string */ public string $RedundancyZoneTag = ''; - /** @var bool */ public bool $DisableUpgradeMigration = false; - /** @var string */ public string $UpgradeVersionTag = ''; - /** @var int */ public int $CreateIndex = 0; - /** @var int */ public int $ModifyIndex = 0; - /** - * @return bool - */ public function isCleanupDeadServers(): bool { return $this->CleanupDeadServers; } - /** - * @param bool $CleanupDeadServers - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration - */ public function setCleanupDeadServers(bool $CleanupDeadServers): self { $this->CleanupDeadServers = $CleanupDeadServers; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null - */ public function getLastContactThreshold(): ?ReadableDuration { return $this->LastContactThreshold; } - /** - * @param \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null $LastContactThreshold - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration - */ public function setLastContactThreshold(?ReadableDuration $LastContactThreshold): self { $this->LastContactThreshold = $LastContactThreshold; return $this; } - /** - * @return int - */ public function getMaxTrailingLogs(): int { return $this->MaxTrailingLogs; } - /** - * @param int $MaxTrailingLogs - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration - */ public function setMaxTrailingLogs(int $MaxTrailingLogs): self { $this->MaxTrailingLogs = $MaxTrailingLogs; return $this; } - /** - * @return int - */ public function getMinQuorum(): int { return $this->MinQuorum; } - /** - * @param int $MinQuorum - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration - */ public function setMinQuorum(int $MinQuorum): self { $this->MinQuorum = $MinQuorum; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null - */ public function getServerStabilizationTime(): ?ReadableDuration { return $this->ServerStabilizationTime; } - /** - * @param \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null $ServerStabilizationTime - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration - */ public function setServerStabilizationTime(?ReadableDuration $ServerStabilizationTime): self { $this->ServerStabilizationTime = $ServerStabilizationTime; return $this; } - /** - * @return string - */ public function getRedundancyZoneTag(): string { return $this->RedundancyZoneTag; } - /** - * @param string $RedundancyZoneTag - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration - */ public function setRedundancyZoneTag(string $RedundancyZoneTag): self { $this->RedundancyZoneTag = $RedundancyZoneTag; return $this; } - /** - * @return bool - */ public function isDisableUpgradeMigration(): bool { return $this->DisableUpgradeMigration; } - /** - * @param bool $DisableUpgradeMigration - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration - */ public function setDisableUpgradeMigration(bool $DisableUpgradeMigration): self { $this->DisableUpgradeMigration = $DisableUpgradeMigration; return $this; } - /** - * @return string - */ public function getUpgradeVersionTag(): string { return $this->UpgradeVersionTag; } - /** - * @param string $UpgradeVersionTag - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration - */ public function setUpgradeVersionTag(string $UpgradeVersionTag): self { $this->UpgradeVersionTag = $UpgradeVersionTag; return $this; } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return int - */ public function getModifyIndex(): int { return $this->ModifyIndex; } - /** - * @param int $ModifyIndex - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration - */ public function setModifyIndex(int $ModifyIndex): self { $this->ModifyIndex = $ModifyIndex; diff --git a/src/Operator/AutopilotServer.php b/src/Operator/AutopilotServer.php index dd056daa..3e0ff8d0 100644 --- a/src/Operator/AutopilotServer.php +++ b/src/Operator/AutopilotServer.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AutopilotServer - */ class AutopilotServer extends AbstractModel implements \JsonSerializable { protected const FIELDS = [ @@ -46,43 +43,23 @@ class AutopilotServer extends AbstractModel implements \JsonSerializable private const FIELD_REDUNDANCY_ZONE = 'RedundancyZone'; private const FIELD_UPGRADE_VERSION = 'UpgradeVersion'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Address = ''; - /** @var string */ public string $NodeStatus = ''; - /** @var string */ public string $Version = ''; - /** @var \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null */ public ?ReadableDuration $LastContact = null; - /** @var int */ public int $LastTerm = 0; - /** @var int */ public int $LastIndex = 0; - /** @var bool */ public bool $Healthy = false; - /** @var \DCarbone\Go\Time\Time */ public Time\Time $StableSince; - /** @var string */ public string $RedundancyZone = ''; - /** @var string */ public string $UpgradeVersion = ''; - /** @var bool */ public bool $ReadReplica = false; - /** @var string */ public string $Status = ''; - /** @var array */ public array $Meta = []; - /** @var string */ public string $NodeType = ''; - /** - * AutopilotServer constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -91,297 +68,182 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getAddress(): string { return $this->Address; } - /** - * @param string $Address - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setAddress(string $Address): self { $this->Address = $Address; return $this; } - /** - * @return string - */ public function getNodeStatus(): string { return $this->NodeStatus; } - /** - * @param string $NodeStatus - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setNodeStatus(string $NodeStatus): self { $this->NodeStatus = $NodeStatus; return $this; } - /** - * @return string - */ public function getVersion(): string { return $this->Version; } - /** - * @param string $Version - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setVersion(string $Version): self { $this->Version = $Version; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null - */ public function getLastContact(): ?ReadableDuration { return $this->LastContact; } - /** - * @param \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null $LastContact - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setLastContact(?ReadableDuration $LastContact): self { $this->LastContact = $LastContact; return $this; } - /** - * @return int - */ public function getLastTerm(): int { return $this->LastTerm; } - /** - * @param int $LastTerm - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setLastTerm(int $LastTerm): self { $this->LastTerm = $LastTerm; return $this; } - /** - * @return int - */ public function getLastIndex(): int { return $this->LastIndex; } - /** - * @param int $LastIndex - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setLastIndex(int $LastIndex): self { $this->LastIndex = $LastIndex; return $this; } - /** - * @return bool - */ public function isHealthy(): bool { return $this->Healthy; } - /** - * @param bool $Healthy - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setHealthy(bool $Healthy): self { $this->Healthy = $Healthy; return $this; } - /** - * @return \DCarbone\Go\Time\Time - */ public function getStableSince(): Time\Time { return $this->StableSince; } - /** - * @param \DCarbone\Go\Time\Time $StableSince - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setStableSince(Time\Time $StableSince): self { $this->StableSince = $StableSince; return $this; } - /** - * @return string - */ public function getRedundancyZone(): string { return $this->RedundancyZone; } - /** - * @param string $RedundancyZone - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setRedundancyZone(string $RedundancyZone): self { $this->RedundancyZone = $RedundancyZone; return $this; } - /** - * @return string - */ public function getUpgradeVersion(): string { return $this->UpgradeVersion; } - /** - * @param string $UpgradeVersion - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setUpgradeVersion(string $UpgradeVersion): self { $this->UpgradeVersion = $UpgradeVersion; return $this; } - /** - * @return bool - */ public function isReadReplica(): bool { return $this->ReadReplica; } - /** - * @param bool $ReadReplica - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setReadReplica(bool $ReadReplica): self { $this->ReadReplica = $ReadReplica; return $this; } - /** - * @return string - */ public function getStatus(): string { return $this->Status; } - /** - * @param string $Status - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setStatus(string $Status): self { $this->Status = $Status; return $this; } - /** - * @return array - */ public function getMeta(): array { return $this->Meta; } - /** - * @param array $Meta - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setMeta(array $Meta): self { $this->Meta = $Meta; return $this; } - /** - * @return string - */ public function getNodeType(): string { return $this->NodeType; } - /** - * @param string $NodeType - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer - */ public function setNodeType(string $NodeType): self { $this->NodeType = $NodeType; return $this; } - /** - * @return array - */ public function jsonSerialize(): array { $arr = parent::jsonSerialize(); diff --git a/src/Operator/AutopilotState.php b/src/Operator/AutopilotState.php index a1d64b51..881d8247 100644 --- a/src/Operator/AutopilotState.php +++ b/src/Operator/AutopilotState.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AutopilotState - */ class AutopilotState extends AbstractModel { protected const FIELDS = [ @@ -55,181 +52,109 @@ class AutopilotState extends AbstractModel private const FIELD_REDUNDANCY_ZONE = 'RedundancyZone'; private const FIELD_UPGRADE = 'Upgrade'; - /** @var bool */ public bool $Healthy = false; - /** @var int */ public int $FailureTolerance = 0; - /** @var int */ public int $OptimisticFailureTolerance = 0; - /** @var \DCarbone\PHPConsulAPI\Operator\AutopilotServer[] */ public array $Servers = []; - /** @var string */ public string $Leader = ''; - /** @var string[] */ public array $Voters = []; - /** @var string[] */ public array $ReadReplicas = []; - /** @var \DCarbone\PHPConsulAPI\Operator\AutopilotZone[] */ public array $RedundancyZone = []; - /** @var \DCarbone\PHPConsulAPI\Operator\AutopilotUpgrade|null */ public ?AutopilotUpgrade $Upgrade = null; - /** - * @return bool - */ public function isHealthy(): bool { return $this->Healthy; } - /** - * @param bool $Healthy - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotState - */ public function setHealthy(bool $Healthy): self { $this->Healthy = $Healthy; return $this; } - /** - * @return int - */ public function getFailureTolerance(): int { return $this->FailureTolerance; } - /** - * @param int $FailureTolerance - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotState - */ public function setFailureTolerance(int $FailureTolerance): self { $this->FailureTolerance = $FailureTolerance; return $this; } - /** - * @return int - */ public function getOptimisticFailureTolerance(): int { return $this->OptimisticFailureTolerance; } - /** - * @param int $OptimisticFailureTolerance - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotState - */ public function setOptimisticFailureTolerance(int $OptimisticFailureTolerance): self { $this->OptimisticFailureTolerance = $OptimisticFailureTolerance; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotServer[] - */ public function getServers(): array { return $this->Servers; } - /** - * @param \DCarbone\PHPConsulAPI\Operator\AutopilotServer[] $Servers - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotState - */ public function setServers(array $Servers): self { $this->Servers = $Servers; return $this; } - /** - * @return string - */ public function getLeader(): string { return $this->Leader; } - /** - * @param string $Leader - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotState - */ public function setLeader(string $Leader): self { $this->Leader = $Leader; return $this; } - /** - * @return string[] - */ public function getVoters(): array { return $this->Voters; } - /** - * @param string[] $Voters - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotState - */ public function setVoters(array $Voters): self { $this->Voters = $Voters; return $this; } - /** - * @return string[] - */ public function getReadReplicas(): array { return $this->ReadReplicas; } - /** - * @param string[] $ReadReplicas - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotState - */ public function setReadReplicas(array $ReadReplicas): self { $this->ReadReplicas = $ReadReplicas; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotZone[] - */ public function getRedundancyZone(): array { return $this->RedundancyZone; } - /** - * @param \DCarbone\PHPConsulAPI\Operator\AutopilotZone[] $RedundancyZone - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotState - */ public function setRedundancyZone(array $RedundancyZone): self { $this->RedundancyZone = $RedundancyZone; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotUpgrade|null - */ public function getUpgrade(): ?AutopilotUpgrade { return $this->Upgrade; } - /** - * @param \DCarbone\PHPConsulAPI\Operator\AutopilotUpgrade|null $Upgrade - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotState - */ public function setUpgrade(?AutopilotUpgrade $Upgrade): self { $this->Upgrade = $Upgrade; diff --git a/src/Operator/AutopilotStateResponse.php b/src/Operator/AutopilotStateResponse.php index 7273a47c..bf4add88 100644 --- a/src/Operator/AutopilotStateResponse.php +++ b/src/Operator/AutopilotStateResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class AutopilotStateResponse - */ class AutopilotStateResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Operator\AutopilotState|null */ public ?AutopilotState $AutopilotState = null; - /** - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotState|null - */ public function getValue(): ?AutopilotState { return $this->AutopilotState; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->AutopilotState = new AutopilotState($decodedData); diff --git a/src/Operator/AutopilotUpgrade.php b/src/Operator/AutopilotUpgrade.php index 1392b0c8..fa372a69 100644 --- a/src/Operator/AutopilotUpgrade.php +++ b/src/Operator/AutopilotUpgrade.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AutopilotUpgrade - */ class AutopilotUpgrade extends AbstractModel { protected const FIELDS = [ @@ -52,181 +49,109 @@ class AutopilotUpgrade extends AbstractModel private const FIELD_OTHER_VERSION_READ_REPLICAS = 'OtherVersionReadReplicas'; private const FIELD_REDUNDANCY_ZONES = 'RedundancyZones'; - /** @var string */ public string $Status = ''; - /** @var string */ public string $TargetVersion = ''; - /** @var string[] */ public array $TargetVersionVoters = []; - /** @var string[] */ public array $TargetVersionNonVoters = []; - /** @var string[] */ public array $TargetVersionReadReplicas = []; - /** @var string[] */ public array $OtherVersionVoters = []; - /** @var string[] */ public array $OtherVersionNonVoters = []; - /** @var string[] */ public array $OtherVersionReadReplicas = []; - /** @var \DCarbone\PHPConsulAPI\Operator\AutopilotZoneUpgradeVersions[] */ public array $RedundancyZones = []; - /** - * @return string - */ public function getStatus(): string { return $this->Status; } - /** - * @param string $Status - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotUpgrade - */ public function setStatus(string $Status): self { $this->Status = $Status; return $this; } - /** - * @return string - */ public function getTargetVersion(): string { return $this->TargetVersion; } - /** - * @param string $TargetVersion - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotUpgrade - */ public function setTargetVersion(string $TargetVersion): self { $this->TargetVersion = $TargetVersion; return $this; } - /** - * @return string[] - */ public function getTargetVersionVoters(): array { return $this->TargetVersionVoters; } - /** - * @param string[] $TargetVersionVoters - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotUpgrade - */ public function setTargetVersionVoters(array $TargetVersionVoters): self { $this->TargetVersionVoters = $TargetVersionVoters; return $this; } - /** - * @return string[] - */ public function getTargetVersionNonVoters(): array { return $this->TargetVersionNonVoters; } - /** - * @param string[] $TargetVersionNonVoters - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotUpgrade - */ public function setTargetVersionNonVoters(array $TargetVersionNonVoters): self { $this->TargetVersionNonVoters = $TargetVersionNonVoters; return $this; } - /** - * @return string[] - */ public function getTargetVersionReadReplicas(): array { return $this->TargetVersionReadReplicas; } - /** - * @param string[] $TargetVersionReadReplicas - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotUpgrade - */ public function setTargetVersionReadReplicas(array $TargetVersionReadReplicas): self { $this->TargetVersionReadReplicas = $TargetVersionReadReplicas; return $this; } - /** - * @return string[] - */ public function getOtherVersionVoters(): array { return $this->OtherVersionVoters; } - /** - * @param string[] $OtherVersionVoters - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotUpgrade - */ public function setOtherVersionVoters(array $OtherVersionVoters): self { $this->OtherVersionVoters = $OtherVersionVoters; return $this; } - /** - * @return string[] - */ public function getOtherVersionNonVoters(): array { return $this->OtherVersionNonVoters; } - /** - * @param string[] $OtherVersionNonVoters - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotUpgrade - */ public function setOtherVersionNonVoters(array $OtherVersionNonVoters): self { $this->OtherVersionNonVoters = $OtherVersionNonVoters; return $this; } - /** - * @return string[] - */ public function getOtherVersionReadReplicas(): array { return $this->OtherVersionReadReplicas; } - /** - * @param string[] $OtherVersionReadReplicas - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotUpgrade - */ public function setOtherVersionReadReplicas(array $OtherVersionReadReplicas): self { $this->OtherVersionReadReplicas = $OtherVersionReadReplicas; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotZoneUpgradeVersions[] - */ public function getRedundancyZones(): array { return $this->RedundancyZones; } - /** - * @param \DCarbone\PHPConsulAPI\Operator\AutopilotZoneUpgradeVersions[] $RedundancyZones - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotUpgrade - */ public function setRedundancyZones(array $RedundancyZones): self { $this->RedundancyZones = $RedundancyZones; diff --git a/src/Operator/AutopilotZone.php b/src/Operator/AutopilotZone.php index 73b1e52a..b24ca654 100644 --- a/src/Operator/AutopilotZone.php +++ b/src/Operator/AutopilotZone.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,66 +22,39 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class AutopilotZone - */ class AutopilotZone extends AbstractModel { - /** @var string[] */ public array $Servers = []; - /** @var string[] */ public array $Voters = []; - /** @var int */ public int $FailureTolerance = 0; - /** - * @return string[] - */ public function getServers(): array { return $this->Servers; } - /** - * @param string[] $Servers - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotZone - */ public function setServers(array $Servers): self { $this->Servers = $Servers; return $this; } - /** - * @return string[] - */ public function getVoters(): array { return $this->Voters; } - /** - * @param string[] $Voters - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotZone - */ public function setVoters(array $Voters): self { $this->Voters = $Voters; return $this; } - /** - * @return int - */ public function getFailureTolerance(): int { return $this->FailureTolerance; } - /** - * @param int $FailureTolerance - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotZone - */ public function setFailureTolerance(int $FailureTolerance): self { $this->FailureTolerance = $FailureTolerance; diff --git a/src/Operator/AutopilotZoneUpgradeVersions.php b/src/Operator/AutopilotZoneUpgradeVersions.php index 31a70443..9b07c349 100644 --- a/src/Operator/AutopilotZoneUpgradeVersions.php +++ b/src/Operator/AutopilotZoneUpgradeVersions.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class AutopilotZoneUpgradeVersions - */ class AutopilotZoneUpgradeVersions extends AbstractModel { protected const FIELDS = [ @@ -40,81 +37,49 @@ class AutopilotZoneUpgradeVersions extends AbstractModel private const FIELD_OTHER_VERSION_VOTERS = 'OtherVersionVoters'; private const FIELD_OTHER_VERSION_NON_VOTERS = 'OtherVersionNonVoters'; - /** @var string[] */ public array $TargetVersionVoters = []; - /** @var string[] */ public array $TargetVersionNonVoters = []; - /** @var string[] */ public array $OtherVersionVoters = []; - /** @var string[] */ public array $OtherVersionNonVoters = []; - /** - * @return string[] - */ public function getTargetVersionVoters(): array { return $this->TargetVersionVoters; } - /** - * @param string[] $TargetVersionVoters - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotZoneUpgradeVersions - */ public function setTargetVersionVoters(array $TargetVersionVoters): self { $this->TargetVersionVoters = $TargetVersionVoters; return $this; } - /** - * @return string[] - */ public function getTargetVersionNonVoters(): array { return $this->TargetVersionNonVoters; } - /** - * @param string[] $TargetVersionNonVoters - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotZoneUpgradeVersions - */ public function setTargetVersionNonVoters(array $TargetVersionNonVoters): self { $this->TargetVersionNonVoters = $TargetVersionNonVoters; return $this; } - /** - * @return string[] - */ public function getOtherVersionVoters(): array { return $this->OtherVersionVoters; } - /** - * @param string[] $OtherVersionVoters - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotZoneUpgradeVersions - */ public function setOtherVersionVoters(array $OtherVersionVoters): self { $this->OtherVersionVoters = $OtherVersionVoters; return $this; } - /** - * @return string[] - */ public function getOtherVersionNonVoters(): array { return $this->OtherVersionNonVoters; } - /** - * @param string[] $OtherVersionNonVoters - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotZoneUpgradeVersions - */ public function setOtherVersionNonVoters(array $OtherVersionNonVoters): self { $this->OtherVersionNonVoters = $OtherVersionNonVoters; diff --git a/src/Operator/OperatorAreaJoinResponse.php b/src/Operator/OperatorAreaJoinResponse.php index 0cc06cfa..b97836ae 100644 --- a/src/Operator/OperatorAreaJoinResponse.php +++ b/src/Operator/OperatorAreaJoinResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedWriteResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class OperatorAreaJoinResponse - */ class OperatorAreaJoinResponse extends AbstractValuedWriteResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Operator\AreaJoinResponse[]|null */ public ?array $AreaJoinResponses = null; - /** - * @return \DCarbone\PHPConsulAPI\Operator\AreaJoinResponse[]|null - */ public function getValue(): ?array { return $this->AreaJoinResponses; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->AreaJoinResponses = []; diff --git a/src/Operator/OperatorAreasResponse.php b/src/Operator/OperatorAreasResponse.php index d4c86645..9e7417a4 100644 --- a/src/Operator/OperatorAreasResponse.php +++ b/src/Operator/OperatorAreasResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class OperatorAreasResponse - */ class OperatorAreasResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Operator\Area[]|null */ public ?array $Areas = null; - /** - * @return \DCarbone\PHPConsulAPI\Operator\Area[]|null - */ public function getValue(): ?array { return $this->Areas; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->Areas = []; diff --git a/src/Operator/OperatorAutopilotConfigurationResponse.php b/src/Operator/OperatorAutopilotConfigurationResponse.php index b828e866..1bbe27ab 100644 --- a/src/Operator/OperatorAutopilotConfigurationResponse.php +++ b/src/Operator/OperatorAutopilotConfigurationResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class OperatorAutopilotConfigurationResponse - */ class OperatorAutopilotConfigurationResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration|null */ public ?AutopilotConfiguration $AutopilotConfiguration = null; - /** - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration|null - */ public function getValue(): ?AutopilotConfiguration { return $this->AutopilotConfiguration; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->AutopilotConfiguration = new AutopilotConfiguration((array)$decodedData); diff --git a/src/Operator/OperatorClient.php b/src/Operator/OperatorClient.php index abae3181..f4ccf63c 100644 --- a/src/Operator/OperatorClient.php +++ b/src/Operator/OperatorClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -29,31 +29,13 @@ use DCarbone\PHPConsulAPI\WriteOptions; use DCarbone\PHPConsulAPI\WriteResponse; -/** - * Class OperatorClient - */ class OperatorClient extends AbstractClient { - /** - * @param \DCarbone\PHPConsulAPI\Operator\Area $area - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedWriteStringResponse - */ public function AreaCreate(Area $area, ?WriteOptions $opts = null): ValuedWriteStringResponse { return $this->_writeIDResponse($this->_requireOK($this->_doPost('v1/operator/area', $area, $opts))); } - /** - * @param string $areaID - * @param \DCarbone\PHPConsulAPI\Operator\Area $area - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedWriteStringResponse - */ public function AreaUpdate(string $areaID, Area $area, ?WriteOptions $opts = null): ValuedWriteStringResponse { return $this->_writeIDResponse( @@ -61,13 +43,6 @@ public function AreaUpdate(string $areaID, Area $area, ?WriteOptions $opts = nul ); } - /** - * @param string $areaID - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Operator\OperatorAreasResponse - */ public function AreaGet(string $areaID, ?QueryOptions $opts = null): OperatorAreasResponse { $resp = $this->_requireOK($this->_doGet(sprintf('v1/operator/area/%s', urlencode($areaID)), $opts)); @@ -76,12 +51,6 @@ public function AreaGet(string $areaID, ?QueryOptions $opts = null): OperatorAre return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Operator\OperatorAreasResponse - */ public function AreaList(?QueryOptions $opts = null): OperatorAreasResponse { $resp = $this->_requireOK($this->_doGet('v1/operator/area', $opts)); @@ -90,25 +59,11 @@ public function AreaList(?QueryOptions $opts = null): OperatorAreasResponse return $ret; } - /** - * @param string $areaID - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function AreaDelete(string $areaID, ?WriteOptions $opts = null): WriteResponse { return $this->_executeDelete(sprintf('v1/operator/area/%s', $areaID), $opts); } - /** - * @param string $areaID - * @param array $addresses - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Operator\OperatorAreaJoinResponse - */ public function AreaJoin(string $areaID, array $addresses, ?WriteOptions $opts = null): OperatorAreaJoinResponse { $resp = $this->_requireOK($this->_doPut(sprintf('v1/operator/area/%s/join', $areaID), $addresses, $opts)); @@ -117,13 +72,6 @@ public function AreaJoin(string $areaID, array $addresses, ?WriteOptions $opts = return $ret; } - /** - * @param string $areaID - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Operator\OperatorSerfMembersResponse - */ public function AreaMembers(string $areaID, ?QueryOptions $opts = null): OperatorSerfMembersResponse { $resp = $this->_requireOK($this->_doGet(sprintf('v1/operator/area/%s/members', $areaID), $opts)); @@ -132,12 +80,6 @@ public function AreaMembers(string $areaID, ?QueryOptions $opts = null): Operato return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Operator\OperatorAutopilotConfigurationResponse - */ public function AutopilotGetConfiguration(?QueryOptions $opts = null): OperatorAutopilotConfigurationResponse { $resp = $this->_requireOK($this->_doGet('v1/operator/autopilot/configuration', $opts)); @@ -146,25 +88,11 @@ public function AutopilotGetConfiguration(?QueryOptions $opts = null): OperatorA return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration $conf - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @return \DCarbone\PHPConsulAPI\Error|null - * @throws \Exception - * @throws \GuzzleHttp\Exception\GuzzleException - */ public function AutopilotSetConfiguration(AutopilotConfiguration $conf, ?WriteOptions $opts = null): ?Error { return $this->_requireOK($this->_doPut('v1/operator/autopilot/configuration', $conf, $opts))->Err; } - /** - * @param \DCarbone\PHPConsulAPI\Operator\AutopilotConfiguration $conf - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedBoolResponse - */ public function AutopilotCASConfiguration( AutopilotConfiguration $conf, ?WriteOptions $opts = null @@ -175,12 +103,6 @@ public function AutopilotCASConfiguration( return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Operator\OperatorHealthReplyResponse - */ public function AutopilotServerHealth(?QueryOptions $opts = null): OperatorHealthReplyResponse { $resp = $this->_requireOK($this->_doGet('v1/operator/autopilot/health', $opts)); @@ -189,12 +111,6 @@ public function AutopilotServerHealth(?QueryOptions $opts = null): OperatorHealt return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Operator\AutopilotStateResponse - */ public function AutopilotState(?QueryOptions $opts = null): AutopilotStateResponse { $resp = $this->_requireOK($this->_doGet('v1/operator/autopilot/state', $opts)); @@ -203,12 +119,6 @@ public function AutopilotState(?QueryOptions $opts = null): AutopilotStateRespon return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Operator\OperatorRaftConfigurationResponse - */ public function RaftGetConfiguration(?QueryOptions $opts = null): OperatorRaftConfigurationResponse { $resp = $this->_requireOK($this->_doGet('v1/operator/raft/configuration', $opts)); @@ -217,13 +127,6 @@ public function RaftGetConfiguration(?QueryOptions $opts = null): OperatorRaftCo return $ret; } - /** - * @param string $address - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function RaftRemovePeerByAddress(string $address, ?WriteOptions $opts = null): ?Error { $r = $this->_newDeleteRequest('v1/operator/raft/peer', $opts); @@ -232,11 +135,6 @@ public function RaftRemovePeerByAddress(string $address, ?WriteOptions $opts = n return $this->_requireOK($this->_do($r))->Err; } - /** - * @param \DCarbone\PHPConsulAPI\RequestResponse $resp - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedWriteStringResponse - */ protected function _writeIDResponse(RequestResponse $resp): ValuedWriteStringResponse { $ret = new ValuedWriteStringResponse(); diff --git a/src/Operator/OperatorHealthReply.php b/src/Operator/OperatorHealthReply.php index aef2cad6..a837eb7a 100644 --- a/src/Operator/OperatorHealthReply.php +++ b/src/Operator/OperatorHealthReply.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class OperatorHealthReply - */ class OperatorHealthReply extends AbstractModel { protected const FIELDS = [ @@ -38,61 +35,37 @@ class OperatorHealthReply extends AbstractModel private const FIELD_SERVERS = 'Servers'; - /** @var bool */ public bool $Healthy = false; - /** @var int */ public int $FailureTolerance = 0; - /** @var \DCarbone\PHPConsulAPI\Operator\ServerHealth[] */ public array $Servers = []; - /** - * @return bool - */ public function isHealthy(): bool { return $this->Healthy; } - /** - * @param bool $Healthy - * @return \DCarbone\PHPConsulAPI\Operator\OperatorHealthReply - */ public function setHealthy(bool $Healthy): self { $this->Healthy = $Healthy; return $this; } - /** - * @return int - */ public function getFailureTolerance(): int { return $this->FailureTolerance; } - /** - * @param int $FailureTolerance - * @return \DCarbone\PHPConsulAPI\Operator\OperatorHealthReply - */ public function setFailureTolerance(int $FailureTolerance): self { $this->FailureTolerance = $FailureTolerance; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth[] - */ public function getServers(): array { return $this->Servers; } - /** - * @param \DCarbone\PHPConsulAPI\Operator\ServerHealth[] $Servers - * @return \DCarbone\PHPConsulAPI\Operator\OperatorHealthReply - */ public function setServers(array $Servers): self { $this->Servers = $Servers; diff --git a/src/Operator/OperatorHealthReplyResponse.php b/src/Operator/OperatorHealthReplyResponse.php index 36b3eca3..1a6446cc 100644 --- a/src/Operator/OperatorHealthReplyResponse.php +++ b/src/Operator/OperatorHealthReplyResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class OperatorServerHealthsResponse - */ class OperatorHealthReplyResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Operator\OperatorHealthReply|null */ public ?OperatorHealthReply $OperatorHealthReply = null; - /** - * @return \DCarbone\PHPConsulAPI\Operator\OperatorHealthReply|mixed|null - */ public function getValue(): mixed { return $this->OperatorHealthReply; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->OperatorHealthReply = new OperatorHealthReply((array)$decodedData); diff --git a/src/Operator/OperatorRaftConfigurationResponse.php b/src/Operator/OperatorRaftConfigurationResponse.php index 33a27f1e..114410be 100644 --- a/src/Operator/OperatorRaftConfigurationResponse.php +++ b/src/Operator/OperatorRaftConfigurationResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class OperatorRaftConfigurationResponse - */ class OperatorRaftConfigurationResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Operator\RaftConfiguration|null */ public ?RaftConfiguration $RaftConfiguration = null; - /** - * @return \DCarbone\PHPConsulAPI\Operator\RaftConfiguration|null - */ public function getValue(): ?RaftConfiguration { return $this->RaftConfiguration; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->RaftConfiguration = new RaftConfiguration($decodedData); diff --git a/src/Operator/OperatorSerfMembersResponse.php b/src/Operator/OperatorSerfMembersResponse.php index 2e44e827..5c875222 100644 --- a/src/Operator/OperatorSerfMembersResponse.php +++ b/src/Operator/OperatorSerfMembersResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class OperatorSerfMembersResponse - */ class OperatorSerfMembersResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Operator\SerfMember[]|null */ public ?array $SerfMembers = null; - /** - * @return \DCarbone\PHPConsulAPI\Operator\SerfMember[]|null - */ public function getValue(): ?array { return $this->SerfMembers; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->SerfMembers = []; diff --git a/src/Operator/OperatorServerHealthsResponse.php b/src/Operator/OperatorServerHealthsResponse.php index 5aa6b646..c1010a68 100644 --- a/src/Operator/OperatorServerHealthsResponse.php +++ b/src/Operator/OperatorServerHealthsResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class OperatorServerHealthsResponse - */ class OperatorServerHealthsResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Operator\ServerHealth[]|null */ public ?array $ServerHealths = null; - /** - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth[]|null - */ public function getValue(): ?array { return $this->ServerHealths; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->ServerHealths = []; diff --git a/src/Operator/RaftConfiguration.php b/src/Operator/RaftConfiguration.php index 4f1f2487..525f4e4a 100644 --- a/src/Operator/RaftConfiguration.php +++ b/src/Operator/RaftConfiguration.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class RaftConfiguration - */ class RaftConfiguration extends AbstractModel { protected const FIELDS = [ @@ -38,41 +35,25 @@ class RaftConfiguration extends AbstractModel private const FIELD_SERVERS = 'Servers'; - /** @var \DCarbone\PHPConsulAPI\Operator\RaftServer[] */ public array $Servers = []; - /** @var int */ public int $Index = 0; - /** - * @return \DCarbone\PHPConsulAPI\Operator\RaftServer[] - */ public function getServers(): array { return $this->Servers; } - /** - * @param \DCarbone\PHPConsulAPI\Operator\RaftServer[] $Servers - * @return \DCarbone\PHPConsulAPI\Operator\RaftConfiguration - */ public function setServers(array $Servers): self { $this->Servers = $Servers; return $this; } - /** - * @return int - */ public function getIndex(): int { return $this->Index; } - /** - * @param int $Index - * @return \DCarbone\PHPConsulAPI\Operator\RaftConfiguration - */ public function setIndex(int $Index): self { $this->Index = $Index; diff --git a/src/Operator/RaftServer.php b/src/Operator/RaftServer.php index 152235b3..9fa59d0a 100644 --- a/src/Operator/RaftServer.php +++ b/src/Operator/RaftServer.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,126 +22,75 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class RaftServer - */ class RaftServer extends AbstractModel { - /** @var string */ public string $ID = ''; - /** @var string */ public string $Node = ''; - /** @var string */ public string $Address = ''; - /** @var bool */ public bool $Leader = false; - /** @var string */ public string $ProtocolVersion = ''; - /** @var bool */ public bool $Voter = false; - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\Operator\RaftServer - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getNode(): string { return $this->Node; } - /** - * @param string $Node - * @return \DCarbone\PHPConsulAPI\Operator\RaftServer - */ public function setNode(string $Node): self { $this->Node = $Node; return $this; } - /** - * @return string - */ public function getAddress(): string { return $this->Address; } - /** - * @param string $Address - * @return \DCarbone\PHPConsulAPI\Operator\RaftServer - */ public function setAddress(string $Address): self { $this->Address = $Address; return $this; } - /** - * @return bool - */ public function isLeader(): bool { return $this->Leader; } - /** - * @param bool $Leader - * @return \DCarbone\PHPConsulAPI\Operator\RaftServer - */ public function setLeader(bool $Leader): self { $this->Leader = $Leader; return $this; } - /** - * @return string - */ public function getProtocolVersion(): string { return $this->ProtocolVersion; } - /** - * @param string $ProtocolVersion - * @return \DCarbone\PHPConsulAPI\Operator\RaftServer - */ public function setProtocolVersion(string $ProtocolVersion): self { $this->ProtocolVersion = $ProtocolVersion; return $this; } - /** - * @return bool - */ public function isVoter(): bool { return $this->Voter; } - /** - * @param bool $Voter - * @return \DCarbone\PHPConsulAPI\Operator\RaftServer - */ public function setVoter(bool $Voter): self { $this->Voter = $Voter; diff --git a/src/Operator/ReadableDuration.php b/src/Operator/ReadableDuration.php index f5c83723..303c6720 100644 --- a/src/Operator/ReadableDuration.php +++ b/src/Operator/ReadableDuration.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,33 +23,18 @@ use DCarbone\Go\Time; use DCarbone\PHPConsulAPI\ScalarType; -/** - * Class ReadableDuration - */ class ReadableDuration extends Time\Duration implements \JsonSerializable, ScalarType { - /** - * @param object $instance - * @param string $field - * @param mixed $value - */ public static function unmarshalJSON(object $instance, string $field, mixed $value): void { $instance->{$field} = new self(\intval($value, 10)); } - /** - * @param string $s - * @return \DCarbone\PHPConsulAPI\Operator\ReadableDuration - */ public static function fromDuration(string $s): self { return new self(Time::ParseDuration($s)->Nanoseconds()); } - /** - * @return string - */ public function jsonSerialize(): string { return (string)$this; diff --git a/src/Operator/SerfMember.php b/src/Operator/SerfMember.php index b4e568c6..3c22bf53 100644 --- a/src/Operator/SerfMember.php +++ b/src/Operator/SerfMember.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class SerfMember - */ class SerfMember extends AbstractModel { protected const FIELDS = [ @@ -37,31 +34,17 @@ class SerfMember extends AbstractModel private const FIELD_RTT = 'RTT'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Addr = ''; - /** @var int */ public int $Port = 0; - /** @var string */ public string $Datacenter = ''; - /** @var string */ public string $Role = ''; - /** @var string */ public string $Build = ''; - /** @var int */ public int $Protocol = 0; - /** @var string */ public string $Status = ''; - /** @var \DCarbone\Go\Time\Duration */ public Time\Duration $RTT; - /** - * SerfMember constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -70,180 +53,110 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\Operator\SerfMember - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\Operator\SerfMember - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getAddr(): string { return $this->Addr; } - /** - * @param string $Addr - * @return \DCarbone\PHPConsulAPI\Operator\SerfMember - */ public function setAddr(string $Addr): self { $this->Addr = $Addr; return $this; } - /** - * @return int - */ public function getPort(): int { return $this->Port; } - /** - * @param int $Port - * @return \DCarbone\PHPConsulAPI\Operator\SerfMember - */ public function setPort(int $Port): self { $this->Port = $Port; return $this; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @param string $Datacenter - * @return \DCarbone\PHPConsulAPI\Operator\SerfMember - */ public function setDatacenter(string $Datacenter): self { $this->Datacenter = $Datacenter; return $this; } - /** - * @return string - */ public function getRole(): string { return $this->Role; } - /** - * @param string $Role - * @return \DCarbone\PHPConsulAPI\Operator\SerfMember - */ public function setRole(string $Role): self { $this->Role = $Role; return $this; } - /** - * @return string - */ public function getBuild(): string { return $this->Build; } - /** - * @param string $Build - * @return \DCarbone\PHPConsulAPI\Operator\SerfMember - */ public function setBuild(string $Build): self { $this->Build = $Build; return $this; } - /** - * @return int - */ public function getProtocol(): int { return $this->Protocol; } - /** - * @param int $Protocol - * @return \DCarbone\PHPConsulAPI\Operator\SerfMember - */ public function setProtocol(int $Protocol): self { $this->Protocol = $Protocol; return $this; } - /** - * @return string - */ public function getStatus(): string { return $this->Status; } - /** - * @param string $Status - * @return \DCarbone\PHPConsulAPI\Operator\SerfMember - */ public function setStatus(string $Status): self { $this->Status = $Status; return $this; } - /** - * @return \DCarbone\Go\Time\Duration - */ public function getRTT(): Time\Duration { return $this->RTT; } - /** - * @param \DCarbone\Go\Time\Duration $RTT - * @return \DCarbone\PHPConsulAPI\Operator\SerfMember - */ public function setRTT(Time\Duration $RTT): self { $this->RTT = $RTT; diff --git a/src/Operator/ServerHealth.php b/src/Operator/ServerHealth.php index b3d45dfc..e50af771 100644 --- a/src/Operator/ServerHealth.php +++ b/src/Operator/ServerHealth.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Operator; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServerHealth - */ class ServerHealth extends AbstractModel { protected const FIELDS = [ @@ -42,35 +39,19 @@ class ServerHealth extends AbstractModel private const FIELD_LAST_CONTACT = 'LastContact'; private const FIELD_STABLE_SINCE = 'StableSince'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Address = ''; - /** @var string */ public string $SerfStatus = ''; - /** @var string */ public string $Version = ''; - /** @var bool */ public bool $Leader = false; - /** @var \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null */ public ?ReadableDuration $LastContact = null; - /** @var int */ public int $LastTerm = 0; - /** @var int */ public int $LastIndex = 0; - /** @var bool */ public bool $Healthy = false; - /** @var bool */ public bool $Voter = false; - /** @var \DCarbone\Go\Time\Time */ public Time\Time $StableSince; - /** - * ServerHealth constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -79,216 +60,132 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getAddress(): string { return $this->Address; } - /** - * @param string $Address - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth - */ public function setAddress(string $Address): self { $this->Address = $Address; return $this; } - /** - * @return string - */ public function getSerfStatus(): string { return $this->SerfStatus; } - /** - * @param string $SerfStatus - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth - */ public function setSerfStatus(string $SerfStatus): self { $this->SerfStatus = $SerfStatus; return $this; } - /** - * @return string - */ public function getVersion(): string { return $this->Version; } - /** - * @param string $Version - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth - */ public function setVersion(string $Version): self { $this->Version = $Version; return $this; } - /** - * @return bool - */ public function isLeader(): bool { return $this->Leader; } - /** - * @param bool $Leader - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth - */ public function setLeader(bool $Leader): self { $this->Leader = $Leader; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null - */ public function getLastContact(): ?ReadableDuration { return $this->LastContact; } - /** - * @param \DCarbone\PHPConsulAPI\Operator\ReadableDuration|null $LastContact - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth - */ public function setLastContact(?ReadableDuration $LastContact): self { $this->LastContact = $LastContact; return $this; } - /** - * @return int - */ public function getLastTerm(): int { return $this->LastTerm; } - /** - * @param int $LastTerm - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth - */ public function setLastTerm(int $LastTerm): self { $this->LastTerm = $LastTerm; return $this; } - /** - * @return int - */ public function getLastIndex(): int { return $this->LastIndex; } - /** - * @param int $LastIndex - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth - */ public function setLastIndex(int $LastIndex): self { $this->LastIndex = $LastIndex; return $this; } - /** - * @return bool - */ public function isHealthy(): bool { return $this->Healthy; } - /** - * @param bool $Healthy - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth - */ public function setHealthy(bool $Healthy): self { $this->Healthy = $Healthy; return $this; } - /** - * @return bool - */ public function isVoter(): bool { return $this->Voter; } - /** - * @param bool $Voter - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth - */ public function setVoter(bool $Voter): self { $this->Voter = $Voter; return $this; } - /** - * @return \DCarbone\Go\Time\Time - */ public function getStableSince(): Time\Time { return $this->StableSince; } - /** - * @param \DCarbone\Go\Time\Time $StableSince - * @return \DCarbone\PHPConsulAPI\Operator\ServerHealth - */ public function setStableSince(Time\Time $StableSince): self { $this->StableSince = $StableSince; diff --git a/src/Params.php b/src/Params.php index 04163e32..35f02f06 100644 --- a/src/Params.php +++ b/src/Params.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,15 +20,8 @@ limitations under the License. */ -/** - * Class Params - */ class Params extends Values { - /** - * @param string $v - * @return string - */ protected function encode(string $v): string { return urlencode($v); diff --git a/src/PreparedQuery/PreparedQueryClient.php b/src/PreparedQuery/PreparedQueryClient.php index 515a5d56..e35585c7 100644 --- a/src/PreparedQuery/PreparedQueryClient.php +++ b/src/PreparedQuery/PreparedQueryClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\PreparedQuery; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,18 +26,8 @@ use DCarbone\PHPConsulAPI\WriteOptions; use DCarbone\PHPConsulAPI\WriteResponse; -/** - * Class PreparedQueryClient - */ class PreparedQueryClient extends AbstractClient { - /** - * @param \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinition $query - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedWriteStringResponse - */ public function Create(PreparedQueryDefinition $query, ?WriteOptions $opts = null): ValuedWriteStringResponse { $resp = $this->_requireOK($this->_doPost('v1/query', $query, $opts)); @@ -46,23 +36,11 @@ public function Create(PreparedQueryDefinition $query, ?WriteOptions $opts = nul return $ret; } - /** - * @param \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinition $query - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Update(PreparedQueryDefinition $query, ?WriteOptions $opts = null): WriteResponse { return $this->_executePut('v1/query', $query, $opts); } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinitionsResponse - */ public function List(?QueryOptions $opts = null): PreparedQueryDefinitionsResponse { $resp = $this->_doGet('v1/query', $opts); @@ -71,13 +49,6 @@ public function List(?QueryOptions $opts = null): PreparedQueryDefinitionsRespon return $ret; } - /** - * @param string $queryID - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinitionsResponse - */ public function Get(string $queryID, ?QueryOptions $opts = null): PreparedQueryDefinitionsResponse { $resp = $this->_doGet(sprintf('v1/query/%s', $queryID), $opts); @@ -86,24 +57,11 @@ public function Get(string $queryID, ?QueryOptions $opts = null): PreparedQueryD return $ret; } - /** - * @param string $queryID - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Delete(string $queryID, ?WriteOptions $opts = null): WriteResponse { return $this->_executeDelete(sprintf('v1/query/%s', $queryID), $opts); } - /** - * @param string $queryIDOrName - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryExecuteResponseResponse - */ public function Execute(string $queryIDOrName, ?QueryOptions $opts = null): PreparedQueryExecuteResponseResponse { $resp = $this->_doGet(sprintf('v1/query/%s/execute', $queryIDOrName), $opts); diff --git a/src/PreparedQuery/PreparedQueryDefinition.php b/src/PreparedQuery/PreparedQueryDefinition.php index 25df1053..236b1ca1 100644 --- a/src/PreparedQuery/PreparedQueryDefinition.php +++ b/src/PreparedQuery/PreparedQueryDefinition.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\PreparedQuery; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,9 +23,6 @@ use DCarbone\PHPConsulAPI\AbstractModel; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class PreparedQueryDefinition - */ class PreparedQueryDefinition extends AbstractModel { protected const FIELDS = [ @@ -47,25 +44,14 @@ class PreparedQueryDefinition extends AbstractModel private const FIELD_DNS = 'DNS'; private const FIELD_Template = 'Template'; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Session = ''; - /** @var string */ public string $Token = ''; - /** @var \DCarbone\PHPConsulAPI\PreparedQuery\ServiceQuery */ public ServiceQuery $Service; - /** @var \DCarbone\PHPConsulAPI\PreparedQuery\QueryDNSOptions */ public QueryDNSOptions $DNS; - /** @var \DCarbone\PHPConsulAPI\PreparedQuery\QueryTemplate */ public QueryTemplate $Template; - /** - * PreparedQueryDefinition constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -80,126 +66,77 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinition - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinition - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getSession(): string { return $this->Session; } - /** - * @param string $Session - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinition - */ public function setSession(string $Session): self { $this->Session = $Session; return $this; } - /** - * @return string - */ public function getToken(): string { return $this->Token; } - /** - * @param string $Token - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinition - */ public function setToken(string $Token): self { $this->Token = $Token; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\PreparedQuery\ServiceQuery - */ public function getService(): ServiceQuery { return $this->Service; } - /** - * @param \DCarbone\PHPConsulAPI\PreparedQuery\ServiceQuery $Service - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinition - */ public function setService(ServiceQuery $Service): self { $this->Service = $Service; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\PreparedQuery\QueryDNSOptions - */ public function getDNS(): QueryDNSOptions { return $this->DNS; } - /** - * @param \DCarbone\PHPConsulAPI\PreparedQuery\QueryDNSOptions $DNS - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinition - */ public function setDNS(QueryDNSOptions $DNS): self { $this->DNS = $DNS; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\PreparedQuery\QueryTemplate - */ public function getTemplate(): QueryTemplate { return $this->Template; } - /** - * @param \DCarbone\PHPConsulAPI\PreparedQuery\QueryTemplate $Template - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinition - */ public function setTemplate(QueryTemplate $Template): self { $this->Template = $Template; diff --git a/src/PreparedQuery/PreparedQueryDefinitionsResponse.php b/src/PreparedQuery/PreparedQueryDefinitionsResponse.php index 16a6f4de..eb04548e 100644 --- a/src/PreparedQuery/PreparedQueryDefinitionsResponse.php +++ b/src/PreparedQuery/PreparedQueryDefinitionsResponse.php @@ -3,7 +3,7 @@ declare(strict_types=1); /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class PreparedQueryDefinitionsResponse - */ class PreparedQueryDefinitionsResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinition[]|null */ public ?array $PreparedQueryDefinitions = null; - /** - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryDefinition[]|null - */ public function getValue(): ?array { return $this->PreparedQueryDefinitions; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->PreparedQueryDefinitions = []; diff --git a/src/PreparedQuery/PreparedQueryExecuteResponse.php b/src/PreparedQuery/PreparedQueryExecuteResponse.php index 284fc4bc..1a28093b 100644 --- a/src/PreparedQuery/PreparedQueryExecuteResponse.php +++ b/src/PreparedQuery/PreparedQueryExecuteResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\PreparedQuery; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,9 +24,6 @@ use DCarbone\PHPConsulAPI\Health\ServiceEntry; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class PreparedQueryExecuteResponse - */ class PreparedQueryExecuteResponse extends AbstractModel { protected const FIELDS = [ @@ -46,23 +43,13 @@ class PreparedQueryExecuteResponse extends AbstractModel private const FIELD_NODES = 'Nodes'; private const FIELD_DNS = 'DNS'; - /** @var string */ public string $Service = ''; - /** @var string */ public string $Namespace = ''; - /** @var \DCarbone\PHPConsulAPI\Health\ServiceEntry[] */ public array $Nodes = []; - /** @var \DCarbone\PHPConsulAPI\PreparedQuery\QueryDNSOptions */ public QueryDNSOptions $DNS; - /** @var string */ public string $Datacenter = ''; - /** @var int */ public int $Failovers = 0; - /** - * PreparedQueryExecuteResponse constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -71,108 +58,66 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getService(): string { return $this->Service; } - /** - * @param string $Service - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryExecuteResponse - */ public function setService(string $Service): self { $this->Service = $Service; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryExecuteResponse - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Health\ServiceEntry[] - */ public function getNodes(): array { return $this->Nodes; } - /** - * @param \DCarbone\PHPConsulAPI\Health\ServiceEntry[] $Nodes - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryExecuteResponse - */ public function setNodes(array $Nodes): self { $this->Nodes = $Nodes; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\PreparedQuery\QueryDNSOptions - */ public function getDNS(): QueryDNSOptions { return $this->DNS; } - /** - * @param \DCarbone\PHPConsulAPI\PreparedQuery\QueryDNSOptions $DNS - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryExecuteResponse - */ public function setDNS(QueryDNSOptions $DNS): self { $this->DNS = $DNS; return $this; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @param string $Datacenter - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryExecuteResponse - */ public function setDatacenter(string $Datacenter): self { $this->Datacenter = $Datacenter; return $this; } - /** - * @return int - */ public function getFailovers(): int { return $this->Failovers; } - /** - * @param int $Failovers - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryExecuteResponse - */ public function setFailovers(int $Failovers): self { $this->Failovers = $Failovers; diff --git a/src/PreparedQuery/PreparedQueryExecuteResponseResponse.php b/src/PreparedQuery/PreparedQueryExecuteResponseResponse.php index aa095b59..c5f66b20 100644 --- a/src/PreparedQuery/PreparedQueryExecuteResponseResponse.php +++ b/src/PreparedQuery/PreparedQueryExecuteResponseResponse.php @@ -3,7 +3,7 @@ declare(strict_types=1); /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class PreparedQueryExecuteResponseResponse - */ class PreparedQueryExecuteResponseResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryExecuteResponse|null */ public ?PreparedQueryExecuteResponse $PreparedQueryExecuteResponse = null; - /** - * @return \DCarbone\PHPConsulAPI\PreparedQuery\PreparedQueryExecuteResponse|null - */ public function getValue(): ?PreparedQueryExecuteResponse { return $this->PreparedQueryExecuteResponse; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->PreparedQueryExecuteResponse = new PreparedQueryExecuteResponse((array)$decodedData); diff --git a/src/PreparedQuery/QueryDNSOptions.php b/src/PreparedQuery/QueryDNSOptions.php index b34af75b..729f29b8 100644 --- a/src/PreparedQuery/QueryDNSOptions.php +++ b/src/PreparedQuery/QueryDNSOptions.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\PreparedQuery; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,35 +22,21 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class QueryDNSOptions - */ class QueryDNSOptions extends AbstractModel { - /** @var string */ public string $TTL = ''; - /** - * @return string - */ public function getTTL(): string { return $this->TTL; } - /** - * @param string $ttl - * @return \DCarbone\PHPConsulAPI\PreparedQuery\QueryDNSOptions - */ public function setTTL(string $ttl): self { $this->TTL = $ttl; return $this; } - /** - * @return string - */ public function __toString(): string { return $this->TTL; diff --git a/src/PreparedQuery/QueryDatacenterOptions.php b/src/PreparedQuery/QueryDatacenterOptions.php index dd63ab54..f8d67967 100644 --- a/src/PreparedQuery/QueryDatacenterOptions.php +++ b/src/PreparedQuery/QueryDatacenterOptions.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\PreparedQuery; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,56 +22,33 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class QueryDatacenterOptions - */ class QueryDatacenterOptions extends AbstractModel { - /** @var int */ public int $NearestN = 0; - /** @var string[] */ public array $Datacenters = []; - /** - * @return int - */ public function getNearestN(): int { return $this->NearestN; } - /** - * @param int $nearestN - * @return \DCarbone\PHPConsulAPI\PreparedQuery\QueryDatacenterOptions - */ public function setNearestN(int $nearestN): self { $this->NearestN = $nearestN; return $this; } - /** - * @return string[] - */ public function getDatacenters(): array { return $this->Datacenters; } - /** - * @param string[] $datacenters - * @return \DCarbone\PHPConsulAPI\PreparedQuery\QueryDatacenterOptions - */ public function setDatacenters(array $datacenters): self { $this->Datacenters = $datacenters; return $this; } - /** - * @param string $datacenter - * @return \DCarbone\PHPConsulAPI\PreparedQuery\QueryDatacenterOptions - */ public function addDatacenter(string $datacenter): self { $this->Datacenters[] = $datacenter; diff --git a/src/PreparedQuery/QueryTemplate.php b/src/PreparedQuery/QueryTemplate.php index 9a7909a8..b6ddbada 100644 --- a/src/PreparedQuery/QueryTemplate.php +++ b/src/PreparedQuery/QueryTemplate.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\PreparedQuery; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,46 +22,27 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class QueryTemplate - */ class QueryTemplate extends AbstractModel { - /** @var string */ public string $Type = ''; - /** @var string */ public string $Regexp = ''; - /** - * @return string - */ public function getType(): string { return $this->Type; } - /** - * @param string $Type - * @return \DCarbone\PHPConsulAPI\PreparedQuery\QueryTemplate - */ public function setType(string $Type): self { $this->Type = $Type; return $this; } - /** - * @return string - */ public function getRegexp(): string { return $this->Regexp; } - /** - * @param string $Regexp - * @return \DCarbone\PHPConsulAPI\PreparedQuery\QueryTemplate - */ public function setRegexp(string $Regexp): self { $this->Regexp = $Regexp; diff --git a/src/PreparedQuery/ServiceQuery.php b/src/PreparedQuery/ServiceQuery.php index 8fc0f80d..f3c9f612 100644 --- a/src/PreparedQuery/ServiceQuery.php +++ b/src/PreparedQuery/ServiceQuery.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\PreparedQuery; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,9 +25,6 @@ use DCarbone\PHPConsulAPI\HasStringTags; use DCarbone\PHPConsulAPI\Transcoding; -/** - * Class ServiceQuery - */ class ServiceQuery extends AbstractModel { use HasSettableStringTags; @@ -44,29 +41,16 @@ class ServiceQuery extends AbstractModel private const FIELD_NAMESPACE = 'Namespace'; private const FIELD_FAILOVER = 'Failover'; - /** @var string */ public string $Service = ''; - /** @var string */ public string $Namespace = ''; - /** @var string */ public string $Near = ''; - /** @var string[] */ public array $IgnoreCheckIDs = []; - /** @var \DCarbone\PHPConsulAPI\PreparedQuery\QueryDatacenterOptions */ public QueryDatacenterOptions $Failover; - /** @var bool */ public bool $OnlyPassing = false; - /** @var array */ public array $NodeMeta = []; - /** @var array */ public array $ServiceMeta = []; - /** @var bool */ public bool $Connect = false; - /** - * ServiceQuery constructor. - * @param array|null $data - */ public function __construct(?array $data = []) { parent::__construct($data); @@ -75,162 +59,99 @@ public function __construct(?array $data = []) } } - /** - * @return string - */ public function getService(): string { return $this->Service; } - /** - * @param string $Service - * @return \DCarbone\PHPConsulAPI\PreparedQuery\ServiceQuery - */ public function setService(string $Service): self { $this->Service = $Service; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\PreparedQuery\ServiceQuery - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return string - */ public function getNear(): string { return $this->Near; } - /** - * @param string $Near - * @return \DCarbone\PHPConsulAPI\PreparedQuery\ServiceQuery - */ public function setNear(string $Near): self { $this->Near = $Near; return $this; } - /** - * @return string[] - */ public function getIgnoreCheckIDs(): array { return $this->IgnoreCheckIDs; } - /** - * @param string[] $IgnoreCheckIDs - * @return \DCarbone\PHPConsulAPI\PreparedQuery\ServiceQuery - */ public function setIgnoreCheckIDs(array $IgnoreCheckIDs): self { $this->IgnoreCheckIDs = $IgnoreCheckIDs; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\PreparedQuery\QueryDatacenterOptions - */ public function getFailover(): QueryDatacenterOptions { return $this->Failover; } - /** - * @param \DCarbone\PHPConsulAPI\PreparedQuery\QueryDatacenterOptions $Failover - * @return \DCarbone\PHPConsulAPI\PreparedQuery\ServiceQuery - */ public function setFailover(QueryDatacenterOptions $Failover): self { $this->Failover = $Failover; return $this; } - /** - * @return bool - */ public function isOnlyPassing(): bool { return $this->OnlyPassing; } - /** - * @param bool $OnlyPassing - * @return \DCarbone\PHPConsulAPI\PreparedQuery\ServiceQuery - */ public function setOnlyPassing(bool $OnlyPassing): self { $this->OnlyPassing = $OnlyPassing; return $this; } - /** - * @return array - */ public function getNodeMeta(): array { return $this->NodeMeta; } - /** - * @param array $NodeMeta - * @return \DCarbone\PHPConsulAPI\PreparedQuery\ServiceQuery - */ public function setNodeMeta(array $NodeMeta): self { $this->NodeMeta = $NodeMeta; return $this; } - /** - * @return array - */ public function getServiceMeta(): array { return $this->ServiceMeta; } - /** - * @param array $ServiceMeta - * @return \DCarbone\PHPConsulAPI\PreparedQuery\ServiceQuery - */ public function setServiceMeta(array $ServiceMeta): self { $this->ServiceMeta = $ServiceMeta; return $this; } - /** - * @return bool - */ public function isConnect(): bool { return $this->Connect; } - /** - * @param bool $Connect - * @return \DCarbone\PHPConsulAPI\PreparedQuery\ServiceQuery - */ public function setConnect(bool $Connect): self { $this->Connect = $Connect; diff --git a/src/QueryMeta.php b/src/QueryMeta.php index c28f00ca..ea23adef 100644 --- a/src/QueryMeta.php +++ b/src/QueryMeta.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,97 +22,58 @@ use DCarbone\Go\Time; -/** - * Class QueryMeta - */ class QueryMeta { - /** @var string */ public string $RequestUrl = ''; - /** @var int */ public int $LastIndex = 0; - /** @var string */ public string $LastContentHash = ''; - /** @var int */ public int $LastContact = 0; - /** @var bool */ public bool $KnownLeader = false; - /** @var \DCarbone\Go\Time\Duration|null */ public ?Time\Duration $RequestTime = null; - /** @var bool */ public bool $AddressTranslationEnabled = false; - /** @var bool */ public bool $CacheHit = false; - /** @var \DCarbone\Go\Time\Duration|null */ public ?Time\Duration $CacheAge = null; - /** - * @return string - */ public function getRequestUrl(): string { return $this->RequestUrl; } - /** - * @return int - */ public function getLastIndex(): int { return $this->LastIndex; } - /** - * @return string - */ public function getLastContentHash(): string { return $this->LastContentHash; } - /** - * @return int - */ public function getLastContact(): int { return $this->LastContact; } - /** - * @return bool - */ public function isKnownLeader(): bool { return $this->KnownLeader; } - /** - * @return \DCarbone\Go\Time\Duration|null - */ public function getRequestTime(): ?Time\Duration { return $this->RequestTime; } - /** - * @return bool - */ public function isAddressTranslationEnabled(): bool { return $this->AddressTranslationEnabled; } - /** - * @return bool - */ public function isCacheHit(): bool { return $this->CacheHit; } - /** - * @return \DCarbone\Go\Time\Duration|null - */ public function getCacheAge(): ?Time\Duration { return $this->CacheAge; diff --git a/src/QueryMetaContainer.php b/src/QueryMetaContainer.php index 9f1767cb..57bcc958 100644 --- a/src/QueryMetaContainer.php +++ b/src/QueryMetaContainer.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,17 +20,10 @@ limitations under the License. */ -/** - * Trait QueryMetaContainer - */ trait QueryMetaContainer { - /** @var \DCarbone\PHPConsulAPI\QueryMeta|null */ public ?QueryMeta $QueryMeta = null; - /** - * @return \DCarbone\PHPConsulAPI\QueryMeta|null - */ public function getQueryMeta(): ?QueryMeta { return $this->QueryMeta; diff --git a/src/QueryOptions.php b/src/QueryOptions.php index 08b8b974..cf6fff29 100644 --- a/src/QueryOptions.php +++ b/src/QueryOptions.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,9 +22,6 @@ use DCarbone\Go\Time; -/** - * Class QueryOptions - */ class QueryOptions extends AbstractModel implements RequestOptions { protected const FIELDS = [ @@ -47,51 +44,28 @@ class QueryOptions extends AbstractModel implements RequestOptions private const FIELD_WAIT_TIME = 'WaitTime'; private const FIELD_TIMEOUT = 'Timeout'; - /** @var string */ public string $Namespace = ''; - /** @var string */ public string $Datacenter = ''; - /** @var bool */ public bool $AllowStale = false; - /** @var bool */ public bool $RequireConsistent = false; - /** @var bool */ public bool $UseCache = false; - /** @var \DCarbone\Go\Time\Duration|null */ public ?Time\Duration $MaxAge = null; - /** @var \DCarbone\Go\Time\Duration|null */ public ?Time\Duration $StaleIfError = null; - /** @var int */ public int $WaitIndex = 0; - /** @var string */ public string $WaitHash = ''; - /** @var \DCarbone\Go\Time\Duration|null */ public ?Time\Duration $WaitTime = null; - /** @var string */ public string $Token = ''; - /** @var string */ public string $Near = ''; - /** @var string */ public string $Filter = ''; - /** @var array */ public array $NodeMeta = []; - /** @var int */ public int $RelayFactor = 0; - /** @var bool */ public bool $LocalOnly = false; - /** @var bool */ public bool $Connect = false; - /** @var \DCarbone\Go\Time\Duration|null */ public ?Time\Duration $Timeout = null; - /** @var bool */ public bool $Pretty = false; - /** - * QueryOptions constructor. - * @param array|null $data - */ public function __construct(?array $data = null) { parent::__construct($data); @@ -109,313 +83,196 @@ public function __construct(?array $data = null) } } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $namespace - */ public function setNamespace(string $namespace): void { $this->Namespace = $namespace; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @param string $datacenter - */ public function setDatacenter(string $datacenter): void { $this->Datacenter = $datacenter; } - /** - * @return bool - */ public function isAllowStale(): bool { return $this->AllowStale; } - /** - * @param bool $allowStale - */ public function setAllowStale(bool $allowStale): void { $this->AllowStale = $allowStale; } - /** - * @return bool - */ public function isRequireConsistent(): bool { return $this->RequireConsistent; } - /** - * @param bool $requireConsistent - */ public function setRequireConsistent(bool $requireConsistent): void { $this->RequireConsistent = $requireConsistent; } - /** - * @return bool - */ public function isUseCache(): bool { return $this->UseCache; } - /** - * @param bool $useCache - */ public function setUseCache(bool $useCache): void { $this->UseCache = $useCache; } - /** - * @return \DCarbone\Go\Time\Duration - */ public function getMaxAge(): Time\Duration { return $this->MaxAge; } - /** - * @param float|int|string|\DCarbone\Go\Time\Duration|null $maxAge - */ public function setMaxAge(float|int|string|Time\Duration|null $maxAge): void { $this->MaxAge = Time::Duration($maxAge); } - /** - * @return \DCarbone\Go\Time\Duration - */ public function getStaleIfError(): Time\Duration { return $this->StaleIfError; } - /** - * @param float|int|string|\DCarbone\Go\Time\Duration|null $staleIfError - */ public function setStaleIfError(float|int|string|Time\Duration|null $staleIfError): void { $this->StaleIfError = Time::Duration($staleIfError); } - /** - * @return int - */ public function getWaitIndex(): int { return $this->WaitIndex; } - /** - * @param int $waitIndex - */ public function setWaitIndex(int $waitIndex): void { $this->WaitIndex = $waitIndex; } - /** - * @return \DCarbone\Go\Time\Duration - */ public function getWaitTime(): Time\Duration { return $this->WaitTime; } - /** - * @param mixed $waitTime - */ public function setWaitTime(mixed $waitTime): void { $this->WaitTime = Time::Duration($waitTime); } - /** - * @return string - */ public function getWaitHash(): string { return $this->WaitHash; } - /** - * @param string $waitHash - */ public function setWaitHash(string $waitHash): void { $this->WaitHash = $waitHash; } - /** - * @return string - */ public function getToken(): string { return $this->Token; } - /** - * @param string $token - */ public function setToken(string $token): void { $this->Token = $token; } - /** - * @return string - */ public function getNear(): string { return $this->Near; } - /** - * @param string $near - */ public function setNear(string $near): void { $this->Near = $near; } - /** - * @return string - */ public function getFilter(): string { return $this->Filter; } - /** - * @param string $filter - */ public function setFilter(string $filter): void { $this->Filter = $filter; } - /** - * @return array - */ public function getNodeMeta(): array { return $this->NodeMeta; } - /** - * @param array $nodeMeta - */ public function setNodeMeta(array $nodeMeta): void { $this->NodeMeta = $nodeMeta; } - /** - * @return int - */ public function getRelayFactor(): int { return $this->RelayFactor; } - /** - * @param int $relayFactor - */ public function setRelayFactor(int $relayFactor): void { $this->RelayFactor = $relayFactor; } - /** - * @return bool - */ public function isLocalOnly(): bool { return $this->LocalOnly; } - /** - * @param bool $localOnly - */ public function setLocalOnly(bool $localOnly): void { $this->LocalOnly = $localOnly; } - /** - * @return bool - */ public function isConnect(): bool { return $this->Connect; } - /** - * @param bool $connect - */ public function setConnect(bool $connect): void { $this->Connect = $connect; } - /** - * @return \DCarbone\Go\Time\Duration|null - */ public function getTimeout(): ?Time\Duration { return $this->Timeout; } - /** - * @param float|int|string|\DCarbone\Go\Time\Duration|null $timeout - */ public function setTimeout(float|int|string|Time\Duration|null $timeout): void { $this->Timeout = Time::Duration($timeout); } - /** - * @return bool - */ public function isPretty(): bool { return $this->Pretty; } - /** - * @param bool $pretty - */ public function setPretty(bool $pretty): void { $this->Pretty = $pretty; } - /** - * @param \DCarbone\PHPConsulAPI\Request $r - */ public function apply(Request $r): void { if ('' !== $this->Namespace) { diff --git a/src/Request.php b/src/Request.php index 112e93ff..bae97388 100644 --- a/src/Request.php +++ b/src/Request.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,39 +26,21 @@ use Psr\Http\Message\RequestInterface; use Psr\Http\Message\UriInterface; -/** - * Class Request - */ class Request { - /** @var \DCarbone\PHPConsulAPI\Values */ public Values $header; - /** @var \DCarbone\PHPConsulAPI\Params */ public Params $params; - /** @var \DCarbone\Go\Time\Duration|null */ public ?Time\Duration $timeout = null; - /** @var string */ private string $scheme; - /** @var string */ private string $address; - /** @var string */ private string $path; - /** @var string */ private string $method; - /** @var mixed */ private mixed $body; - /** - * Request constructor. - * @param string $method - * @param string $path - * @param \DCarbone\PHPConsulAPI\Config $config - * @param mixed $body - */ public function __construct(string $method, string $path, Config $config, mixed $body) { $this->scheme = $config->Scheme; @@ -86,49 +68,31 @@ public function __construct(string $method, string $path, Config $config, mixed $this->body = $body; } - /** - * @return string - */ public function getScheme(): string { return $this->scheme; } - /** - * @return string - */ public function getAddress(): string { return $this->address; } - /** - * @return string - */ public function getPath(): string { return $this->path; } - /** - * @return string - */ public function getMethod(): string { return $this->method; } - /** - * @return mixed - */ public function getBody(): mixed { return $this->body; } - /** - * @param \DCarbone\PHPConsulAPI\RequestOptions|null $opts - */ public function applyOptions(?RequestOptions $opts): void { if (null === $opts) { @@ -137,9 +101,6 @@ public function applyOptions(?RequestOptions $opts): void $opts->apply($this); } - /** - * @param string $filter - */ public function filterQuery(string $filter): void { if ('' === $filter) { @@ -148,9 +109,6 @@ public function filterQuery(string $filter): void $this->params->set('filter', $filter); } - /** - * @return \Psr\Http\Message\UriInterface - */ public function getUri(): UriInterface { $uri = "{$this->scheme}://{$this->address}/{$this->path}"; @@ -175,9 +133,6 @@ public function toPsrRequest(): RequestInterface ); } - /** - * @return \DCarbone\PHPConsulAPI\RequestMeta - */ public function meta(): RequestMeta { return new RequestMeta($this->method, $this->getUri()); diff --git a/src/RequestMeta.php b/src/RequestMeta.php index 1de93246..fad1c9d1 100644 --- a/src/RequestMeta.php +++ b/src/RequestMeta.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,46 +22,27 @@ use Psr\Http\Message\UriInterface; -/** - * Class RequestMeta - */ class RequestMeta { - /** @var string */ public string $method; - /** @var \Psr\Http\Message\UriInterface */ public UriInterface $uri; - /** - * RequestMeta constructor. - * @param string $method - * @param \Psr\Http\Message\UriInterface $uri - */ public function __construct(string $method, UriInterface $uri) { $this->method = $method; $this->uri = $uri; } - /** - * @return string - */ public function getMethod(): string { return $this->method; } - /** - * @return \Psr\Http\Message\UriInterface - */ public function getUri(): UriInterface { return $this->uri; } - /** - * @return string - */ public function __toString(): string { return sprintf('%s %s', $this->method, $this->uri); diff --git a/src/RequestOptions.php b/src/RequestOptions.php index f3f91f38..7df99f2a 100644 --- a/src/RequestOptions.php +++ b/src/RequestOptions.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,13 +20,7 @@ limitations under the License. */ -/** - * Interface RequestOptions - */ interface RequestOptions { - /** - * @param \DCarbone\PHPConsulAPI\Request $r - */ public function apply(Request $r): void; } diff --git a/src/RequestResponse.php b/src/RequestResponse.php index 48b24eea..00b3a2e3 100644 --- a/src/RequestResponse.php +++ b/src/RequestResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,27 +23,13 @@ use DCarbone\Go\Time; use Psr\Http\Message\ResponseInterface; -/** - * Class RequestResponse - */ final class RequestResponse { - /** @var \DCarbone\PHPConsulAPI\RequestMeta */ public RequestMeta $RequestMeta; - /** @var \DCarbone\Go\Time\Duration */ public Time\Duration $Duration; - /** @var \Psr\Http\Message\ResponseInterface|null */ public ?ResponseInterface $Response; - /** @var \DCarbone\PHPConsulAPI\Error|null */ public ?Error $Err; - /** - * RequestResponse constructor. - * @param \DCarbone\PHPConsulAPI\RequestMeta $meta - * @param \DCarbone\Go\Time\Duration $dur - * @param \Psr\Http\Message\ResponseInterface|null $resp - * @param \DCarbone\PHPConsulAPI\Error|null $err - */ public function __construct(RequestMeta $meta, Time\Duration $dur, ?ResponseInterface $resp, ?Error $err) { $this->RequestMeta = $meta; @@ -52,43 +38,26 @@ public function __construct(RequestMeta $meta, Time\Duration $dur, ?ResponseInte $this->Err = $err; } - /** - * @return \DCarbone\PHPConsulAPI\RequestMeta - */ public function getRequestMeta(): RequestMeta { return $this->RequestMeta; } - /** - * @return \DCarbone\Go\Time\Duration - */ public function getDuration(): Time\Duration { return $this->Duration; } - /** - * @return \Psr\Http\Message\ResponseInterface|null - */ public function getResponse(): ?ResponseInterface { return $this->Response; } - /** - * @return \DCarbone\PHPConsulAPI\Error|null - */ public function getErr(): ?Error { return $this->Err; } - /** - * Construct a new QueryMeta instance based on this response. - * - * @return \DCarbone\PHPConsulAPI\QueryMeta - */ public function buildQueryMeta(): QueryMeta { // init class @@ -132,11 +101,6 @@ public function buildQueryMeta(): QueryMeta return $qm; } - /** - * Construct a new WriteMeta instance based on this response. - * - * @return \DCarbone\PHPConsulAPI\WriteMeta - */ public function buildWriteMeta(): WriteMeta { $wm = new WriteMeta(); diff --git a/src/ResponseValueBoolTrait.php b/src/ResponseValueBoolTrait.php index 91769580..e4a7c401 100644 --- a/src/ResponseValueBoolTrait.php +++ b/src/ResponseValueBoolTrait.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,25 +20,15 @@ limitations under the License. */ -/** - * Trait ResponseValueBoolTrait - */ trait ResponseValueBoolTrait { - /** @var bool */ public bool $Value = false; - /** - * @return bool - */ public function getValue(): bool { return $this->Value; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { if (\is_bool($decodedData)) { @@ -52,9 +42,6 @@ public function unmarshalValue(mixed $decodedData): void $this->Value = (bool)$decodedData; } - /** - * @return string - */ public function __toString(): string { return $this->Value ? Transcoding::TRUE : Transcoding::FALSE; diff --git a/src/ResponseValueStringTrait.php b/src/ResponseValueStringTrait.php index 73bb985e..804c3f74 100644 --- a/src/ResponseValueStringTrait.php +++ b/src/ResponseValueStringTrait.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,33 +20,20 @@ limitations under the License. */ -/** - * Trait ResponseValueStringTrait - */ trait ResponseValueStringTrait { - /** @var string */ public string $Value = ''; - /** - * @return string - */ public function getValue(): string { return $this->Value; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->Value = (string)$decodedData; } - /** - * @return string - */ public function __toString(): string { return $this->Value; diff --git a/src/ResponseValueStringsTrait.php b/src/ResponseValueStringsTrait.php index 14ee9f6b..83e78a96 100644 --- a/src/ResponseValueStringsTrait.php +++ b/src/ResponseValueStringsTrait.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,25 +20,15 @@ limitations under the License. */ -/** - * Trait ResponseValueStringsTrait - */ trait ResponseValueStringsTrait { - /** @var string[]|null */ public array $Value = []; - /** - * @return string[]|null - */ public function getValue(): ?array { return $this->Value; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->Value = (array)$decodedData; diff --git a/src/ScalarType.php b/src/ScalarType.php index 28200066..3dc28b72 100644 --- a/src/ScalarType.php +++ b/src/ScalarType.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/src/Session/ServiceCheck.php b/src/Session/ServiceCheck.php index e5967564..8aa2f823 100644 --- a/src/Session/ServiceCheck.php +++ b/src/Session/ServiceCheck.php @@ -3,7 +3,7 @@ declare(strict_types=1); /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,46 +22,27 @@ use DCarbone\PHPConsulAPI\AbstractModel; -/** - * Class ServiceCheck - */ class ServiceCheck extends AbstractModel { - /** @var string */ public string $ID = ''; - /** @var string */ public string $Namespace = ''; - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $id - * @return \DCarbone\PHPConsulAPI\Session\ServiceCheck - */ public function setID(string $id): self { $this->ID = $id; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $namespace - * @return \DCarbone\PHPConsulAPI\Session\ServiceCheck - */ public function setNamespace(string $namespace): self { $this->Namespace = $namespace; diff --git a/src/Session/SessionClient.php b/src/Session/SessionClient.php index e8f8b9b6..3c997a0c 100644 --- a/src/Session/SessionClient.php +++ b/src/Session/SessionClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Session; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -28,17 +28,8 @@ use DCarbone\PHPConsulAPI\WriteOptions; use DCarbone\PHPConsulAPI\WriteResponse; -/** - * Class SessionClient - */ class SessionClient extends AbstractClient { - /** - * @param \DCarbone\PHPConsulAPI\Session\SessionEntry|null $sessionEntry - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\ValuedWriteStringResponse - */ public function CreateNoChecks(?SessionEntry $sessionEntry = null, ?WriteOptions $opts = null): ValuedWriteStringResponse { if (null === $sessionEntry) { @@ -54,35 +45,16 @@ public function CreateNoChecks(?SessionEntry $sessionEntry = null, ?WriteOptions return $this->_create('v1/session/create', $body, $opts); } - /** - * @param \DCarbone\PHPConsulAPI\Session\SessionEntry|null $sessionEntry - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\ValuedWriteStringResponse - */ public function Create(?SessionEntry $sessionEntry = null, ?WriteOptions $opts = null): ValuedWriteStringResponse { return $this->_create('v1/session/create', $sessionEntry, $opts); } - /** - * @param string $id - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\WriteResponse - */ public function Destroy(string $id, ?WriteOptions $opts = null): WriteResponse { return $this->_executePut(sprintf('v1/session/destroy/%s', $id), null, $opts); } - /** - * @param string $id - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @return \DCarbone\PHPConsulAPI\Session\SessionEntriesWriteResponse - * @throws \Exception - * @throws \GuzzleHttp\Exception\GuzzleException - */ public function Renew(string $id, ?WriteOptions $opts = null): SessionEntriesWriteResponse { $ret = new SessionEntriesWriteResponse(); @@ -115,45 +87,21 @@ public function Renew(string $id, ?WriteOptions $opts = null): SessionEntriesWri return $ret; } - /** - * @param string $id - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Session\SessionEntriesQueryResponse - */ public function Info(string $id, ?QueryOptions $opts = null): SessionEntriesQueryResponse { return $this->_get(sprintf('v1/session/info/%s', $id), $opts); } - /** - * @param string $node - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Session\SessionEntriesQueryResponse - */ public function Node(string $node, ?QueryOptions $opts = null): SessionEntriesQueryResponse { return $this->_get(sprintf('v1/session/node/%s', $node), $opts); } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\Session\SessionEntriesQueryResponse - */ public function List(?QueryOptions $opts = null): SessionEntriesQueryResponse { return $this->_get('v1/session/list', $opts); } - /** - * @param string $path - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\Session\SessionEntriesQueryResponse - */ private function _get(string $path, ?QueryOptions $opts): SessionEntriesQueryResponse { $resp = $this->_requireOK($this->_doGet($path, $opts)); @@ -162,14 +110,6 @@ private function _get(string $path, ?QueryOptions $opts): SessionEntriesQueryRes return $ret; } - /** - * @param string $path - * @param \DCarbone\PHPConsulAPI\Session\SessionEntry $entry - * @param \DCarbone\PHPConsulAPI\WriteOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedWriteStringResponse - */ private function _create(string $path, SessionEntry $entry, ?WriteOptions $opts): ValuedWriteStringResponse { $resp = $this->_requireOK($this->_doPut($path, $entry->_toAPIPayload(), $opts)); diff --git a/src/Session/SessionEntriesQueryResponse.php b/src/Session/SessionEntriesQueryResponse.php index 264cd84b..6ebeda8b 100644 --- a/src/Session/SessionEntriesQueryResponse.php +++ b/src/Session/SessionEntriesQueryResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Session; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedQueryResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class SessionEntriesQueryResponse - */ class SessionEntriesQueryResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Session\SessionEntry[]|null */ public ?array $SessionEntries = []; - /** - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry[]|null - */ public function getValue(): ?array { return $this->SessionEntries; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->SessionEntries = []; diff --git a/src/Session/SessionEntriesWriteResponse.php b/src/Session/SessionEntriesWriteResponse.php index 4427123f..b5ce2916 100644 --- a/src/Session/SessionEntriesWriteResponse.php +++ b/src/Session/SessionEntriesWriteResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Session; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -23,25 +23,15 @@ use DCarbone\PHPConsulAPI\AbstractValuedWriteResponse; use DCarbone\PHPConsulAPI\UnmarshalledResponseInterface; -/** - * Class SessionEntriesWriteResponse - */ class SessionEntriesWriteResponse extends AbstractValuedWriteResponse implements UnmarshalledResponseInterface { - /** @var \DCarbone\PHPConsulAPI\Session\SessionEntry[]|null */ public ?array $SessionEntries = null; - /** - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry[]|null - */ public function getValue(): ?array { return $this->SessionEntries; } - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void { $this->SessionEntries = []; diff --git a/src/Session/SessionEntry.php b/src/Session/SessionEntry.php index d669469f..e269c2b1 100644 --- a/src/Session/SessionEntry.php +++ b/src/Session/SessionEntry.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Session; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -26,9 +26,6 @@ use function DCarbone\PHPConsulAPI\dur_to_millisecond; -/** - * Class SessionEntry - */ class SessionEntry extends AbstractModel { protected const FIELDS = [ @@ -53,33 +50,18 @@ class SessionEntry extends AbstractModel private const FIELD_TTL = 'TTL'; private const FIELD_NAMESPACE = 'Namespace'; - /** @var int */ public int $CreateIndex = 0; - /** @var string */ public string $ID = ''; - /** @var string */ public string $Name = ''; - /** @var string */ public string $Node = ''; - /** @var \DCarbone\Go\Time\Duration */ public Time\Duration $LockDelay; - /** @var string */ public string $Behavior = ''; - /** @var string */ public string $TTL = ''; - /** @var string */ public string $Namespace = ''; - /** @var string[] */ public array $Checks = []; - /** @var string[] */ public array $NodeChecks = []; - /** @var \DCarbone\PHPConsulAPI\Session\ServiceCheck[] */ public array $ServiceChecks = []; - /** - * SessionEntry constructor. - * @param array|null $data - */ public function __construct(?array $data = null) { parent::__construct($data); @@ -88,207 +70,127 @@ public function __construct(?array $data = null) } } - /** - * @return int - */ public function getCreateIndex(): int { return $this->CreateIndex; } - /** - * @param int $CreateIndex - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry - */ public function setCreateIndex(int $CreateIndex): self { $this->CreateIndex = $CreateIndex; return $this; } - /** - * @return string - */ public function getID(): string { return $this->ID; } - /** - * @param string $ID - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry - */ public function setID(string $ID): self { $this->ID = $ID; return $this; } - /** - * @return string - */ public function getName(): string { return $this->Name; } - /** - * @param string $Name - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry - */ public function setName(string $Name): self { $this->Name = $Name; return $this; } - /** - * @return string - */ public function getNode(): string { return $this->Node; } - /** - * @param string $Node - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry - */ public function setNode(string $Node): self { $this->Node = $Node; return $this; } - /** - * @return \DCarbone\Go\Time\Duration - */ public function getLockDelay(): Time\Duration { return $this->LockDelay; } - /** - * @param \DCarbone\Go\Time\Duration $LockDelay - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry - */ public function setLockDelay(Time\Duration $LockDelay): self { $this->LockDelay = $LockDelay; return $this; } - /** - * @return string - */ public function getBehavior(): string { return $this->Behavior; } - /** - * @param string $Behavior - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry - */ public function setBehavior(string $Behavior): self { $this->Behavior = $Behavior; return $this; } - /** - * @return string - */ public function getTTL(): string { return $this->TTL; } - /** - * @param string $TTL - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry - */ public function setTTL(string $TTL): self { $this->TTL = $TTL; return $this; } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $Namespace - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry - */ public function setNamespace(string $Namespace): self { $this->Namespace = $Namespace; return $this; } - /** - * @return string[] - */ public function getChecks(): array { return $this->Checks; } - /** - * @param string[] $Checks - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry - */ public function setChecks(array $Checks): self { $this->Checks = $Checks; return $this; } - /** - * @return string[] - */ public function getNodeChecks(): array { return $this->NodeChecks; } - /** - * @param string[] $NodeChecks - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry - */ public function setNodeChecks(array $NodeChecks): self { $this->NodeChecks = $NodeChecks; return $this; } - /** - * @return \DCarbone\PHPConsulAPI\Session\ServiceCheck[] - */ public function getServiceChecks(): array { return $this->ServiceChecks; } - /** - * @param \DCarbone\PHPConsulAPI\Session\ServiceCheck[] $ServiceChecks - * @return \DCarbone\PHPConsulAPI\Session\SessionEntry - */ public function setServiceChecks(array $ServiceChecks): self { $this->ServiceChecks = $ServiceChecks; return $this; } - /** - * @return array - */ public function _toAPIPayload(): array { $out = []; diff --git a/src/Status/StatusClient.php b/src/Status/StatusClient.php index a35af8d1..e66e6532 100644 --- a/src/Status/StatusClient.php +++ b/src/Status/StatusClient.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI\Status; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -25,17 +25,8 @@ use DCarbone\PHPConsulAPI\ValuedStringResponse; use DCarbone\PHPConsulAPI\ValuedStringsResponse; -/** - * Class StatusClient - */ class StatusClient extends AbstractClient { - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedStringResponse - */ public function LeaderWithQueryOptions(?QueryOptions $opts): ValuedStringResponse { $resp = $this->_requireOK($this->_doGet('v1/status/leader', $opts)); @@ -44,21 +35,11 @@ public function LeaderWithQueryOptions(?QueryOptions $opts): ValuedStringRespons return $ret; } - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\ValuedStringResponse - */ public function Leader(): ValuedStringResponse { return $this->LeaderWithQueryOptions(null); } - /** - * @param \DCarbone\PHPConsulAPI\QueryOptions|null $opts - * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \Exception - * @return \DCarbone\PHPConsulAPI\ValuedStringsResponse - */ public function PeersWithQueryOptions(?QueryOptions $opts): ValuedStringsResponse { $resp = $this->_requireOK($this->_doGet('v1/status/peers', $opts)); @@ -67,10 +48,6 @@ public function PeersWithQueryOptions(?QueryOptions $opts): ValuedStringsRespons return $ret; } - /** - * @throws \GuzzleHttp\Exception\GuzzleException - * @return \DCarbone\PHPConsulAPI\ValuedStringsResponse - */ public function Peers(): ValuedStringsResponse { return $this->PeersWithQueryOptions(null); diff --git a/src/Transcoding.php b/src/Transcoding.php index 2e0db814..e19c92ac 100644 --- a/src/Transcoding.php +++ b/src/Transcoding.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,9 +22,6 @@ use DCarbone\Go\Time; -/** - * Class Transcoding - */ final class Transcoding { public const STRING = 'string'; @@ -87,21 +84,11 @@ final class Transcoding ] + self::OMITEMPTY_FIELD; public const OMITEMPTY_MAP_FIELD = self::MAP_FIELD + self::OMITEMPTY_FIELD; - /** - * @param string $type - * @return bool - */ public static function isScalar(string $type): bool { return \in_array($type, self::SCALAR, true); } - /** - * @param object $instance - * @param string $field - * @param \DCarbone\Go\Time\Time|string $value - * @throws \Exception - */ public static function unmarshalTime(object $instance, string $field, Time\Time|string $value): void { if ($value instanceof Time\Time) { @@ -111,12 +98,6 @@ public static function unmarshalTime(object $instance, string $field, Time\Time| $instance->{$field} = Time\Time::createFromFormat(\DATE_RFC3339, $value); } - /** - * @param object $instance - * @param string $field - * @param \DCarbone\Go\Time\Time|string|null $value - * @throws \Exception - */ public static function unmarshalNullableTime(object $instance, string $field, Time\Time|string|null $value): void { if (null === $value) { @@ -138,11 +119,6 @@ public static function unmarshalDuration(object $instance, string $field, mixed $instance->{$field} = Time::Duration($value); } - /** - * @param object $instance - * @param string $field - * @param mixed $value - */ public static function unmarshalNullableDuration(object $instance, string $field, mixed $value): void { if (null === $value) { diff --git a/src/UnmarshalledResponseInterface.php b/src/UnmarshalledResponseInterface.php index 58db415f..4c1e616d 100644 --- a/src/UnmarshalledResponseInterface.php +++ b/src/UnmarshalledResponseInterface.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,13 +20,7 @@ limitations under the License. */ -/** - * Interface UnmarshalledResponseInterface - */ interface UnmarshalledResponseInterface { - /** - * @param mixed $decodedData - */ public function unmarshalValue(mixed $decodedData): void; } diff --git a/src/Unmarshaller.php b/src/Unmarshaller.php index 1724ca6f..5b55c234 100644 --- a/src/Unmarshaller.php +++ b/src/Unmarshaller.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -24,19 +24,8 @@ use DCarbone\PHPConsulAPI\KV\KVPair; use DCarbone\PHPConsulAPI\KV\KVTxnOp; -/** - * Used to assist with unmarshalling json responses - * - * Trait Unmarshaller - */ trait Unmarshaller { - /** - * Attempts to unmarshal the provided value into the provided field on the implementing class - * - * @param string $field - * @param mixed $value - */ protected function unmarshalField(string $field, mixed $value): void { if (isset(static::FIELDS[$field])) { @@ -64,91 +53,45 @@ protected function unmarshalField(string $field, mixed $value): void // is seen with a null value, we still want to define it as null on the implementing type. } - /** - * @param array $fieldDef - * @return bool - */ protected function fieldIsNullable(array $fieldDef): bool { // todo: make sure this key is always a bool... return $fieldDef[Transcoding::FIELD_NULLABLE] ?? false; } - /** - * @param string $type - * @return false|float|int|string|null - */ protected static function scalarZeroVal(string $type): float|bool|int|string|null { - if (Transcoding::STRING === $type) { - return ''; - } - if (Transcoding::INTEGER === $type) { - return 0; - } - if (Transcoding::DOUBLE === $type) { - return 0.0; - } - if (Transcoding::BOOLEAN === $type) { - return false; - } - - return null; + return match ($type) { + Transcoding::STRING => '', + Transcoding::INTEGER => 0, + Transcoding::DOUBLE => 0.0, + Transcoding::BOOLEAN => false, + default => null, + }; } - /** - * @param string $field - * @param mixed $value - * @param string $type - * @param bool $nullable - * @return bool|float|int|string - */ private function buildScalarValue(string $field, mixed $value, string $type, bool $nullable): float|bool|int|string|null { - // if the incoming value is null... if (null === $value) { - // ...and this field is nullable, just return null - if ($nullable) { - return null; - } - // otherwise return zero val for this type - return self::scalarZeroVal($type); + return $nullable ? null : self::scalarZeroVal($type); } - if (Transcoding::STRING === $type) { - return (string)$value; - } - if (Transcoding::INTEGER === $type) { - return \intval($value, 10); - } - if (Transcoding::DOUBLE === $type) { - return (float)$value; - } - if (Transcoding::BOOLEAN === $type) { - return (bool)$value; - } + return match ($type) { + Transcoding::STRING => (string)$value, + Transcoding::INTEGER => \intval($value, 10), + Transcoding::DOUBLE => (float)$value, + Transcoding::BOOLEAN => (bool)$value, - // if we fall down to here, default to try to set the value to whatever it happens to be. - return $value; + // if we fall down to here, default to try to set the value to whatever it happens to be. + default => $value, + }; } - /** - * @param string $field - * @param object|array $value - * @param string $class - * @param bool $nullable - * @return object|null - */ - private function buildObjectValue(string $field, object|array $value, string $class, bool $nullable): ?object + private function buildObjectValue(string $field, null|object|array $value, string $class, bool $nullable): ?object { // if the incoming value is null... if (null === $value) { - // ...and this field is nullable, return null - if ($nullable) { - return null; - } - // ... and this field must be an instance of the provided class, return empty new empty instance - return new $class([]); + return $nullable ? null : new $class([]); } // if the incoming value is already an instance of the class, clone it and return if ($value instanceof $class) { @@ -163,13 +106,6 @@ private function buildObjectValue(string $field, object|array $value, string $cl return new $class((array)$value); } - /** - * Handles scalar type field hydration - * - * @param string $field - * @param mixed $value - * @param bool $nullable - */ private function unmarshalScalar(string $field, mixed $value, bool $nullable): void { $this->{$field} = $this->buildScalarValue( @@ -180,13 +116,6 @@ private function unmarshalScalar(string $field, mixed $value, bool $nullable): v ); } - /** - * Handles complex type field hydration - * - * @param string $field - * @param mixed $value - * @param array $def - */ private function unmarshalComplex(string $field, mixed $value, array $def): void { // check if a callable has been defined @@ -250,11 +179,6 @@ private function unmarshalComplex(string $field, mixed $value, array $def): void $this->unmarshalScalar($field, $value, self::fieldIsNullable($def)); } - /** - * @param string $field - * @param mixed $value - * @param array $def - */ private function unmarshalObject(string $field, mixed $value, array $def): void { if (!isset($def[Transcoding::FIELD_CLASS])) { @@ -276,11 +200,6 @@ private function unmarshalObject(string $field, mixed $value, array $def): void ); } - /** - * @param string $field - * @param mixed $value - * @param array $def - */ private function unmarshalArray(string $field, mixed $value, array $def): void { // attempt to extract the two possible keys diff --git a/src/ValuedBoolResponse.php b/src/ValuedBoolResponse.php index 049bee18..a0db756d 100644 --- a/src/ValuedBoolResponse.php +++ b/src/ValuedBoolResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ limitations under the License. */ -/** - * Class ValuedBoolResponse - */ class ValuedBoolResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { use ResponseValueBoolTrait; diff --git a/src/ValuedQueryBoolResponse.php b/src/ValuedQueryBoolResponse.php index bbc861ed..52efc008 100644 --- a/src/ValuedQueryBoolResponse.php +++ b/src/ValuedQueryBoolResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ limitations under the License. */ -/** - * Class ValuedQueryBoolResponse - */ class ValuedQueryBoolResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { use ResponseValueBoolTrait; diff --git a/src/ValuedQueryStringResponse.php b/src/ValuedQueryStringResponse.php index f41b288d..e8edb1a3 100644 --- a/src/ValuedQueryStringResponse.php +++ b/src/ValuedQueryStringResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ limitations under the License. */ -/** - * Class ValuedQueryStringResponse - */ class ValuedQueryStringResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { use ResponseValueStringTrait; diff --git a/src/ValuedQueryStringsResponse.php b/src/ValuedQueryStringsResponse.php index 9f4e6581..afa3ccaf 100644 --- a/src/ValuedQueryStringsResponse.php +++ b/src/ValuedQueryStringsResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ limitations under the License. */ -/** - * Class ValuedQueryStringsResponse - */ class ValuedQueryStringsResponse extends AbstractValuedQueryResponse implements UnmarshalledResponseInterface { use ResponseValueStringsTrait; diff --git a/src/ValuedResponseInterface.php b/src/ValuedResponseInterface.php index b1e1f297..ec14dc77 100644 --- a/src/ValuedResponseInterface.php +++ b/src/ValuedResponseInterface.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,13 +20,7 @@ limitations under the License. */ -/** - * Interface ValuedResponseInterface - */ interface ValuedResponseInterface { - /** - * @return mixed - */ public function getValue(): mixed; } diff --git a/src/ValuedStringResponse.php b/src/ValuedStringResponse.php index 834e1d03..c7a680d8 100644 --- a/src/ValuedStringResponse.php +++ b/src/ValuedStringResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ limitations under the License. */ -/** - * Class ValuedStringResponse - */ class ValuedStringResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { use ResponseValueStringTrait; diff --git a/src/ValuedStringsResponse.php b/src/ValuedStringsResponse.php index 39187cd2..9baf33d2 100644 --- a/src/ValuedStringsResponse.php +++ b/src/ValuedStringsResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ limitations under the License. */ -/** - * Class ValuedStringsResponse - */ class ValuedStringsResponse extends AbstractValuedResponse implements UnmarshalledResponseInterface { use ResponseValueStringsTrait; diff --git a/src/ValuedWriteBoolResponse.php b/src/ValuedWriteBoolResponse.php index 2a80e497..0236ca1f 100644 --- a/src/ValuedWriteBoolResponse.php +++ b/src/ValuedWriteBoolResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ limitations under the License. */ -/** - * Class ValuedWriteBoolResponse - */ class ValuedWriteBoolResponse extends AbstractValuedWriteResponse implements UnmarshalledResponseInterface { use ResponseValueBoolTrait; diff --git a/src/ValuedWriteStringResponse.php b/src/ValuedWriteStringResponse.php index 3b3f3746..d9ec5bbf 100644 --- a/src/ValuedWriteStringResponse.php +++ b/src/ValuedWriteStringResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,9 +20,6 @@ limitations under the License. */ -/** - * Class ValuedWriteStringResponse - */ class ValuedWriteStringResponse extends AbstractValuedWriteResponse implements UnmarshalledResponseInterface { use ResponseValueStringTrait; diff --git a/src/Values.php b/src/Values.php index 559bc1ca..e43fdc08 100644 --- a/src/Values.php +++ b/src/Values.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,18 +20,10 @@ limitations under the License. */ -/** - * Class Values - */ class Values implements \Iterator, \ArrayAccess, \Countable, \JsonSerializable { - /** @var array */ private array $values = []; - /** - * @param string $key - * @return string - */ public function get(string $key): string { if (isset($this->values[$key])) { @@ -41,10 +33,6 @@ public function get(string $key): string return ''; } - /** - * @param string $key - * @return string[] - */ public function getAll(string $key): array { if (isset($this->values[$key])) { @@ -54,19 +42,11 @@ public function getAll(string $key): array return []; } - /** - * @param string $key - * @param string ...$value - */ public function set(string $key, string ...$value): void { $this->values[$key] = $value; } - /** - * @param string $key - * @param string ...$value - */ public function add(string $key, string ...$value): void { if (isset($this->values[$key])) { @@ -76,33 +56,21 @@ public function add(string $key, string ...$value): void } } - /** - * @param string $key - */ public function delete(string $key): void { unset($this->values[$key]); } - /** - * @return int - */ public function count(): int { return \count($this->values); } - /** - * @return array - */ public function toPsr7Array(): array { return $this->values; } - /** - * @return array - */ public function current(): array { return current($this->values); @@ -113,17 +81,11 @@ public function next(): void next($this->values); } - /** - * @return string|null - */ public function key(): ?string { return key($this->values); } - /** - * @return bool - */ public function valid(): bool { return null !== key($this->values); @@ -134,61 +96,36 @@ public function rewind(): void reset($this->values); } - /** - * @param mixed $offset - * @return bool - */ public function offsetExists(mixed $offset): bool { return isset($this->values[$offset]); } - /** - * @param string $offset - * @return string - */ public function offsetGet($offset): string { return $this->get($offset); } - /** - * @param string $offset - * @param string $value - */ public function offsetSet($offset, $value): void { $this->set($offset, $value); } - /** - * @param string $offset - */ public function offsetUnset($offset): void { $this->delete($offset); } - /** - * @return array - */ public function jsonSerialize(): array { return $this->values; } - /** - * @param string $v - * @return string - */ protected function encode(string $v): string { return $v; } - /** - * @return string - */ public function __toString(): string { $str = ''; diff --git a/src/WriteMeta.php b/src/WriteMeta.php index fe6b7b0f..326960ec 100644 --- a/src/WriteMeta.php +++ b/src/WriteMeta.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,17 +22,10 @@ use DCarbone\Go\Time; -/** - * Class WriteMeta - */ class WriteMeta { - /** @var \DCarbone\Go\Time\Duration|null */ public ?Time\Duration $RequestTime = null; - /** - * @return \DCarbone\Go\Time\Duration|null - */ public function getRequestTime(): ?Time\Duration { return $this->RequestTime; diff --git a/src/WriteMetaContainer.php b/src/WriteMetaContainer.php index 8a0227b7..76c5d857 100644 --- a/src/WriteMetaContainer.php +++ b/src/WriteMetaContainer.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,17 +20,10 @@ limitations under the License. */ -/** - * Trait WriteMetaContainer - */ trait WriteMetaContainer { - /** @var \DCarbone\PHPConsulAPI\WriteMeta|null */ public ?WriteMeta $WriteMeta = null; - /** - * @return \DCarbone\PHPConsulAPI\WriteMeta|null - */ public function getWriteMeta(): ?WriteMeta { return $this->WriteMeta; diff --git a/src/WriteOptions.php b/src/WriteOptions.php index 541c8ae9..6b750702 100644 --- a/src/WriteOptions.php +++ b/src/WriteOptions.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,27 +22,15 @@ use DCarbone\Go\Time; -/** - * Class WriteOptions - */ class WriteOptions extends AbstractModel implements RequestOptions { - /** @var string */ public string $Namespace = ''; - /** @var string */ public string $Datacenter = ''; - /** @var string */ public string $Token = ''; - /** @var int */ public int $RelayFactor = 0; - /** @var \DCarbone\Go\Time\Duration|null */ public ?Time\Duration $Timeout = null; - /** - * WriteOptions constructor. - * @param array|null $data - */ public function __construct(?array $data = null) { parent::__construct($data); @@ -51,89 +39,56 @@ public function __construct(?array $data = null) } } - /** - * @return string - */ public function getNamespace(): string { return $this->Namespace; } - /** - * @param string $namespace - */ public function setNamespace(string $namespace): void { $this->Namespace = $namespace; } - /** - * @return string - */ public function getDatacenter(): string { return $this->Datacenter; } - /** - * @param string $datacenter - */ public function setDatacenter(string $datacenter): void { $this->Datacenter = $datacenter; } - /** - * @return string - */ public function getToken(): string { return $this->Token; } - /** - * @param string $token - */ public function setToken(string $token): void { $this->Token = $token; } - /** - * @return int - */ public function getRelayFactor(): int { return $this->RelayFactor; } - /** - * @param int $relayFactor - */ public function setRelayFactor(int $relayFactor): void { $this->RelayFactor = $relayFactor; } - /** - * @return \DCarbone\Go\Time\Duration|null - */ public function getTimeout(): ?Time\Duration { return $this->Timeout; } - /** - * @param float|int|string|\DCarbone\Go\Time\Duration|null $timeout - */ public function setTimeout(float|int|string|Time\Duration|null $timeout): void { $this->Timeout = Time::Duration($timeout); } - /** - * @param \DCarbone\PHPConsulAPI\Request $r - */ public function apply(Request $r): void { if ('' !== $this->Namespace) { diff --git a/src/WriteResponse.php b/src/WriteResponse.php index ec92cf23..c6fa61db 100644 --- a/src/WriteResponse.php +++ b/src/WriteResponse.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,27 +20,16 @@ limitations under the License. */ -/** - * Class WriteResponse - */ class WriteResponse extends AbstractResponse { use WriteMetaContainer; use ErrorContainer; - /** - * @param mixed $offset - * @return bool - */ public function offsetExists(mixed $offset): bool { return \is_int($offset) && 0 <= $offset && $offset < 2; } - /** - * @param mixed $offset - * @return Error|WriteMeta|null - */ public function offsetGet(mixed $offset): Error|null|WriteMeta { if (0 === $offset) { diff --git a/src/funcs.php b/src/funcs.php index b9b986b6..8d088c0f 100644 --- a/src/funcs.php +++ b/src/funcs.php @@ -5,7 +5,7 @@ namespace DCarbone\PHPConsulAPI; /* - Copyright 2016-2021 Daniel Carbone (daniel.p.carbone@gmail.com) + Copyright 2016-2025 Daniel Carbone (daniel.p.carbone@gmail.com) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,10 +22,6 @@ use DCarbone\Go\Time; -/** - * @param \DCarbone\Go\Time\Duration $dur - * @return string - */ function dur_to_millisecond(Time\Duration $dur): string { $ns = $dur->Nanoseconds(); diff --git a/tools/php-cs-fixer/composer.lock b/tools/php-cs-fixer/composer.lock index ccff887a..3df88f8b 100644 --- a/tools/php-cs-fixer/composer.lock +++ b/tools/php-cs-fixer/composer.lock @@ -51,30 +51,102 @@ }, "time": "2022-03-14T08:26:27+00:00" }, + { + "name": "clue/ndjson-react", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\NDJson\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], + "support": { + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-12-23T10:58:28+00:00" + }, { "name": "composer/pcre", - "version": "3.0.0", + "version": "3.3.2", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd" + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/e300eb6c535192decd27a85bc72a9290f0d6b3bd", - "reference": "e300eb6c535192decd27a85bc72a9290f0d6b3bd", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", "shasum": "" }, "require": { "php": "^7.4 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, "require-dev": { - "phpstan/phpstan": "^1.3", - "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, "branch-alias": { "dev-main": "3.x-dev" } @@ -104,7 +176,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/3.0.0" + "source": "https://github.com/composer/pcre/tree/3.3.2" }, "funding": [ { @@ -120,28 +192,28 @@ "type": "tidelift" } ], - "time": "2022-02-25T20:21:48+00:00" + "time": "2024-11-12T16:29:46+00:00" }, { "name": "composer/semver", - "version": "3.3.2", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -183,9 +255,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -201,20 +273,20 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "composer/xdebug-handler", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { @@ -225,7 +297,7 @@ "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", "autoload": { @@ -249,9 +321,9 @@ "performance" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, "funding": [ { @@ -267,39 +339,32 @@ "type": "tidelift" } ], - "time": "2022-02-25T21:32:43+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { - "name": "doctrine/annotations", - "version": "1.13.2", + "name": "evenement/evenement", + "version": "v3.0.2", "source": { "type": "git", - "url": "https://github.com/doctrine/annotations.git", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08" + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/annotations/zipball/5b668aef16090008790395c02c893b1ba13f7e08", - "reference": "5b668aef16090008790395c02c893b1ba13f7e08", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", "shasum": "" }, "require": { - "doctrine/lexer": "1.*", - "ext-tokenizer": "*", - "php": "^7.1 || ^8.0", - "psr/cache": "^1 || ^2 || ^3" + "php": ">=7.0" }, "require-dev": { - "doctrine/cache": "^1.11 || ^2.0", - "doctrine/coding-standard": "^6.0 || ^8.1", - "phpstan/phpstan": "^0.12.20", - "phpunit/phpunit": "^7.5 || ^8.0 || ^9.1.5", - "symfony/cache": "^4.4 || ^5.2" + "phpunit/phpunit": "^9 || ^6" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Annotations\\": "lib/Doctrine/Common/Annotations" + "Evenement\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -308,66 +373,440 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, + { + "name": "fidry/cpu-core-counter", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "8520451a140d3f46ac33042715115e290cf5785f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^1.9.2", + "phpstan/phpstan-deprecation-rules": "^1.0.0", + "phpstan/phpstan-phpunit": "^1.2.2", + "phpstan/phpstan-strict-rules": "^1.4.4", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2024-08-06T10:04:20+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.74.0", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "6b7cb12a6cf592fd9a2b46a2d5d4c3b44003973d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/6b7cb12a6cf592fd9a2b46a2d5d4c3b44003973d", + "reference": "6b7cb12a6cf592fd9a2b46a2d5d4c3b44003973d", + "shasum": "" + }, + "require": { + "clue/ndjson-react": "^1.0", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.3", + "ext-filter": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.2", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.5", + "react/event-loop": "^1.0", + "react/promise": "^2.0 || ^3.0", + "react/socket": "^1.0", + "react/stream": "^1.0", + "sebastian/diff": "^4.0 || ^5.1 || ^6.0 || ^7.0", + "symfony/console": "^5.4 || ^6.4 || ^7.0", + "symfony/event-dispatcher": "^5.4 || ^6.4 || ^7.0", + "symfony/filesystem": "^5.4 || ^6.4 || ^7.0", + "symfony/finder": "^5.4 || ^6.4 || ^7.0", + "symfony/options-resolver": "^5.4 || ^6.4 || ^7.0", + "symfony/polyfill-mbstring": "^1.31", + "symfony/polyfill-php80": "^1.31", + "symfony/polyfill-php81": "^1.31", + "symfony/process": "^5.4 || ^6.4 || ^7.2", + "symfony/stopwatch": "^5.4 || ^6.4 || ^7.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3.1 || ^2.6", + "infection/infection": "^0.29.14", + "justinrainbow/json-schema": "^5.3 || ^6.2", + "keradus/cli-executor": "^2.1", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.7", + "php-cs-fixer/accessible-object": "^1.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6", + "phpunit/phpunit": "^9.6.22 || ^10.5.45 || ^11.5.12", + "symfony/var-dumper": "^5.4.48 || ^6.4.18 || ^7.2.3", + "symfony/yaml": "^5.4.45 || ^6.4.18 || ^7.2.3" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "exclude-from-classmap": [ + "src/Fixer/Internal/*" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" }, { - "name": "Roman Borschel", - "email": "roman@code-factory.org" + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.74.0" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2025-03-27T22:31:30+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" }, { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" }, { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" }, { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Docblock Annotations Parser", - "homepage": "https://www.doctrine-project.org/projects/annotations.html", + "description": "Async, Promise-based cache interface for ReactPHP", "keywords": [ - "annotations", - "docblock", - "parser" + "cache", + "caching", + "promise", + "reactphp" ], "support": { - "issues": "https://github.com/doctrine/annotations/issues", - "source": "https://github.com/doctrine/annotations/tree/1.13.2" + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" }, - "time": "2021-08-05T19:00:23+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" }, { - "name": "doctrine/lexer", - "version": "1.2.3", + "name": "react/child-process", + "version": "v0.6.6", "source": { "type": "git", - "url": "https://github.com/doctrine/lexer.git", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229" + "url": "https://github.com/reactphp/child-process.git", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229", - "reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/1721e2b93d89b745664353b9cfc8f155ba8a6159", + "reference": "1721e2b93d89b745664353b9cfc8f155ba8a6159", "shasum": "" }, "require": { - "php": "^7.1 || ^8.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" }, "require-dev": { - "doctrine/coding-standard": "^9.0", - "phpstan/phpstan": "^1.3", - "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", - "vimeo/psalm": "^4.11" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" }, "type": "library", "autoload": { "psr-4": { - "Doctrine\\Common\\Lexer\\": "lib/Doctrine/Common/Lexer" + "React\\ChildProcess\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -376,107 +815,73 @@ ], "authors": [ { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" }, { - "name": "Roman Borschel", - "email": "roman@code-factory.org" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" }, { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.", - "homepage": "https://www.doctrine-project.org/projects/lexer.html", + "description": "Event-driven library for executing child processes with ReactPHP.", "keywords": [ - "annotations", - "docblock", - "lexer", - "parser", - "php" + "event-driven", + "process", + "reactphp" ], "support": { - "issues": "https://github.com/doctrine/lexer/issues", - "source": "https://github.com/doctrine/lexer/tree/1.2.3" + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.6" }, "funding": [ { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Flexer", - "type": "tidelift" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-02-28T11:07:21+00:00" + "time": "2025-01-01T16:37:48+00:00" }, { - "name": "friendsofphp/php-cs-fixer", - "version": "v3.8.0", + "name": "react/dns", + "version": "v1.13.0", "source": { "type": "git", - "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3" + "url": "https://github.com/reactphp/dns.git", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", - "reference": "cbad1115aac4b5c3c5540e7210d3c9fba2f81fa3", + "url": "https://api.github.com/repos/reactphp/dns/zipball/eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", + "reference": "eb8ae001b5a455665c89c1df97f6fb682f8fb0f5", "shasum": "" }, "require": { - "composer/semver": "^3.2", - "composer/xdebug-handler": "^3.0.3", - "doctrine/annotations": "^1.13", - "ext-json": "*", - "ext-tokenizer": "*", - "php": "^7.4 || ^8.0", - "php-cs-fixer/diff": "^2.0", - "symfony/console": "^5.4 || ^6.0", - "symfony/event-dispatcher": "^5.4 || ^6.0", - "symfony/filesystem": "^5.4 || ^6.0", - "symfony/finder": "^5.4 || ^6.0", - "symfony/options-resolver": "^5.4 || ^6.0", - "symfony/polyfill-mbstring": "^1.23", - "symfony/polyfill-php80": "^1.25", - "symfony/polyfill-php81": "^1.25", - "symfony/process": "^5.4 || ^6.0", - "symfony/stopwatch": "^5.4 || ^6.0" + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" }, "require-dev": { - "justinrainbow/json-schema": "^5.2", - "keradus/cli-executor": "^1.5", - "mikey179/vfsstream": "^1.6.10", - "php-coveralls/php-coveralls": "^2.5.2", - "php-cs-fixer/accessible-object": "^1.1", - "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.2", - "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.2.1", - "phpspec/prophecy": "^1.15", - "phpspec/prophecy-phpunit": "^2.0", - "phpunit/phpunit": "^9.5", - "phpunitgoodpractices/polyfill": "^1.5", - "phpunitgoodpractices/traits": "^1.9.1", - "symfony/phpunit-bridge": "^6.0", - "symfony/yaml": "^5.4 || ^6.0" - }, - "suggest": { - "ext-dom": "For handling output formats in XML", - "ext-mbstring": "For handling non-UTF8 characters." + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" }, - "bin": [ - "php-cs-fixer" - ], - "type": "application", + "type": "library", "autoload": { "psr-4": { - "PhpCsFixer\\": "src/" + "React\\Dns\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -485,105 +890,145 @@ ], "authors": [ { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" }, { - "name": "Dariusz Rumiński", - "email": "dariusz.ruminski@gmail.com" + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "A tool to automatically fix PHP code style", + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], "support": { - "issues": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues", - "source": "https://github.com/FriendsOfPHP/PHP-CS-Fixer/tree/v3.8.0" + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.13.0" }, "funding": [ { - "url": "https://github.com/keradus", - "type": "github" + "url": "https://opencollective.com/reactphp", + "type": "open_collective" } ], - "time": "2022-03-18T17:20:59+00:00" + "time": "2024-06-13T14:18:03+00:00" }, { - "name": "php-cs-fixer/diff", - "version": "v2.0.2", + "name": "react/event-loop", + "version": "v1.5.0", "source": { "type": "git", - "url": "https://github.com/PHP-CS-Fixer/diff.git", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3" + "url": "https://github.com/reactphp/event-loop.git", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/diff/zipball/29dc0d507e838c4580d018bd8b5cb412474f7ec3", - "reference": "29dc0d507e838c4580d018bd8b5cb412474f7ec3", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", + "reference": "bbe0bd8c51ffc05ee43f1729087ed3bdf7d53354", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0 || ^8.0" + "php": ">=5.3.0" }, "require-dev": { - "phpunit/phpunit": "^5.7.23 || ^6.4.3 || ^7.0", - "symfony/process": "^3.3" + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" }, "type": "library", "autoload": { - "classmap": [ - "src/" - ] + "psr-4": { + "React\\EventLoop\\": "src/" + } }, "notification-url": "https://packagist.org/downloads/", "license": [ - "BSD-3-Clause" + "MIT" ], "authors": [ { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" }, { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "sebastian/diff v3 backport support for PHP 5.6+", - "homepage": "https://github.com/PHP-CS-Fixer", + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", "keywords": [ - "diff" + "asynchronous", + "event-loop" ], "support": { - "issues": "https://github.com/PHP-CS-Fixer/diff/issues", - "source": "https://github.com/PHP-CS-Fixer/diff/tree/v2.0.2" + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.5.0" }, - "time": "2020-10-14T08:32:19+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2023-11-13T13:48:05+00:00" }, { - "name": "psr/cache", - "version": "3.0.0", + "name": "react/promise", + "version": "v3.2.0", "source": { "type": "git", - "url": "https://github.com/php-fig/cache.git", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf" + "url": "https://github.com/reactphp/promise.git", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/cache/zipball/aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", - "reference": "aa5030cfa5405eccfdcb1083ce040c2cb8d253bf", + "url": "https://api.github.com/repos/reactphp/promise/zipball/8a164643313c71354582dc850b42b33fa12a4b63", + "reference": "8a164643313c71354582dc850b42b33fa12a4b63", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=7.1.0" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } + "require-dev": { + "phpstan/phpstan": "1.10.39 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" }, + "type": "library", "autoload": { + "files": [ + "src/functions_include.php" + ], "psr-4": { - "Psr\\Cache\\": "src/" + "React\\Promise\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -592,47 +1037,75 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Common interface for caching libraries", + "description": "A lightweight implementation of CommonJS Promises/A for PHP", "keywords": [ - "cache", - "psr", - "psr-6" + "promise", + "promises" ], "support": { - "source": "https://github.com/php-fig/cache/tree/3.0.0" + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.2.0" }, - "time": "2021-02-03T23:26:27+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-05-24T10:39:05+00:00" }, { - "name": "psr/container", - "version": "2.0.2", + "name": "react/socket", + "version": "v1.16.0", "source": { "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + "url": "https://github.com/reactphp/socket.git", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", - "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "url": "https://api.github.com/repos/reactphp/socket/zipball/23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", + "reference": "23e4ff33ea3e160d2d1f59a0e6050e4b0fb0eac1", "shasum": "" }, "require": { - "php": ">=7.4.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" }, + "type": "library", "autoload": { "psr-4": { - "Psr\\Container\\": "src/" + "React\\Socket\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -641,51 +1114,73 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" + "Connection", + "Socket", + "async", + "reactphp", + "stream" ], "support": { - "issues": "https://github.com/php-fig/container/issues", - "source": "https://github.com/php-fig/container/tree/2.0.2" + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.16.0" }, - "time": "2021-11-05T16:47:00+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-07-26T10:38:09+00:00" }, { - "name": "psr/event-dispatcher", - "version": "1.0.0", + "name": "react/stream", + "version": "v1.4.0", "source": { "type": "git", - "url": "https://github.com/php-fig/event-dispatcher.git", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", - "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", "shasum": "" }, "require": { - "php": ">=7.2.0" + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" }, + "type": "library", "autoload": { "psr-4": { - "Psr\\EventDispatcher\\": "src/" + "React\\Stream\\": "src/" } }, "notification-url": "https://packagist.org/downloads/", @@ -694,117 +1189,158 @@ ], "authors": [ { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" } ], - "description": "Standard interfaces for event handling.", + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", "keywords": [ - "events", - "psr", - "psr-14" + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" ], "support": { - "issues": "https://github.com/php-fig/event-dispatcher/issues", - "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" }, - "time": "2019-01-08T18:20:26+00:00" + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" }, { - "name": "psr/log", - "version": "3.0.0", + "name": "sebastian/diff", + "version": "7.0.0", "source": { "type": "git", - "url": "https://github.com/php-fig/log.git", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001" + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "7ab1ea946c012266ca32390913653d844ecd085f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe5ea303b0887d5caefd3d431c3e61ad47037001", - "reference": "fe5ea303b0887d5caefd3d431c3e61ad47037001", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7ab1ea946c012266ca32390913653d844ecd085f", + "reference": "7ab1ea946c012266ca32390913653d844ecd085f", "shasum": "" }, "require": { - "php": ">=8.0.0" + "php": ">=8.3" + }, + "require-dev": { + "phpunit/phpunit": "^12.0", + "symfony/process": "^7.2" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.x-dev" + "dev-main": "7.0-dev" } }, "autoload": { - "psr-4": { - "Psr\\Log\\": "src" - } + "classmap": [ + "src/" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ - "MIT" + "BSD-3-Clause" ], "authors": [ { - "name": "PHP-FIG", - "homepage": "https://www.php-fig.org/" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" } ], - "description": "Common interface for logging libraries", - "homepage": "https://github.com/php-fig/log", + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "log", - "psr", - "psr-3" + "diff", + "udiff", + "unidiff", + "unified diff" ], "support": { - "source": "https://github.com/php-fig/log/tree/3.0.0" + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/7.0.0" }, - "time": "2021-07-14T16:46:02+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-02-07T04:55:46+00:00" }, { "name": "symfony/console", - "version": "v6.1.0", + "version": "v7.2.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c9646197ef43b0e2ff44af61e7f0571526fd4170" + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c9646197ef43b0e2ff44af61e7f0571526fd4170", - "reference": "c9646197ef43b0e2ff44af61e7f0571526fd4170", + "url": "https://api.github.com/repos/symfony/console/zipball/fefcc18c0f5d0efe3ab3152f15857298868dc2c3", + "reference": "fefcc18c0f5d0efe3ab3152f15857298868dc2c3", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3", + "php": ">=8.2", "symfony/polyfill-mbstring": "~1.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/string": "^5.4|^6.0" + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^6.4|^7.0" }, "conflict": { - "symfony/dependency-injection": "<5.4", - "symfony/dotenv": "<5.4", - "symfony/event-dispatcher": "<5.4", - "symfony/lock": "<5.4", - "symfony/process": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" }, "provide": { "psr/log-implementation": "1.0|2.0|3.0" }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/event-dispatcher": "^5.4|^6.0", - "symfony/lock": "^5.4|^6.0", - "symfony/process": "^5.4|^6.0", - "symfony/var-dumper": "^5.4|^6.0" - }, - "suggest": { - "psr/log": "For using the console logger", - "symfony/event-dispatcher": "", - "symfony/lock": "", - "symfony/process": "" + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/event-dispatcher": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/lock": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/process": "^6.4|^7.0", + "symfony/stopwatch": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -833,12 +1369,12 @@ "homepage": "https://symfony.com", "keywords": [ "cli", - "command line", + "command-line", "console", "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v6.1.0" + "source": "https://github.com/symfony/console/tree/v7.2.1" }, "funding": [ { @@ -854,20 +1390,20 @@ "type": "tidelift" } ], - "time": "2022-05-27T06:34:22+00:00" + "time": "2024-12-11T03:49:26+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v3.1.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918" + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", - "reference": "07f1b9cc2ffee6aaafcf4b710fbc38ff736bd918", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", + "reference": "74c71c939a79f7d5bf3c1ce9f5ea37ba0114c6f6", "shasum": "" }, "require": { @@ -875,12 +1411,12 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.1-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -905,7 +1441,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v3.1.0" + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.5.1" }, "funding": [ { @@ -921,28 +1457,29 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v6.1.0", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347" + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a0449a7ad7daa0f7c0acd508259f80544ab5a347", - "reference": "a0449a7ad7daa0f7c0acd508259f80544ab5a347", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/910c5db85a5356d0fea57680defec4e99eb9c8c1", + "reference": "910c5db85a5356d0fea57680defec4e99eb9c8c1", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/event-dispatcher-contracts": "^2|^3" + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4" + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" }, "provide": { "psr/event-dispatcher-implementation": "1.0", @@ -950,17 +1487,13 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0", - "symfony/dependency-injection": "^5.4|^6.0", - "symfony/error-handler": "^5.4|^6.0", - "symfony/expression-language": "^5.4|^6.0", - "symfony/http-foundation": "^5.4|^6.0", - "symfony/service-contracts": "^1.1|^2|^3", - "symfony/stopwatch": "^5.4|^6.0" - }, - "suggest": { - "symfony/dependency-injection": "", - "symfony/http-kernel": "" + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -988,7 +1521,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.1.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.2.0" }, "funding": [ { @@ -1004,37 +1537,34 @@ "type": "tidelift" } ], - "time": "2022-05-05T16:51:07+00:00" + "time": "2024-09-25T14:21:43+00:00" }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.1.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "02ff5eea2f453731cfbc6bc215e456b781480448" + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/02ff5eea2f453731cfbc6bc215e456b781480448", - "reference": "02ff5eea2f453731cfbc6bc215e456b781480448", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/7642f5e970b672283b7823222ae8ef8bbc160b9f", + "reference": "7642f5e970b672283b7823222ae8ef8bbc160b9f", "shasum": "" }, "require": { "php": ">=8.1", "psr/event-dispatcher": "^1" }, - "suggest": { - "symfony/event-dispatcher-implementation": "" - }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.1-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -1067,7 +1597,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.1.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.5.1" }, "funding": [ { @@ -1083,27 +1613,30 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/filesystem", - "version": "v6.1.0", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "3132d2f43ca799c2aa099f9738d98228c56baa5d" + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/3132d2f43ca799c2aa099f9738d98228c56baa5d", - "reference": "3132d2f43ca799c2aa099f9738d98228c56baa5d", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/b8dce482de9d7c9fe2891155035a7248ab5c7fdb", + "reference": "b8dce482de9d7c9fe2891155035a7248ab5c7fdb", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, + "require-dev": { + "symfony/process": "^6.4|^7.0" + }, "type": "library", "autoload": { "psr-4": { @@ -1130,7 +1663,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.1.0" + "source": "https://github.com/symfony/filesystem/tree/v7.2.0" }, "funding": [ { @@ -1146,27 +1679,27 @@ "type": "tidelift" } ], - "time": "2022-05-21T13:34:40+00:00" + "time": "2024-10-25T15:15:23+00:00" }, { "name": "symfony/finder", - "version": "v6.1.0", + "version": "v7.2.2", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "45b8beb69d6eb3b05a65689ebfd4222326773f8f" + "reference": "87a71856f2f56e4100373e92529eed3171695cfb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/45b8beb69d6eb3b05a65689ebfd4222326773f8f", - "reference": "45b8beb69d6eb3b05a65689ebfd4222326773f8f", + "url": "https://api.github.com/repos/symfony/finder/zipball/87a71856f2f56e4100373e92529eed3171695cfb", + "reference": "87a71856f2f56e4100373e92529eed3171695cfb", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "require-dev": { - "symfony/filesystem": "^6.0" + "symfony/filesystem": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -1194,7 +1727,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v6.1.0" + "source": "https://github.com/symfony/finder/tree/v7.2.2" }, "funding": [ { @@ -1210,25 +1743,25 @@ "type": "tidelift" } ], - "time": "2022-04-15T08:08:08+00:00" + "time": "2024-12-30T19:00:17+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.1.0", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4" + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/a3016f5442e28386ded73c43a32a5b68586dd1c4", - "reference": "a3016f5442e28386ded73c43a32a5b68586dd1c4", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/7da8fbac9dcfef75ffc212235d76b2754ce0cf50", + "reference": "7da8fbac9dcfef75ffc212235d76b2754ce0cf50", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/deprecation-contracts": "^2.1|^3" + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -1261,7 +1794,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.1.0" + "source": "https://github.com/symfony/options-resolver/tree/v7.2.0" }, "funding": [ { @@ -1277,24 +1810,24 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2024-11-20T11:17:29+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4" + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", - "reference": "6fd1b9a79f6e3cf65f9e679b23af304cd9e010d4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-ctype": "*" @@ -1304,12 +1837,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1343,7 +1873,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.31.0" }, "funding": [ { @@ -1359,36 +1889,33 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "433d05519ce6990bf3530fba6957499d327395c2" + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/433d05519ce6990bf3530fba6957499d327395c2", - "reference": "433d05519ce6990bf3530fba6957499d327395c2", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", + "reference": "b9123926e3b7bc2f98c02ad54f6a4b02b91a8abe", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1424,7 +1951,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.31.0" }, "funding": [ { @@ -1440,36 +1967,33 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd" + "reference": "3833d7255cc303546435cb650316bff708a1c75c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/219aa369ceff116e673852dce47c3a41794c14bd", - "reference": "219aa369ceff116e673852dce47c3a41794c14bd", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "suggest": { "ext-intl": "For best performance" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1508,7 +2032,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.31.0" }, "funding": [ { @@ -1524,24 +2048,24 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e" + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", - "reference": "9344f9cb97f3b19424af1a21a3b0e75b0a7d8d7e", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/85181ba99b2345b0ef10ce42ecac37612d9fd341", + "reference": "85181ba99b2345b0ef10ce42ecac37612d9fd341", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "provide": { "ext-mbstring": "*" @@ -1551,12 +2075,9 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1591,7 +2112,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.31.0" }, "funding": [ { @@ -1607,7 +2128,7 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/polyfill-php80", @@ -1691,29 +2212,26 @@ }, { "name": "symfony/polyfill-php81", - "version": "v1.26.0", + "version": "v1.31.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php81.git", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1" + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/13f6d1271c663dc5ae9fb843a8f16521db7687a1", - "reference": "13f6d1271c663dc5ae9fb843a8f16521db7687a1", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", "shasum": "" }, "require": { - "php": ">=7.1" + "php": ">=7.2" }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.26-dev" - }, "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" } }, "autoload": { @@ -1750,7 +2268,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php81/tree/v1.26.0" + "source": "https://github.com/symfony/polyfill-php81/tree/v1.31.0" }, "funding": [ { @@ -1766,24 +2284,24 @@ "type": "tidelift" } ], - "time": "2022-05-24T11:49:31+00:00" + "time": "2024-09-09T11:45:10+00:00" }, { "name": "symfony/process", - "version": "v6.4.15", + "version": "v7.2.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3cb242f059c14ae08591c5c4087d1fe443564392" + "reference": "d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3cb242f059c14ae08591c5c4087d1fe443564392", - "reference": "3cb242f059c14ae08591c5c4087d1fe443564392", + "url": "https://api.github.com/repos/symfony/process/zipball/d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf", + "reference": "d8f411ff3c7ddc4ae9166fb388d1190a2df5b5cf", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "autoload": { @@ -1811,7 +2329,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.4.15" + "source": "https://github.com/symfony/process/tree/v7.2.4" }, "funding": [ { @@ -1827,40 +2345,38 @@ "type": "tidelift" } ], - "time": "2024-11-06T14:19:14+00:00" + "time": "2025-02-05T08:33:46+00:00" }, { "name": "symfony/service-contracts", - "version": "v3.1.0", + "version": "v3.5.1", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "d66cd8ab656780f62c4215b903a420eb86358957" + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/d66cd8ab656780f62c4215b903a420eb86358957", - "reference": "d66cd8ab656780f62c4215b903a420eb86358957", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/e53260aabf78fb3d63f8d79d69ece59f80d5eda0", + "reference": "e53260aabf78fb3d63f8d79d69ece59f80d5eda0", "shasum": "" }, "require": { "php": ">=8.1", - "psr/container": "^2.0" + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" }, "conflict": { "ext-psr": "<1.1|>=2" }, - "suggest": { - "symfony/service-implementation": "" - }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "3.1-dev" - }, "thanks": { - "name": "symfony/contracts", - "url": "https://github.com/symfony/contracts" + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.5-dev" } }, "autoload": { @@ -1896,7 +2412,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.1.0" + "source": "https://github.com/symfony/service-contracts/tree/v3.5.1" }, "funding": [ { @@ -1912,25 +2428,25 @@ "type": "tidelift" } ], - "time": "2022-05-07T08:07:09+00:00" + "time": "2024-09-25T14:20:29+00:00" }, { "name": "symfony/stopwatch", - "version": "v6.1.0", + "version": "v7.2.4", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "77dedae82ce2a26e2e9b481855473fc3b3e4e54d" + "reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/77dedae82ce2a26e2e9b481855473fc3b3e4e54d", - "reference": "77dedae82ce2a26e2e9b481855473fc3b3e4e54d", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", + "reference": "5a49289e2b308214c8b9c2fda4ea454d8b8ad7cd", "shasum": "" }, "require": { - "php": ">=8.1", - "symfony/service-contracts": "^1|^2|^3" + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" }, "type": "library", "autoload": { @@ -1958,7 +2474,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.1.0" + "source": "https://github.com/symfony/stopwatch/tree/v7.2.4" }, "funding": [ { @@ -1974,37 +2490,39 @@ "type": "tidelift" } ], - "time": "2022-02-25T11:15:52+00:00" + "time": "2025-02-24T10:49:57+00:00" }, { "name": "symfony/string", - "version": "v6.1.0", + "version": "v7.2.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529" + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/d3edc75baf9f1d4f94879764dda2e1ac33499529", - "reference": "d3edc75baf9f1d4f94879764dda2e1ac33499529", + "url": "https://api.github.com/repos/symfony/string/zipball/446e0d146f991dde3e73f45f2c97a9faad773c82", + "reference": "446e0d146f991dde3e73f45f2c97a9faad773c82", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { - "symfony/translation-contracts": "<2.0" + "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0", - "symfony/http-client": "^5.4|^6.0", - "symfony/translation-contracts": "^2.0|^3.0", - "symfony/var-exporter": "^5.4|^6.0" + "symfony/emoji": "^7.1", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -2043,7 +2561,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.1.0" + "source": "https://github.com/symfony/string/tree/v7.2.0" }, "funding": [ { @@ -2059,7 +2577,7 @@ "type": "tidelift" } ], - "time": "2022-04-22T08:18:23+00:00" + "time": "2024-11-13T13:31:26+00:00" } ], "packages-dev": [], @@ -2070,7 +2588,7 @@ }, "prefer-stable": false, "prefer-lowest": false, - "platform": [], - "platform-dev": [], - "plugin-api-version": "2.3.0" + "platform": {}, + "platform-dev": {}, + "plugin-api-version": "2.6.0" } From 0c25ad0e567794dcea6e2f402741db2879b48229 Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Fri, 28 Mar 2025 21:29:32 -0500 Subject: [PATCH 2/7] one thing at a time. --- .github/workflows/tests.yaml | 61 +++++++++++++++++++++++++++++++----- 1 file changed, 54 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 28d7cf12..fe283c96 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -39,20 +39,67 @@ jobs: steps: - uses: actions/checkout@v4 + - name: 'Define vars' + id: vars + shell: bash -e {0} + # language=sh + run: | + _phpunit_version= + case "${{ inputs.php-version }}" in + 8.1) _phpunit_version='10.5' ;; + 8.2) _phpunit_version='11.1' ;; + 8.3) _phpunit_version='11.1' ;; + 8.4) _phpunit_version='11.1' ;; + *) echo "Unsupported PHP version: ${{ inputs.php-version }}" && exit 1 ;; + esac + echo "phpunit-version=${_phpunit_version}" >> $GITHUB_OUTPUT + - uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php-version }} extensions: json ini-values: precision=14,serialize_precision=-1 - - name: 'Composer update' - # language=bash + - name: 'Install jq' + uses: dcarbone/install-jq-action@v3 + with: + force: true + + - name: 'Set composer dep versions' + shell: bash -e {0} + # language=sh + run: | + tmpf="$(mktemp)" + jq -rcM '."require-dev"."phpunit/phpunit" = "^${{ steps.vars.outputs.phpunit-version }}"' composer.json > "${tmpf}" + mv "${tmpf}" composer.json + + - name: 'Get composer cache directory' + id: composer-cache + shell: bash -e {0} + # language=sh run: | - composer update \ - --no-ansi \ - --no-interaction \ - --no-scripts \ - --no-progress + echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT + + - name: 'Init composer dep cache' + id: cache + uses: actions/cache@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: "composer-${{ runner.os }}-${{ inputs.php-version }}-${{ steps.vars.outputs.phpunit-version }}-${{ hashFiles('composer.lock') }}" + + - name: 'Install composer deps' + shell: bash -e {0} + # language=sh + run: | + rm composer.lock + composer update --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist + + - name: 'Save composer dep cache' + if: steps.cache.outputs.cache-hit != 'true' && steps.cache.outputs.cache-hit != true + uses: actions/cache/save@v4 + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: "composer-${{ runner.os }}-${{ inputs.php-version }}-${{ steps.vars.outputs.phpunit-version }}-${{ hashFiles('composer.lock') }}" - name: 'Install Consul' # language=bash From 93b5f928031297710cd86fb4bd49111dd3ea6786 Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Fri, 28 Mar 2025 21:37:18 -0500 Subject: [PATCH 3/7] master -> main --- .github/workflows/tests.yaml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index fe283c96..07d3d292 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -3,7 +3,7 @@ name: "Tests" on: pull_request: branches: - - master + - main paths: - '**.php' - 'composer.json' @@ -12,7 +12,7 @@ on: - '.github/workflows/tests.yaml' push: branches: - - master + - main paths: - '**.php' - 'composer.json' diff --git a/README.md b/README.md index 150edd09..41bc3880 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This library is loosely based upon the [official GO client](https://github.com/h | 0.6.x | 0.7-0.8 | | v1.x | 0.9-current | | v2.x | 0.9-current | -| dev-master | current | +| dev-main | current | Newer versions of the api lib will probably work in a limited capacity with older versions of Consul, but no guarantee is made and backwards compatibility issues will not be addressed. From e1cc1d8a006d5f6d824127d65b9a6dabddec71f4 Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Fri, 28 Mar 2025 21:40:14 -0500 Subject: [PATCH 4/7] should probably create a shared actions repo... --- .github/workflows/tests.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 07d3d292..6efcd5c3 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -45,12 +45,12 @@ jobs: # language=sh run: | _phpunit_version= - case "${{ inputs.php-version }}" in + case "${{ matrix.php-version }}" in 8.1) _phpunit_version='10.5' ;; 8.2) _phpunit_version='11.1' ;; 8.3) _phpunit_version='11.1' ;; 8.4) _phpunit_version='11.1' ;; - *) echo "Unsupported PHP version: ${{ inputs.php-version }}" && exit 1 ;; + *) echo "Unsupported PHP version: ${{ matrix.php-version }}" && exit 1 ;; esac echo "phpunit-version=${_phpunit_version}" >> $GITHUB_OUTPUT @@ -85,7 +85,7 @@ jobs: uses: actions/cache@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: "composer-${{ runner.os }}-${{ inputs.php-version }}-${{ steps.vars.outputs.phpunit-version }}-${{ hashFiles('composer.lock') }}" + key: "composer-${{ runner.os }}-${{ matrix.php-version }}-${{ steps.vars.outputs.phpunit-version }}-${{ hashFiles('composer.lock') }}" - name: 'Install composer deps' shell: bash -e {0} @@ -99,7 +99,7 @@ jobs: uses: actions/cache/save@v4 with: path: ${{ steps.composer-cache.outputs.dir }} - key: "composer-${{ runner.os }}-${{ inputs.php-version }}-${{ steps.vars.outputs.phpunit-version }}-${{ hashFiles('composer.lock') }}" + key: "composer-${{ runner.os }}-${{ matrix.php-version }}-${{ steps.vars.outputs.phpunit-version }}-${{ hashFiles('composer.lock') }}" - name: 'Install Consul' # language=bash From caff7f3667ae521e481416edac6f0fc7bff1b002 Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Sun, 6 Apr 2025 19:40:47 -0500 Subject: [PATCH 5/7] tryin' out good 'ol tool cache. --- .github/workflows/tests.yaml | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 6efcd5c3..795f3a74 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -101,14 +101,36 @@ jobs: path: ${{ steps.composer-cache.outputs.dir }} key: "composer-${{ runner.os }}-${{ matrix.php-version }}-${{ steps.vars.outputs.phpunit-version }}-${{ hashFiles('composer.lock') }}" - - name: 'Install Consul' + - name: 'Restore consul ${{ env.CONSUL_VERSION }}' + id: consul-cache + uses: actions/cache/restore@v4 + with: + path: '${{ runner.tool_cache }}/consul' + key: 'consul-${{ env.CONSUL_VERSION }}' + + - name: 'Install consul ${{ env.CONSUL_VERSION }}' + if: '! steps.consul-cache.outputs.cache-hit' + working-directory: '${{ runner.temp }}' # language=bash run: | - wget https://releases.hashicorp.com/consul/${{ env.CONSUL_VERSION }}/consul_${{ env.CONSUL_VERSION }}_linux_amd64.zip - unzip consul_${{ env.CONSUL_VERSION }}_linux_amd64.zip -d /usr/local/bin/ + mkdir consul + wget -O consul.zip https://releases.hashicorp.com/consul/${{ env.CONSUL_VERSION }}/consul_${{ env.CONSUL_VERSION }}_linux_amd64.zip + unzip 'consul.zip' consul -d consul/ rm consul_${{ env.CONSUL_VERSION }}_linux_amd64.zip - chmod +x /usr/local/bin/consul - consul --version + chmod +x consul/consul + + - name: 'Install consul ${{ env.CONSUL_VERSION }} into tool cache' + uses: AnimMouse/tool-cache@v1 + with: + folder_name: consul + cache_hit: ${{ steps.consul-cache.outputs.cache-hit }} + + - name: 'Save consul ${{ env.CONSUL_VERSION }} cache' + if: '! steps.consul-cache.outputs.cache-hit' + uses: actions/cache/save@v4 + with: + path: '${{ runner.tool_cache }}/consul' + key: 'consul-${{ env.CONSUL_VERSION }}' - name: 'Execute tests' # language=bash From f591d80ef67fd1d049d52c1163f4b09a3fe69d64 Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Sun, 6 Apr 2025 19:41:23 -0500 Subject: [PATCH 6/7] sigh. --- .github/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 795f3a74..2396a8ad 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -116,9 +116,9 @@ jobs: mkdir consul wget -O consul.zip https://releases.hashicorp.com/consul/${{ env.CONSUL_VERSION }}/consul_${{ env.CONSUL_VERSION }}_linux_amd64.zip unzip 'consul.zip' consul -d consul/ - rm consul_${{ env.CONSUL_VERSION }}_linux_amd64.zip + rm consul.zip chmod +x consul/consul - + - name: 'Install consul ${{ env.CONSUL_VERSION }} into tool cache' uses: AnimMouse/tool-cache@v1 with: From a5399f7e0f444453e3d82b4dfc5f594349be2521 Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Sun, 6 Apr 2025 19:47:55 -0500 Subject: [PATCH 7/7] pretty sure i did this exact same thing awhile ago. --- composer.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.lock b/composer.lock index 9208b439..c2e968d1 100644 --- a/composer.lock +++ b/composer.lock @@ -57,16 +57,16 @@ }, { "name": "dcarbone/gotime", - "version": "v0.6.0", + "version": "v0.6.1", "source": { "type": "git", "url": "https://github.com/dcarbone/gotime.git", - "reference": "a34ce8374185f31030d939ea2a1092d3ca4b46b4" + "reference": "608b2d336bd865a549ad5d4686b17fea11ff7adf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/dcarbone/gotime/zipball/a34ce8374185f31030d939ea2a1092d3ca4b46b4", - "reference": "a34ce8374185f31030d939ea2a1092d3ca4b46b4", + "url": "https://api.github.com/repos/dcarbone/gotime/zipball/608b2d336bd865a549ad5d4686b17fea11ff7adf", + "reference": "608b2d336bd865a549ad5d4686b17fea11ff7adf", "shasum": "" }, "require": { @@ -103,9 +103,9 @@ "homepage": "https://github.com/dcarbone/gotime", "support": { "issues": "https://github.com/dcarbone/gotime/issues", - "source": "https://github.com/dcarbone/gotime/tree/v0.6.0" + "source": "https://github.com/dcarbone/gotime/tree/v0.6.1" }, - "time": "2025-03-28T02:19:40+00:00" + "time": "2025-04-07T00:45:51+00:00" }, { "name": "guzzlehttp/guzzle",