From 024b3bcab92a50894dc942cf26f0b9ed62124a77 Mon Sep 17 00:00:00 2001 From: Klemens Starybrat Date: Sun, 15 Dec 2024 11:45:07 +0100 Subject: [PATCH] Fix PHP 8.2 deprecation notices --- include/lcp-catlist.php | 2 ++ include/lcp-catlistdisplayer.php | 1 + tests/lcpcategory/test-currentCategory.php | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/lcp-catlist.php b/include/lcp-catlist.php index a7c0f90..b0cac96 100644 --- a/include/lcp-catlist.php +++ b/include/lcp-catlist.php @@ -19,6 +19,8 @@ class CatList{ private $instance = 0; private $utils; private $wrapper; + private $saved_post; + private $saved_wp_query; /** * Constructor gets the shortcode attributes as parameter diff --git a/include/lcp-catlistdisplayer.php b/include/lcp-catlistdisplayer.php index 5db544b..936156c 100644 --- a/include/lcp-catlistdisplayer.php +++ b/include/lcp-catlistdisplayer.php @@ -10,6 +10,7 @@ class CatListDisplayer { public $catlist; + private $parent; private $wrapper; private $templater; private $params = array(); diff --git a/tests/lcpcategory/test-currentCategory.php b/tests/lcpcategory/test-currentCategory.php index 2c63089..06c0d3f 100644 --- a/tests/lcpcategory/test-currentCategory.php +++ b/tests/lcpcategory/test-currentCategory.php @@ -89,7 +89,7 @@ public function test_single_post_page() { $cat_ID_2 = self::$test_cat_2; $this->go_to('/?p=' . self::$test_post_2); $this->assertQueryTrue('is_singular', 'is_single'); - $this->assertSame("${cat_ID_1},${cat_ID_2}", $lcpcategory->current_category('yes')); + $this->assertSame("{$cat_ID_1},{$cat_ID_2}", $lcpcategory->current_category('yes')); } public function test_post_with_excluded_cats() { @@ -137,7 +137,7 @@ public function test_other_mode() { $this->go_to('/?p=' . self::$test_post_2); $this->assertQueryTrue('is_singular', 'is_single'); $this->assertSame( - "-${cat_ID_1},-${cat_ID_2}", + "-{$cat_ID_1},-{$cat_ID_2}", $lcpcategory->current_category('other') ); }