Conversation
There was a problem hiding this comment.
Copilot reviewed 32 out of 51 changed files in this pull request and generated 2 comments.
Files not reviewed (19)
- src/ACL/ACLAuthMethod.php: Language not supported
- src/ACL/ACLAuthMethodListEntry.php: Language not supported
- src/ACL/ACLAuthMethodListEntryQueryResponse.php: Language not supported
- src/ACL/ACLAuthMethodNamespaceRule.php: Language not supported
- src/ACL/ACLAuthMethodQueryResponse.php: Language not supported
- src/ACL/ACLAuthMethodWriteResponse.php: Language not supported
- src/ACL/ACLBindingRule.php: Language not supported
- src/ACL/ACLBindingRuleQueryResponse.php: Language not supported
- src/ACL/ACLBindingRuleWriteResponse.php: Language not supported
- src/ACL/ACLBindingRulesQueryResponse.php: Language not supported
- src/ACL/ACLClient.php: Language not supported
- src/ACL/ACLEntriesResponse.php: Language not supported
- src/ACL/ACLEntry.php: Language not supported
- src/ACL/ACLLink.php: Language not supported
- src/ACL/ACLLoginParams.php: Language not supported
- src/ACL/ACLNodeIdentity.php: Language not supported
- src/ACL/ACLOIDCAuthURLParams.php: Language not supported
- src/ACL/ACLOIDCCallbackParams.php: Language not supported
- src/ACL/ACLPolicy.php: Language not supported
Comments suppressed due to low confidence (1)
README.md:106
- There appears to be an extra closing bracket in the client instantiation, which may lead to a syntax error in the example code. Consider removing the extra bracket.
$proxyClient = new \GuzzleHttp\Client(['proxy' => 'whatever proxy you want']]);
There was a problem hiding this comment.
Copilot reviewed 41 out of 60 changed files in this pull request and generated 1 comment.
Files not reviewed (19)
- src/ACL/ACLAuthMethod.php: Language not supported
- src/ACL/ACLAuthMethodListEntry.php: Language not supported
- src/ACL/ACLAuthMethodListEntryQueryResponse.php: Language not supported
- src/ACL/ACLAuthMethodNamespaceRule.php: Language not supported
- src/ACL/ACLAuthMethodQueryResponse.php: Language not supported
- src/ACL/ACLAuthMethodWriteResponse.php: Language not supported
- src/ACL/ACLBindingRule.php: Language not supported
- src/ACL/ACLBindingRuleQueryResponse.php: Language not supported
- src/ACL/ACLBindingRuleWriteResponse.php: Language not supported
- src/ACL/ACLBindingRulesQueryResponse.php: Language not supported
- src/ACL/ACLClient.php: Language not supported
- src/ACL/ACLEntriesResponse.php: Language not supported
- src/ACL/ACLEntry.php: Language not supported
- src/ACL/ACLLink.php: Language not supported
- src/ACL/ACLLoginParams.php: Language not supported
- src/ACL/ACLNodeIdentity.php: Language not supported
- src/ACL/ACLOIDCAuthURLParams.php: Language not supported
- src/ACL/ACLOIDCCallbackParams.php: Language not supported
- src/ACL/ACLPolicy.php: Language not supported
Comments suppressed due to low confidence (1)
README.md:106
- An extra closing bracket appears in the instantiation of \GuzzleHttp\Client, which may result in a syntax error. Please remove the additional bracket.
$proxyClient = new \GuzzleHttp\Client(['proxy' => 'whatever proxy you want']]);
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Daniel Carbone <daniel.p.carbone@gmail.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 158 out of 555 changed files in this pull request and generated 12 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| public function jsonSerialize(): \stdClass | ||
| { | ||
| $out = $this->_startJsonSerialize(); |
There was a problem hiding this comment.
jsonSerialize() currently returns an empty object and does not include the Mode field at all, which will silently drop data on encode. Serialize Mode (likely as $this->Mode->value, consistent with other enum-backed fields) and omit it only when it is MeshGatewayMode::Default if that's the desired behavior.
| $out = $this->_startJsonSerialize(); | |
| $out = $this->_startJsonSerialize(); | |
| if (MeshGatewayMode::Default !== $this->Mode) { | |
| $out->Mode = $this->Mode->value; | |
| } |
| } elseif ('CipherSuites' === $k || 'cipher_suites' === $k) { | ||
| $n->setcipherSuites(...$v); | ||
| } elseif ('SDS' === $k) { |
There was a problem hiding this comment.
Method call uses the wrong casing (setcipherSuites) but the class defines setCipherSuites. In PHP this is a fatal error at runtime. Rename the call to setCipherSuites(...$v).
| } elseif ('HashPolicies' === $k || 'hash_policies' === $k) { | ||
| if (null !== $v) { | ||
| foreach ($v as $hp) { | ||
| $n->HashPolicies[] = HashPolicy::jsonUnserialize($hp); | ||
| } | ||
| } |
There was a problem hiding this comment.
$HashPolicies is declared as null|array and defaults to null, but jsonUnserialize() appends to it without initializing it to []. Appending to null will throw. Initialize $n->HashPolicies = []; before the inner loop (or call setHashPolicies(...)) when $v is non-null.
| if ('' !== $this->ServiceSubset) { | ||
| $out->service_subset = $this->ServiceSubset; | ||
| } |
There was a problem hiding this comment.
JSON output for ServiceSubset and SamenessGroup uses snake_case keys (service_subset, sameness_group) while most other fields in this model are serialized with Consul's usual PascalCase (e.g., Service, Namespace, Datacenter). Earlier versions of this model (per removed FIELDS) also used ServiceSubset. Unless the API explicitly requires snake_case here, this change is likely a breaking change for consumers and/or Consul compatibility. Prefer consistent key casing (and if you need to accept both on input, keep the dual-handling in jsonUnserialize).
| if ('' !== $this->SamenessGroup) { | ||
| $out->sameness_group = $this->SamenessGroup; | ||
| } |
There was a problem hiding this comment.
JSON output for ServiceSubset and SamenessGroup uses snake_case keys (service_subset, sameness_group) while most other fields in this model are serialized with Consul's usual PascalCase (e.g., Service, Namespace, Datacenter). Earlier versions of this model (per removed FIELDS) also used ServiceSubset. Unless the API explicitly requires snake_case here, this change is likely a breaking change for consumers and/or Consul compatibility. Prefer consistent key casing (and if you need to accept both on input, keep the dual-handling in jsonUnserialize).
| foreach ((array)$decoded as $k => $v) { | ||
| if ('only_passing' === $k) { | ||
| $n->OnlyPassing = $v; | ||
| } else { | ||
| $n->{$k} = $v; | ||
| } | ||
| } |
There was a problem hiding this comment.
The legacy field name for this property was OnlyPassing (PascalCase). jsonUnserialize() now only maps only_passing, so payloads containing OnlyPassing will no longer populate the property. If Consul returns/accepts OnlyPassing here (consistent with many other endpoints), this will break decoding. Consider accepting both (OnlyPassing and only_passing) similarly to other models in this PR.
| foreach ($checkInfos as $checkInfo) { | ||
| $this->AgentServiceChecksInfos[] = AgentServiceChecksInfo::jsonUnserialize($checkInfo); | ||
| } | ||
| $this->Err = $err; |
There was a problem hiding this comment.
This class no longer uses the ErrorContainer trait (which previously defined $Err), but it still assigns $this->Err. If AbstractResponse does not define $Err, this will create a dynamic property (deprecated in PHP 8.2+ and potentially a runtime error depending on settings). Declare public null|Error $Err = null; here, or ensure the parent class defines it explicitly.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Daniel Carbone <daniel.p.carbone@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Daniel Carbone <daniel.p.carbone@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Daniel Carbone <daniel.p.carbone@gmail.com>
Goals:
FakeMapclass.FakeSliceclass.ScalarTypeinterface.Transcodingtype and usage.UnmarshallerandMarshallertraits and flow.Time\Durationvalues to acceptnull|int|float|string|\DateInterval|Time\Durationfor construction.enumtypes for enum values.