Skip to content

Commit

Permalink
Merge pull request #30 from renoki-co/analysis-OMOddl
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
rennokki authored Oct 28, 2020
2 parents 37d133f + ee1eaa7 commit 08ba225
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/KubernetesCluster.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace RenokiCo\PhpK8s;

use RenokiCo\PhpK8s\Kinds\K8sResource;
use Illuminate\Support\Str;
use RenokiCo\PhpK8s\Kinds\K8sResource;

class KubernetesCluster
{
Expand Down
14 changes: 7 additions & 7 deletions src/Traits/Cluster/LoadsFromKubeConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ trait LoadsFromKubeConfig
/**
* The absolute path to the temporary folder
* used to write base64-encoded SSL certs and keys
* to be able to load them in Guzzle
* to be able to load them in Guzzle.
*
* @var null|string
*/
Expand Down Expand Up @@ -132,7 +132,7 @@ protected function loadKubeConfigFromArray(array $kubeconfig, string $context):
* @return string
*/
protected function writeTempFileForContext(string $context, string $fileName, string $contents)
{
{
$tempFolder = static::$tempFolder ?: sys_get_temp_dir();

$tempFilePath = $tempFolder.DIRECTORY_SEPARATOR."ctx-{$context}-{$fileName}";
Expand All @@ -141,10 +141,10 @@ protected function writeTempFileForContext(string $context, string $fileName, st
return $tempFilePath;
}

if (file_put_contents($tempFilePath, base64_decode($contents, true)) === false) {
throw new Exception("Failed to write content to temp file: {$tempFilePath}");
}
if (file_put_contents($tempFilePath, base64_decode($contents, true)) === false) {
throw new Exception("Failed to write content to temp file: {$tempFilePath}");
}

return $tempFilePath;
}
return $tempFilePath;
}
}

0 comments on commit 08ba225

Please sign in to comment.