From 1fae862a2c42afe9181eea8e1220c936381ce076 Mon Sep 17 00:00:00 2001 From: Ivan Herak Date: Mon, 6 Nov 2023 10:27:16 +0100 Subject: [PATCH 1/3] NGSTACK-804 fix view cacheable method signature --- bundle/View/CacheableView.php | 2 +- bundle/View/TagView.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bundle/View/CacheableView.php b/bundle/View/CacheableView.php index 2ffb1af5..603c2920 100644 --- a/bundle/View/CacheableView.php +++ b/bundle/View/CacheableView.php @@ -9,7 +9,7 @@ interface CacheableView /** * Sets the cache as enabled/disabled. */ - public function setCacheEnabled(bool $cacheEnabled): void; + public function setCacheEnabled($cacheEnabled): void; /** * Indicates if cache is enabled or not. diff --git a/bundle/View/TagView.php b/bundle/View/TagView.php index 257faf5a..1c86d166 100644 --- a/bundle/View/TagView.php +++ b/bundle/View/TagView.php @@ -23,9 +23,9 @@ public function getTag(): Tag return $this->tag; } - public function setCacheEnabled(bool $cacheEnabled): void + public function setCacheEnabled($cacheEnabled): void { - $this->isCacheEnabled = $cacheEnabled; + $this->isCacheEnabled = (bool) $cacheEnabled; } public function isCacheEnabled(): bool From 512595ba47bccdca48beb24a346e76be7e017beb Mon Sep 17 00:00:00 2001 From: Ivan Herak Date: Mon, 6 Nov 2023 10:30:13 +0100 Subject: [PATCH 2/3] NGSTAC-804 add phpdocs for parameter with no type specified --- bundle/View/CacheableView.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bundle/View/CacheableView.php b/bundle/View/CacheableView.php index 603c2920..6a8f5b9b 100644 --- a/bundle/View/CacheableView.php +++ b/bundle/View/CacheableView.php @@ -8,6 +8,8 @@ interface CacheableView { /** * Sets the cache as enabled/disabled. + * + * @param bool $cacheEnabled */ public function setCacheEnabled($cacheEnabled): void; From 47942657adef2c1971362e59159aca6cb68603df Mon Sep 17 00:00:00 2001 From: Ivan Herak Date: Mon, 6 Nov 2023 10:34:10 +0100 Subject: [PATCH 3/3] NGSTACK-804 ignore expected error in phpstan --- phpstan.neon | 1 + 1 file changed, 1 insertion(+) diff --git a/phpstan.neon b/phpstan.neon index 62b00f57..face67bb 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -36,6 +36,7 @@ parameters: - "#Casting to int something that's already int.#" - '#should be contravariant with parameter#' - '#should be covariant with return type#' + - "#Casting to bool something that's already bool.#" # Errors caused by Ibexa Elasticsearch - '#Ibexa\\Contracts\\Elasticsearch#'