Skip to content

Commit 49b59ce

Browse files
committed
Fixed missing throws
1 parent bd336e9 commit 49b59ce

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/Kinds/K8sResource.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ public function refreshOriginal(array $query = ['pretty' => 1])
448448
*
449449
* @param array $query
450450
* @return \RenokiCo\PhpK8s\ResourcesList
451+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesAPIException
451452
*/
452453
public function all(array $query = ['pretty' => 1])
453454
{
@@ -466,6 +467,7 @@ public function all(array $query = ['pretty' => 1])
466467
*
467468
* @param array $query
468469
* @return \RenokiCo\PhpK8s\Kinds\K8sResource
470+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesAPIException
469471
*/
470472
public function get(array $query = ['pretty' => 1])
471473
{
@@ -484,6 +486,7 @@ public function get(array $query = ['pretty' => 1])
484486
*
485487
* @param array $query
486488
* @return \RenokiCo\PhpK8s\Kinds\K8sResource
489+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesAPIException
487490
*/
488491
public function create(array $query = ['pretty' => 1])
489492
{
@@ -502,6 +505,7 @@ public function create(array $query = ['pretty' => 1])
502505
*
503506
* @param array $query
504507
* @return bool
508+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesAPIException
505509
*/
506510
public function update(array $query = ['pretty' => 1]): bool
507511
{
@@ -533,6 +537,7 @@ public function update(array $query = ['pretty' => 1]): bool
533537
* @param null|int $gracePeriod
534538
* @param string $propagationPolicy
535539
* @return bool
540+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesAPIException
536541
*/
537542
public function delete(array $query = ['pretty' => 1], $gracePeriod = null, string $propagationPolicy = 'Foreground'): bool
538543
{
@@ -650,11 +655,13 @@ public function watchByName(string $name, Closure $callback, array $query = ['pr
650655
*
651656
* @param array $query
652657
* @return string
658+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesLogsException
659+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesAPIException
653660
*/
654661
public function logs(array $query = ['pretty' => 1])
655662
{
656663
if (! $this instanceof Loggable) {
657-
throw new KubernetesWatchException(
664+
throw new KubernetesLogsException(
658665
'The resource '.get_class($this).' does not support logs.'
659666
);
660667
}
@@ -675,6 +682,8 @@ public function logs(array $query = ['pretty' => 1])
675682
* @param string $container
676683
* @param array $query
677684
* @return string
685+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesLogsException
686+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesAPIException
678687
*/
679688
public function containerLogs(string $container, array $query = ['pretty' => 1])
680689
{
@@ -688,6 +697,8 @@ public function containerLogs(string $container, array $query = ['pretty' => 1])
688697
* @param Closure $callback
689698
* @param array $query
690699
* @return string
700+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesLogsException
701+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesAPIException
691702
*/
692703
public function logsByName(string $name, array $query = ['pretty' => 1])
693704
{
@@ -702,6 +713,8 @@ public function logsByName(string $name, array $query = ['pretty' => 1])
702713
* @param Closure $callback
703714
* @param array $query
704715
* @return string
716+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesLogsException
717+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesAPIException
705718
*/
706719
public function containerLogsByName(string $name, string $container, array $query = ['pretty' => 1])
707720
{
@@ -766,6 +779,7 @@ public function watchContainerLogs(string $container, Closure $callback, array $
766779
* @param array $query
767780
* @return mixed
768781
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesWatchException
782+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesLogsException
769783
*/
770784
public function watchLogsByName(string $name, Closure $callback, array $query = ['pretty' => 1])
771785
{
@@ -792,6 +806,8 @@ public function watchContainerLogsByName(string $name, string $container, Closur
792806
* Get a specific resource scaling data.
793807
*
794808
* @return \RenokiCo\PhpK8s\Kinds\K8sScale
809+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesScalingException
810+
* @throws \RenokiCo\PhpK8s\Exceptions\KubernetesAPIException
795811
*/
796812
public function scaler(): K8sScale
797813
{

src/Traits/Cluster/LoadsFromKubeConfig.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ protected function loadKubeConfigFromArray(array $kubeconfig, string $context):
130130
* @param string $fileName
131131
* @param string $contents
132132
* @return string
133+
* @throws \Exception
133134
*/
134135
protected function writeTempFileForContext(string $context, string $fileName, string $contents)
135136
{

0 commit comments

Comments
 (0)