1515use RenokiCo \PhpK8s \Exceptions \KubernetesLogsException ;
1616use RenokiCo \PhpK8s \Exceptions \KubernetesScalingException ;
1717use RenokiCo \PhpK8s \Exceptions \KubernetesWatchException ;
18- use RenokiCo \PhpK8s \Kinds \K8sResource ;
1918use RenokiCo \PhpK8s \Kinds \K8sScale ;
2019use RenokiCo \PhpK8s \KubernetesCluster ;
2120use RenokiCo \PhpK8s \Patches \JsonMergePatch ;
@@ -107,10 +106,8 @@ public function refreshResourceVersion(): static
107106 /**
108107 * Create or update the resource, wether the resource exists
109108 * or not within the cluster.
110- *
111- * @return $this
112109 */
113- public function syncWithCluster (array $ query = ['pretty ' => 1 ]): K8sResource
110+ public function syncWithCluster (array $ query = ['pretty ' => 1 ]): static
114111 {
115112 try {
116113 return $ this ->get ($ query );
@@ -121,10 +118,8 @@ public function syncWithCluster(array $query = ['pretty' => 1]): K8sResource
121118
122119 /**
123120 * Create or update the app based on existence.
124- *
125- * @return $this
126121 */
127- public function createOrUpdate (array $ query = ['pretty ' => 1 ]): K8sResource
122+ public function createOrUpdate (array $ query = ['pretty ' => 1 ]): static
128123 {
129124 if ($ this ->exists ($ query )) {
130125 $ this ->update ($ query );
@@ -174,10 +169,9 @@ public function allNamespaces(array $query = ['pretty' => 1]): ResourcesList
174169 /**
175170 * Get a fresh instance from the cluster.
176171 *
177- *
178172 * @throws KubernetesAPIException
179173 */
180- public function get (array $ query = ['pretty ' => 1 ]): K8sResource
174+ public function get (array $ query = ['pretty ' => 1 ]): static
181175 {
182176 return $ this ->cluster
183177 ->setResourceClass (get_class ($ this ))
@@ -192,10 +186,9 @@ public function get(array $query = ['pretty' => 1]): K8sResource
192186 /**
193187 * Create the resource.
194188 *
195- *
196189 * @throws KubernetesAPIException
197190 */
198- public function create (array $ query = ['pretty ' => 1 ]): K8sResource
191+ public function create (array $ query = ['pretty ' => 1 ]): static
199192 {
200193 return $ this ->cluster
201194 ->setResourceClass (get_class ($ this ))
@@ -604,7 +597,7 @@ public function resourceStatusPath(): string
604597 /**
605598 * Update the status subresource.
606599 */
607- public function updateStatus (array $ query = ['pretty ' => 1 ]): self
600+ public function updateStatus (array $ query = ['pretty ' => 1 ]): static
608601 {
609602 $ this ->refreshOriginal ();
610603 $ this ->refreshResourceVersion ();
@@ -622,9 +615,9 @@ public function updateStatus(array $query = ['pretty' => 1]): self
622615 /**
623616 * JSON Patch (RFC 6902) the status subresource.
624617 */
625- public function jsonPatchStatus (JsonPatch |array $ patch , array $ query = ['pretty ' => 1 ]): self
618+ public function jsonPatchStatus (JsonPatch |array $ patch , array $ query = ['pretty ' => 1 ]): static
626619 {
627- if (! $ patch instanceof JsonPatch ) {
620+ if (is_array ( $ patch) ) {
628621 $ patch = new JsonPatch ($ patch );
629622 }
630623
@@ -645,9 +638,9 @@ public function jsonPatchStatus(JsonPatch|array $patch, array $query = ['pretty'
645638 /**
646639 * JSON Merge Patch (RFC 7396) the status subresource.
647640 */
648- public function jsonMergePatchStatus (JsonMergePatch |array $ patch , array $ query = ['pretty ' => 1 ]): self
641+ public function jsonMergePatchStatus (JsonMergePatch |array $ patch , array $ query = ['pretty ' => 1 ]): static
649642 {
650- if (! $ patch instanceof JsonMergePatch ) {
643+ if (is_array ( $ patch) ) {
651644 $ patch = new JsonMergePatch ($ patch );
652645 }
653646
0 commit comments