-
-
Notifications
You must be signed in to change notification settings - Fork 88
Apply fixes from StyleCI #486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideThis PR applies StyleCI-driven code style updates by adding explicit nullable type hints (e.g., ?string, ?Closure, ?array) to parameters that already default to null across cluster traits, resource helpers, instance classes, exceptions, and tests, without changing runtime behavior. Class diagram for updated cluster traits and KubernetesCluster constructorclassDiagram
class KubernetesCluster {
+__construct(url: string = null)
}
class AuthenticatesCluster {
+withToken(token: string = null) $this
+withTokenFromCommandProvider(cmdPath: string, cmdArgs: string = null, tokenPath: string = null) $this
+loadTokenFromFile(path: string = null) $this
+httpAuthentication(username: string = null, password: string = null) $this
+withCertificate(path: string = null) $this
+withPrivateKey(path: string = null) $this
+withCaCertificate(path: string = null) $this
}
class LoadsFromKubeConfig {
+fromKubeConfigVariable(context: string = null) KubernetesCluster
+fromKubeConfigYaml(yaml: string, context: string = null) KubernetesCluster
+fromKubeConfigYamlFile(path: string = "/.kube/config", context: string = null) KubernetesCluster
+fromKubeConfigArray(kubeConfigArray: array, context: string = null) KubernetesCluster
-loadKubeConfigFromArray(kubeconfig: array, context: string = null) void
}
class MakesWebsocketCalls {
-makeWsRequest(path: string, callback: Closure = null, query: array) mixed
}
class RunsClusterOperations {
+exec(command: mixed, container: string = null, query: array) mixed
+attach(callback: Closure = null, container: string = null, query: array) mixed
-getApiPathPrefix(withNamespace: bool = true, preNamespaceAction: string = null) string
}
KubernetesCluster ..> AuthenticatesCluster : uses
KubernetesCluster ..> LoadsFromKubeConfig : uses
KubernetesCluster ..> MakesWebsocketCalls : uses
KubernetesCluster ..> RunsClusterOperations : uses
Class diagram for updated K8s core types and exceptionclassDiagram
class K8sResource {
+register(name: string = null) void
+getUniqueCrdMacro(kind: string = null, defaultVersion: string = null) string
+toArray(kind: string = null) array
+toJson(options: mixed = 0, kind: string = null) string
+toJsonPayload(kind: string = null) string
}
class K8sConfigMap {
+getData(name: string = null) mixed
}
class K8s {
+fromYamlFile(cluster: mixed, path: string, callback: Closure = null) K8sResource
+fromTemplatedYamlFile(cluster: mixed, path: string, replace: array, callback: Closure = null) K8sResource
+registerCrd(className: string, name: string = null) void
}
class PhpK8sException {
+__construct(message: mixed = null, code: int = 0, payload: array = null)
}
K8sResource <|-- K8sConfigMap
K8s ..> K8sResource : registers
K8s ..> K8sConfigMap : creates
PhpK8sException <|-- Exception
Class diagram for updated instance helper typesclassDiagram
class Container {
+setImage(image: string, tag: string = "latest") $this
+addPort(containerPort: int, protocol: string = "TCP", name: string = null) $this
}
class MountedVolume {
+readOnly() $this
+mountTo(mountPath: string, subPath: string = null) $this
}
class Volume {
+awsEbs(volumeId: string, fsType: string = "ext4") $this
+mountTo(mountPath: string, subPath: string = null) MountedVolume
}
class Probe {
+http(path: string = "/healthz", port: int = 8080, headers: array) $this
+tcp(port: int, host: string = null) $this
}
Volume ..> MountedVolume : creates
MountedVolume ..> Volume : from
Container ..> Probe : uses for checks
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Summary of ChangesHello @rennokki, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request aims to improve the overall code quality and maintainability by applying automated style fixes. The core change involves updating function signatures to explicitly declare nullable types for parameters that can accept Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request correctly applies nullable type hints to parameters across the codebase, aligning with modern PHP standards and improving type safety. The changes are consistent and well-executed. I've noted a few minor opportunities to update PHPDoc blocks to match the new function signatures for better consistency and clarity. Overall, this is a great improvement.
| * @return $this | ||
| */ | ||
| public function addPort(int $containerPort, string $protocol = 'TCP', string $name = null) | ||
| public function addPort(int $containerPort, string $protocol = 'TCP', ?string $name = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * @return $this | ||
| */ | ||
| public function tcp(int $port, string $host = null) | ||
| public function tcp(int $port, ?string $host = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| * @return $this | ||
| */ | ||
| public function withTokenFromCommandProvider(string $cmdPath, string $cmdArgs = null, string $tokenPath = null) | ||
| public function withTokenFromCommandProvider(string $cmdPath, ?string $cmdArgs = null, ?string $tokenPath = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
This pull request applies code style fixes from an analysis carried out by StyleCI.
For more information, click here.
Summary by Sourcery
Align nullable parameter type hints across the Kubernetes client library with StyleCI recommendations.
Enhancements: