From 26ff33a8b01ba8af1c02b3c1ddcd5936eb12f2a8 Mon Sep 17 00:00:00 2001 From: sebprt Date: Fri, 8 Nov 2024 15:32:25 +0100 Subject: [PATCH] Create a new expression to get file extension --- src/FileExtension.php | 37 ++++++++++++++++++++++++ src/StringExpressionLanguageProvider.php | 1 + 2 files changed, 38 insertions(+) create mode 100644 src/FileExtension.php diff --git a/src/FileExtension.php b/src/FileExtension.php new file mode 100644 index 0000000..c10187e --- /dev/null +++ b/src/FileExtension.php @@ -0,0 +1,37 @@ +compile(...)->bindTo($this), + $this->evaluate(...)->bindTo($this) + ); + } + + private function compile(string $value): string + { + return <<