From 45bb084ae5f3915c7e1bc4e758819c72008e557d Mon Sep 17 00:00:00 2001 From: szaimen Date: Sat, 11 Jun 2022 14:45:46 +0200 Subject: [PATCH 1/2] allow to use it even if no channel was provided Signed-off-by: szaimen --- php/src/Docker/DockerActionManager.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index 0d203bda..812d93ca 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -431,6 +431,10 @@ class DockerActionManager $tagArray = explode(':', $output['Config']['Image']); $tag = $tagArray[1]; apcu_add($cacheKey, $tag); + if ($tag === null) { + error_log("No tag was found when getting the current channel. You probably did not follow the documentation correctly. Changing the channel to the default 'latest'."); + $tag = 'latest'; + } return $tag; } catch (\Exception $e) { error_log('Could not get current channel ' . $e->getMessage()); From d5afe84c78dea7c68a51554ac1f2150860d74671 Mon Sep 17 00:00:00 2001 From: szaimen Date: Sat, 11 Jun 2022 14:52:49 +0200 Subject: [PATCH 2/2] fix false psalm report Signed-off-by: szaimen --- php/src/Docker/DockerActionManager.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index 812d93ca..6df3e635 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -431,6 +431,9 @@ class DockerActionManager $tagArray = explode(':', $output['Config']['Image']); $tag = $tagArray[1]; apcu_add($cacheKey, $tag); + /** + * @psalm-suppress TypeDoesNotContainNull + */ if ($tag === null) { error_log("No tag was found when getting the current channel. You probably did not follow the documentation correctly. Changing the channel to the default 'latest'."); $tag = 'latest';