From cc42d01c7aacf179da09108749bbbe00502cca19 Mon Sep 17 00:00:00 2001 From: Philipp Daun Date: Mon, 22 Jun 2026 11:28:09 +0300 Subject: [PATCH 1/4] Add package param to installed tag --- src/Tags/Installed.php | 15 +++++++++++++++ tests/Tags/InstalledTest.php | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/src/Tags/Installed.php b/src/Tags/Installed.php index 242898c1b3f..dfeb6382d4e 100644 --- a/src/Tags/Installed.php +++ b/src/Tags/Installed.php @@ -6,6 +6,16 @@ class Installed extends Tags { + /** + * Check if composer package is installed via {{ installed package="*" }}. + * + * @return string|void + */ + public function index() + { + return $this->installed($this->params->get('package')); + } + /** * Check if composer package is installed via {{ installed:* }}. * @@ -13,6 +23,11 @@ class Installed extends Tags * @return string|void */ public function wildcard($package) + { + return $this->installed($package); + } + + protected function installed($package) { $installed = Composer::isInstalled($package); diff --git a/tests/Tags/InstalledTest.php b/tests/Tags/InstalledTest.php index 481d653cda9..bd5a9e1162a 100644 --- a/tests/Tags/InstalledTest.php +++ b/tests/Tags/InstalledTest.php @@ -34,4 +34,11 @@ public function it_can_check_if_package_is_installed_using_tag_pair() $this->assertEquals('yes', $this->tag('{{ installed:hasselhoff/baywatch-embeds }}yes{{ /installed:hasselhoff/baywatch-embeds }}')); $this->assertEquals('', $this->tag('{{ installed:hasselhoff/lotr-embeds }}yes{{ /installed:hasselhoff/lotr-embeds }}')); } + + #[Test] + public function it_can_check_if_package_is_installed_using_param() + { + $this->assertEquals('yes', $this->tag('{{ installed package="hasselhoff/baywatch-embeds" }}yes{{ /installed }}')); + $this->assertEquals('', $this->tag('{{ installed package="hasselhoff/lotr-embeds" }}yes{{ /installed }}')); + } } From 094c8dbd5ea84a4b11c7c8e8c014eeca38c9a8f9 Mon Sep 17 00:00:00 2001 From: Philipp Daun Date: Mon, 22 Jun 2026 18:59:59 +0300 Subject: [PATCH 2/4] Guard against empty package param --- src/Tags/Installed.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Tags/Installed.php b/src/Tags/Installed.php index dfeb6382d4e..2a8b85a41cd 100644 --- a/src/Tags/Installed.php +++ b/src/Tags/Installed.php @@ -13,7 +13,11 @@ class Installed extends Tags */ public function index() { - return $this->installed($this->params->get('package')); + if (! $package = $this->params->get('package')) { + return; + } + + return $this->installed($package); } /** From 2ef3a6a96f8e8649ce78bce3ddbce2cf936b03a7 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Tue, 23 Jun 2026 10:42:45 -0400 Subject: [PATCH 3/4] test --- tests/Tags/InstalledTest.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/Tags/InstalledTest.php b/tests/Tags/InstalledTest.php index bd5a9e1162a..a7694810c40 100644 --- a/tests/Tags/InstalledTest.php +++ b/tests/Tags/InstalledTest.php @@ -41,4 +41,11 @@ public function it_can_check_if_package_is_installed_using_param() $this->assertEquals('yes', $this->tag('{{ installed package="hasselhoff/baywatch-embeds" }}yes{{ /installed }}')); $this->assertEquals('', $this->tag('{{ installed package="hasselhoff/lotr-embeds" }}yes{{ /installed }}')); } + + #[Test] + public function it_outputs_empty_when_passing_nothing() + { + $this->assertEquals('', $this->tag('{{ installed package="" }}yes{{ /installed }}')); + $this->assertEquals('', $this->tag('{{ installed :package="null" }}yes{{ /installed }}')); + } } From 34951b7db6807a43f01158441ec66361b80c986d Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Tue, 23 Jun 2026 10:43:18 -0400 Subject: [PATCH 4/4] nit --- src/Tags/Installed.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Tags/Installed.php b/src/Tags/Installed.php index 2a8b85a41cd..8c403214a4d 100644 --- a/src/Tags/Installed.php +++ b/src/Tags/Installed.php @@ -7,7 +7,7 @@ class Installed extends Tags { /** - * Check if composer package is installed via {{ installed package="*" }}. + * Check if composer package is installed via {{ installed package="vendor/package" }}. * * @return string|void */