From d79fabda0f7d3ca255a67490e90c59a9049013ce Mon Sep 17 00:00:00 2001 From: Marian <42134098+IanDelMar@users.noreply.github.com> Date: Wed, 10 Sep 2025 17:17:28 +0200 Subject: [PATCH] Mark trailingslashit as pure --- functionMap.php | 2 +- tests/data/pure/trailingslashit.php | 18 ++++++++++++++++++ wordpress-stubs.php | 1 + 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 tests/data/pure/trailingslashit.php diff --git a/functionMap.php b/functionMap.php index eabe428..327aa5e 100644 --- a/functionMap.php +++ b/functionMap.php @@ -155,7 +155,7 @@ 'the_date' => ['($display is true ? void : string)'], 'the_modified_date' => ['($display is true ? void : string)'], 'the_title' => ['($display is true ? void : string|void)'], - 'trailingslashit' => ['non-falsy-string'], + 'trailingslashit' => ['non-falsy-string', '@phpstan-pure' => ''], 'urldecode_deep' => ['T', '@phpstan-template' => 'T', 'value' => 'T'], 'urlencode_deep' => ['T', '@phpstan-template' => 'T', 'value' => 'T'], 'validate_file' => ["(\$file is '' ? 0 : (\$allowed_files is empty ? 0|1|2 : 0|1|2|3))"], diff --git a/tests/data/pure/trailingslashit.php b/tests/data/pure/trailingslashit.php new file mode 100644 index 0000000..93e7cd4 --- /dev/null +++ b/tests/data/pure/trailingslashit.php @@ -0,0 +1,18 @@ +