Skip to content

Commit 50965f3

Browse files
committed
some updates
1 parent 55e268c commit 50965f3

28 files changed

+798
-270
lines changed

src/ACL/ACLAuthMethod.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class ACLAuthMethod extends AbstractModel
4141
public string $Partition;
4242

4343
/**
44-
* @param null|\stdClass|array<string,mixed> $Config
44+
* @param array<string,mixed> $Config
4545
* @param array<\DCarbone\PHPConsulAPI\ACL\ACLAuthMethodNamespaceRule> $NamespaceRules
4646
*/
4747
public function __construct(
@@ -51,7 +51,7 @@ public function __construct(
5151
string $Description = '',
5252
null|int|float|string|\DateInterval|Time\Duration $MaxTokenTTL = null,
5353
string $TokenLocality = '',
54-
null|\stdClass|array $Config = null,
54+
array $Config = [],
5555
int $CreateIndex = 0,
5656
int $ModifyIndex = 0,
5757
array $NamespaceRules = [],
@@ -184,7 +184,7 @@ public function setModifyIndex(int $ModifyIndex): self
184184
}
185185

186186
/**
187-
* @return \DCarbone\PHPConsulAPI\ACL\ACLAuthMethodNamespaceRule[]
187+
* @return array<\DCarbone\PHPConsulAPI\ACL\ACLAuthMethodNamespaceRule>
188188
*/
189189
public function getNamespaceRules(): array
190190
{

src/ACL/ACLAuthMethodNamespaceRule.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ class ACLAuthMethodNamespaceRule extends AbstractModel
2727
public string $Selector;
2828
public string $BindNamespace;
2929

30-
public function __construct(
31-
string $Selector = '',
32-
string $BindNamespace = '',
33-
) {
30+
public function __construct(string $Selector = '', string $BindNamespace = '')
31+
{
3432
$this->Selector = $Selector;
3533
$this->BindNamespace = $BindNamespace;
36-
}
34+
}
3735

3836
public function getSelector(): string
3937
{

src/ACL/ACLBindingRule.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ACLBindingRule extends AbstractModel
2828
public string $Description;
2929
public string $AuthMethod;
3030
public string $Selector;
31-
public string $BindType;
31+
public BindingRuleBindType $BindType;
3232
public string $BindName;
3333
public int $CreateIndex;
3434
public int $ModifyIndex;
@@ -39,7 +39,7 @@ public function __construct(
3939
string $Description = '',
4040
string $AuthMethod = '',
4141
string $Selector = '',
42-
string $BindType = '',
42+
string|BindingRuleBindType $BindType = BindingRuleBindType::UNDEFINED,
4343
string $BindName = '',
4444
int $CreateIndex = 0,
4545
int $ModifyIndex = 0,
@@ -49,7 +49,7 @@ public function __construct(
4949
$this->Description = $Description;
5050
$this->AuthMethod = $AuthMethod;
5151
$this->Selector = $Selector;
52-
$this->BindType = $BindType;
52+
$this->BindType = ($BindType instanceof BindingRuleBindType) ? $BindType : BindingRuleBindType::from($BindType);
5353
$this->BindName = $BindName;
5454
$this->CreateIndex = $CreateIndex;
5555
$this->ModifyIndex = $ModifyIndex;
@@ -100,12 +100,12 @@ public function setSelector(string $Selector): self
100100
return $this;
101101
}
102102

103-
public function getBindType(): string
103+
public function getBindType(): BindingRuleBindType
104104
{
105105
return $this->BindType;
106106
}
107107

108-
public function setBindType(string $BindType): self
108+
public function setBindType(BindingRuleBindType $BindType): self
109109
{
110110
$this->BindType = $BindType;
111111
return $this;

src/ACL/ACLLink.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ class ACLLink extends AbstractModel
2727
public string $ID;
2828
public string $Name;
2929

30-
public function __construct(
31-
string $ID = '',
32-
string $Name = '',
33-
) {
30+
public function __construct(string $ID = '', string $Name = '')
31+
{
3432
$this->ID = $ID;
3533
$this->Name = $Name;
36-
}
34+
}
3735

3836
public function getID(): string
3937
{

src/ACL/ACLLoginParams.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ class ACLLoginParams extends AbstractModel
3131
public string $BearerToken;
3232

3333
/**
34-
* @param \stdClass|array<string,string>|null $Meta
34+
* @param array<string,string> $Meta
3535
*/
3636
public function __construct(
3737
string $AuthMethod = '',
3838
string $BearerToken = '',
39-
null|\stdClass|array $Meta = null,
39+
array $Meta = [],
4040
) {
4141
$this->AuthMethod = $AuthMethod;
4242
$this->BearerToken = $BearerToken;

src/ACL/ACLNodeIdentity.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,11 @@ class ACLNodeIdentity extends AbstractModel
2727
public string $NodeName;
2828
public string $Datacenter;
2929

30-
public function __construct(
31-
string $NodeName = '',
32-
string $Datacenter = ''
33-
) {
30+
public function __construct(string $NodeName = '', string $Datacenter = '')
31+
{
3432
$this->NodeName = $NodeName;
3533
$this->Datacenter = $Datacenter;
36-
}
34+
}
3735

3836
public function getNodeName(): string
3937
{

src/ACL/ACLOIDCAuthURLParams.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ class ACLOIDCAuthURLParams extends AbstractModel
3232
public string $ClientNonce;
3333

3434
/**
35-
* @param \stdClass|array<string,string>|null $Meta
35+
* @param array<string,string> $Meta
3636
*/
3737
public function __construct(
3838
string $AuthMethod = '',
3939
string $RedirectURI = '',
4040
string $ClientNonce = '',
41-
null|\stdClass|array $Meta = null
41+
array $Meta = [],
4242
) {
4343
$this->AuthMethod = $AuthMethod;
4444
$this->RedirectURI = $RedirectURI;

src/ACL/ACLServiceIdentity.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,14 @@ class ACLServiceIdentity extends AbstractModel
2828
/** @var string[] */
2929
public array $Datacenters;
3030

31-
public function __construct(
32-
string $ServiceName = '',
33-
iterable $Datacenters = []
34-
) {
31+
/**
32+
* @param array<string> $Datacenters
33+
*/
34+
public function __construct(string $ServiceName = '', array $Datacenters = [])
35+
{
3536
$this->ServiceName = $ServiceName;
3637
$this->setDatacenters(...$Datacenters);
37-
}
38+
}
3839

3940
public function getServiceName(): string
4041
{

src/ACL/ACLTemplatedPolicy.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ class ACLTemplatedPolicy extends AbstractModel
2929
/** @var string[] */
3030
public array $Datacenters;
3131

32+
/**
33+
* @param array<string> $Datacenters
34+
*/
3235
public function __construct(
3336
string $TemplateName = '',
3437
null|ACLTemplatedPolicyVariables $TemplateVariables = null,

src/ACL/ACLToken.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ public function __construct(
4040
string $AccessorID = '',
4141
string $SecretID = '',
4242
string $Description = '',
43-
iterable $Policies = [],
44-
iterable $Roles = [],
45-
iterable $ServiceIdentities = [],
46-
iterable $NodeIdentities = [],
47-
iterable $TemplatePolicies = [],
43+
array $Policies = [],
44+
array $Roles = [],
45+
array $ServiceIdentities = [],
46+
array $NodeIdentities = [],
47+
array $TemplatePolicies = [],
4848
bool $Local = false,
4949
string $AuthMethod = '',
5050
null|int|float|string|\DateInterval|Time\Duration $ExpirationTTL = null,

0 commit comments

Comments
 (0)