Skip to content

Commit e2f0167

Browse files
committed
only acl & agent for now
1 parent ec161b4 commit e2f0167

13 files changed

Lines changed: 103 additions & 103 deletions

phpunit.xml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,31 @@
2020
<file>./tests/Usage/RequestUsageTest.php</file>
2121
</testsuite>
2222

23-
<!--<testsuite name="usage-acl">-->
24-
<!--<directory>./tests/Usage/ACL</directory>-->
25-
<!--</testsuite>-->
23+
<testsuite name="usage-acl">
24+
<directory>./tests/Usage/ACL</directory>
25+
</testsuite>
2626

2727
<testsuite name="usage-agent">
2828
<directory>./tests/Usage/Agent</directory>
2929
</testsuite>
30-
<testsuite name="usage-catalog">
31-
<directory>./tests/Usage/Catalog</directory>
32-
</testsuite>
33-
<testsuite name="usage-coordinate">
34-
<directory>./tests/Usage/Coordinate</directory>
35-
</testsuite>
36-
<testsuite name="usage-kv">
37-
<directory>./tests/Usage/KV</directory>
38-
</testsuite>
39-
<testsuite name="usage-operator">
40-
<directory>./tests/Usage/Operator</directory>
41-
</testsuite>
42-
<testsuite name="usage-session">
43-
<directory>./tests/Usage/Session</directory>
44-
</testsuite>
30+
<!-- <testsuite name="usage-catalog">-->
31+
<!-- <directory>./tests/Usage/Catalog</directory>-->
32+
<!-- </testsuite>-->
33+
<!-- <testsuite name="usage-coordinate">-->
34+
<!-- <directory>./tests/Usage/Coordinate</directory>-->
35+
<!-- </testsuite>-->
36+
<!-- <testsuite name="usage-kv">-->
37+
<!-- <directory>./tests/Usage/KV</directory>-->
38+
<!-- </testsuite>-->
39+
<!-- <testsuite name="usage-operator">-->
40+
<!-- <directory>./tests/Usage/Operator</directory>-->
41+
<!-- </testsuite>-->
42+
<!-- <testsuite name="usage-session">-->
43+
<!-- <directory>./tests/Usage/Session</directory>-->
44+
<!-- </testsuite>-->
4545

46-
<testsuite name="usage-random">
47-
<directory>./tests/Usage/Random</directory>
48-
</testsuite>
46+
<!-- <testsuite name="usage-random">-->
47+
<!-- <directory>./tests/Usage/Random</directory>-->
48+
<!-- </testsuite>-->
4949
</testsuites>
5050
</phpunit>

src/AbstractClient.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,12 +92,12 @@ protected function _newPutRequest(string $path, mixed $body, ?RequestOptions $op
9292
return $this->_newRequest(HTTP\MethodPut, $path, $body, $opts);
9393
}
9494

95-
protected function _newGetRequest(string $path, ?QueryOptions $opts): Request
95+
protected function _newGetRequest(string $path, null|QueryOptions $opts): Request
9696
{
9797
return $this->_newRequest(HTTP\MethodGet, $path, null, $opts);
9898
}
9999

100-
protected function _newDeleteRequest(string $path, ?WriteOptions $opts): Request
100+
protected function _newDeleteRequest(string $path, null|WriteOptions $opts): Request
101101
{
102102
return $this->_newRequest(HTTP\MethodDelete, $path, null, $opts);
103103
}
@@ -195,7 +195,7 @@ protected function _requireNotFoundOrOK(RequestResponse $r): RequestResponse
195195
return $this->_requireStatus($r, HTTP\StatusOK, HTTP\StatusNotFound);
196196
}
197197

198-
protected function _doGet(string $path, ?QueryOptions $opts): RequestResponse
198+
protected function _doGet(string $path, null|QueryOptions $opts): RequestResponse
199199
{
200200
return $this->_do($this->_newGetRequest($path, $opts));
201201
}
@@ -210,7 +210,7 @@ protected function _doPut(string $path, mixed $body, ?RequestOptions $opts): Req
210210
return $this->_do($this->_newPutRequest($path, $body, $opts));
211211
}
212212

213-
protected function _doDelete(string $path, ?WriteOptions $opts): RequestResponse
213+
protected function _doDelete(string $path, null|WriteOptions $opts): RequestResponse
214214
{
215215
return $this->_do($this->_newDeleteRequest($path, $opts));
216216
}
@@ -242,31 +242,31 @@ protected function _decodeBody(StreamInterface $body): DecodedBody
242242
);
243243
}
244244

245-
protected function _executePut(string $path, mixed $body, ?WriteOptions $opts): WriteResponse
245+
protected function _executePut(string $path, mixed $body, null|WriteOptions $opts): WriteResponse
246246
{
247247
$resp = $this->_requireOK($this->_doPut($path, $body, $opts));
248248
$ret = new WriteResponse();
249249
$this->_unmarshalResponse($resp, $ret);
250250
return $ret;
251251
}
252252

253-
protected function _executePost(string $path, mixed $body, ?WriteOptions $opts): WriteResponse
253+
protected function _executePost(string $path, mixed $body, null|WriteOptions $opts): WriteResponse
254254
{
255255
$resp = $this->_requireOK($this->_doPost($path, $body, $opts));
256256
$ret = new WriteResponse();
257257
$this->_unmarshalResponse($resp, $ret);
258258
return $ret;
259259
}
260260

261-
protected function _executeDelete(string $path, ?WriteOptions $opts): WriteResponse
261+
protected function _executeDelete(string $path, null|WriteOptions $opts): WriteResponse
262262
{
263263
$resp = $this->_requireOK($this->_doDelete($path, $opts));
264264
$ret = new WriteResponse();
265265
$this->_unmarshalResponse($resp, $ret);
266266
return $ret;
267267
}
268268

269-
protected function _executePutValuedStr(string $path, mixed $body, ?WriteOptions $opts): ValuedWriteStringResponse
269+
protected function _executePutValuedStr(string $path, mixed $body, null|WriteOptions $opts): ValuedWriteStringResponse
270270
{
271271
$r = $this->_newPutRequest($path, $body, $opts);
272272
$resp = $this->_requireOK($this->_do($r));
@@ -275,7 +275,7 @@ protected function _executePutValuedStr(string $path, mixed $body, ?WriteOptions
275275
return $ret;
276276
}
277277

278-
protected function _executeGetValuedStr(string $path, ?QueryOptions $opts): ValuedQueryStringResponse
278+
protected function _executeGetValuedStr(string $path, null|QueryOptions $opts): ValuedQueryStringResponse
279279
{
280280
$r = $this->_newGetRequest($path, $opts);
281281
$resp = $this->_requireOK($this->_do($r));
@@ -284,7 +284,7 @@ protected function _executeGetValuedStr(string $path, ?QueryOptions $opts): Valu
284284
return $ret;
285285
}
286286

287-
protected function _executeGetValuedStrs(string $path, ?QueryOptions $opts): ValuedQueryStringsResponse
287+
protected function _executeGetValuedStrs(string $path, null|QueryOptions $opts): ValuedQueryStringsResponse
288288
{
289289
$r = $this->_newGetRequest($path, $opts);
290290
$resp = $this->_requireOK($this->_do($r));

src/Catalog/CatalogClient.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929

3030
class CatalogClient extends AbstractClient
3131
{
32-
public function Register(CatalogRegistration $catalogRegistration, ?WriteOptions $opts = null): WriteResponse
32+
public function Register(CatalogRegistration $catalogRegistration, null|WriteOptions $opts = null): WriteResponse
3333
{
3434
return $this->_executePut('v1/catalog/register', $catalogRegistration, $opts);
3535
}
3636

37-
public function Deregister(CatalogDeregistration $catalogDeregistration, ?WriteOptions $opts = null): WriteResponse
37+
public function Deregister(CatalogDeregistration $catalogDeregistration, null|WriteOptions $opts = null): WriteResponse
3838
{
3939
return $this->_executePut('v1/catalog/deregister', $catalogDeregistration, $opts);
4040
}
@@ -47,23 +47,23 @@ public function Datacenters(): ValuedStringsResponse
4747
return $ret;
4848
}
4949

50-
public function Nodes(?QueryOptions $opts = null): NodesResponse
50+
public function Nodes(null|QueryOptions $opts = null): NodesResponse
5151
{
5252
$resp = $this->_requireOK($this->_doGet('v1/catalog/nodes', $opts));
5353
$ret = new NodesResponse();
5454
$this->_unmarshalResponse($resp, $ret);
5555
return $ret;
5656
}
5757

58-
public function Services(?QueryOptions $opts = null): ValuedQueryStringsResponse
58+
public function Services(null|QueryOptions $opts = null): ValuedQueryStringsResponse
5959
{
6060
$resp = $this->_requireOK($this->_doGet('v1/catalog/services', $opts));
6161
$ret = new ValuedQueryStringsResponse();
6262
$this->_unmarshalResponse($resp, $ret);
6363
return $ret;
6464
}
6565

66-
public function NodeServicesList(string $node, ?QueryOptions $opts = null): CatalogNodeServicesListResponse
66+
public function NodeServicesList(string $node, null|QueryOptions $opts = null): CatalogNodeServicesListResponse
6767
{
6868
$resp = $this->_requireOK($this->_doGet(sprintf('v1/catalog/node-services/%s', urlencode($node)), $opts));
6969
$ret = new CatalogNodeServicesListResponse();
@@ -74,7 +74,7 @@ public function NodeServicesList(string $node, ?QueryOptions $opts = null): Cata
7474
public function ServiceMultipleTags(
7575
string $service,
7676
array $tags,
77-
?QueryOptions $opts = null
77+
null|QueryOptions $opts = null
7878
): CatalogServicesResponse {
7979
$r = $this->_newGetRequest(sprintf('v1/catalog/service/%s', $service), $opts);
8080
if ([] !== $tags) {
@@ -86,20 +86,20 @@ public function ServiceMultipleTags(
8686
return $ret;
8787
}
8888

89-
public function Service(string $service, string $tag = '', ?QueryOptions $opts = null): CatalogServicesResponse
89+
public function Service(string $service, string $tag = '', null|QueryOptions $opts = null): CatalogServicesResponse
9090
{
9191
return $this->ServiceMultipleTags($service, '' !== $tag ? [$tag] : [], $opts);
9292
}
9393

94-
public function Node(string $node, ?QueryOptions $opts = null): CatalogNodeResponse
94+
public function Node(string $node, null|QueryOptions $opts = null): CatalogNodeResponse
9595
{
9696
$resp = $this->_requireOK($this->_doGet(sprintf('v1/catalog/node/%s', $node), $opts));
9797
$ret = new CatalogNodeResponse();
9898
$this->_unmarshalResponse($resp, $ret);
9999
return $ret;
100100
}
101101

102-
public function GatewayServices(string $gateway, ?QueryOptions $opts = null): GatewayServicesResponse
102+
public function GatewayServices(string $gateway, null|QueryOptions $opts = null): GatewayServicesResponse
103103
{
104104
$resp = $this->_requireOK($this->_doGet(sprintf('v1/catalog/gateway-services/%s', urlencode($gateway)), $opts));
105105
$ret = new GatewayServicesResponse();

src/Coordinate/CoordinateClient.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@ public function Datacenters(): CoordinateDatacentersResponse
3636
return $ret;
3737
}
3838

39-
public function Nodes(?QueryOptions $opts = null): CoordinateEntriesResponse
39+
public function Nodes(null|QueryOptions $opts = null): CoordinateEntriesResponse
4040
{
4141
$resp = $this->_requireOK($this->_doGet('v1/coordinate/nodes', $opts));
4242
$ret = new CoordinateEntriesResponse();
4343
$this->_unmarshalResponse($resp, $ret);
4444
return $ret;
4545
}
4646

47-
public function Update(CoordinateEntry $coordinateEntry, ?WriteOptions $opts = null): WriteResponse
47+
public function Update(CoordinateEntry $coordinateEntry, null|WriteOptions $opts = null): WriteResponse
4848
{
4949
return $this->_executePut('v1/coordinate/update', $coordinateEntry, $opts);
5050
}
5151

52-
public function Node(string $node, ?QueryOptions $opts = null): CoordinateEntriesResponse
52+
public function Node(string $node, null|QueryOptions $opts = null): CoordinateEntriesResponse
5353
{
5454
$resp = $this->_requireOK($this->_doGet(sprintf('v1/coordinate/node/%s', $node), $opts));
5555
$ret = new CoordinateEntriesResponse();

src/Event/EventClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
class EventClient extends AbstractClient
2828
{
29-
public function Fire(UserEvent $event, ?WriteOptions $opts = null): UserEventResponse
29+
public function Fire(UserEvent $event, null|WriteOptions $opts = null): UserEventResponse
3030
{
3131
$r = $this->_newPutRequest(sprintf('v1/event/fire/%s', $event->Name), '' !== $event->Payload ? $event->Payload : null, $opts);
3232
if ('' !== ($nf = $event->NodeFilter)) {
@@ -44,7 +44,7 @@ public function Fire(UserEvent $event, ?WriteOptions $opts = null): UserEventRes
4444
return $ret;
4545
}
4646

47-
public function List(string $name = '', ?QueryOptions $opts = null): UserEventsResponse
47+
public function List(string $name = '', null|QueryOptions $opts = null): UserEventsResponse
4848
{
4949
$r = $this->_newGetRequest('v1/event/list', $opts);
5050
if ('' !== $name) {

src/Health/HealthClient.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ class HealthClient extends AbstractClient
3030
private const connectHealth = 'connect';
3131
private const ingressHealth = 'ingress';
3232

33-
public function Node(string $node, ?QueryOptions $opts = null): HealthChecksResponse
33+
public function Node(string $node, null|QueryOptions $opts = null): HealthChecksResponse
3434
{
3535
return $this->_getHealthChecks(sprintf('v1/health/node/%s', $node), $opts);
3636
}
3737

38-
public function Checks(string $service, ?QueryOptions $opts = null): HealthChecksResponse
38+
public function Checks(string $service, null|QueryOptions $opts = null): HealthChecksResponse
3939
{
4040
return $this->_getHealthChecks(sprintf('v1/health/checks/%s', $service), $opts);
4141
}
@@ -44,7 +44,7 @@ public function ServiceMultipleTags(
4444
string $service,
4545
array $tags = [],
4646
bool $passingOnly = false,
47-
?QueryOptions $opts = null
47+
null|QueryOptions $opts = null
4848
): ServiceEntriesResponse {
4949
return $this->_getServiceEntries($service, $tags, $passingOnly, $opts, self::serviceHealth);
5050
}
@@ -53,7 +53,7 @@ public function Service(
5353
string $service,
5454
string $tag = '',
5555
bool $passingOnly = false,
56-
?QueryOptions $opts = null
56+
null|QueryOptions $opts = null
5757
): ServiceEntriesResponse {
5858
return $this->ServiceMultipleTags($service, '' !== $tag ? [$tag] : [], $passingOnly, $opts);
5959
}
@@ -62,7 +62,7 @@ public function IngressMultipleTags(
6262
string $service,
6363
array $tags = [],
6464
bool $passingOnly = false,
65-
?QueryOptions $opts = null
65+
null|QueryOptions $opts = null
6666
): ServiceEntriesResponse {
6767
return $this->_getServiceEntries($service, $tags, $passingOnly, $opts, self::ingressHealth);
6868
}
@@ -71,7 +71,7 @@ public function Ingress(
7171
string $service,
7272
string $tag = '',
7373
bool $passingOnly = false,
74-
?QueryOptions $opts = null
74+
null|QueryOptions $opts = null
7575
): ServiceEntriesResponse {
7676
return $this->IngressMultipleTags($service, '' !== $tag ? [$tag] : [], $passingOnly, $opts);
7777
}
@@ -80,7 +80,7 @@ public function ConnectMultipleTags(
8080
string $service,
8181
array $tags = [],
8282
bool $passingOnly = false,
83-
?QueryOptions $opts = null
83+
null|QueryOptions $opts = null
8484
): ServiceEntriesResponse {
8585
return $this->_getServiceEntries($service, $tags, $passingOnly, $opts, self::connectHealth);
8686
}
@@ -89,12 +89,12 @@ public function Connect(
8989
string $service,
9090
string $tag = '',
9191
bool $passingOnly = false,
92-
?QueryOptions $opts = null
92+
null|QueryOptions $opts = null
9393
): ServiceEntriesResponse {
9494
return $this->ConnectMultipleTags($service, '' !== $tag ? [$tag] : [], $passingOnly, $opts);
9595
}
9696

97-
public function State(string $state, ?QueryOptions $opts = null): HealthChecksResponse
97+
public function State(string $state, null|QueryOptions $opts = null): HealthChecksResponse
9898
{
9999
static $validStates = ['any', 'warning', 'critical', 'passing', 'unknown'];
100100

@@ -114,7 +114,7 @@ public function State(string $state, ?QueryOptions $opts = null): HealthChecksRe
114114
return $this->_getHealthChecks(sprintf('v1/health/state/%s', $state), $opts);
115115
}
116116

117-
protected function _getHealthChecks(string $path, ?QueryOptions $opts): HealthChecksResponse
117+
protected function _getHealthChecks(string $path, null|QueryOptions $opts): HealthChecksResponse
118118
{
119119
$resp = $this->_requireOK($this->_doGet($path, $opts));
120120
$ret = new HealthChecksResponse();
@@ -126,7 +126,7 @@ private function _getServiceEntries(
126126
string $service,
127127
array $tags,
128128
bool $passingOnly,
129-
?QueryOptions $opts,
129+
null|QueryOptions $opts,
130130
string $healthType
131131
): ServiceEntriesResponse {
132132
$uri = match ($healthType) {

0 commit comments

Comments
 (0)