From 144b1974190fc1b784a14641ccfe5abe341f0795 Mon Sep 17 00:00:00 2001 From: Awilum Date: Tue, 31 May 2022 11:20:50 +0300 Subject: [PATCH] refactor(shortcodes): simplefy logic for `const` shortcode --- src/flextype/core/Parsers/Shortcodes/ConstShortcode.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php b/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php index 98df13d9..00137f65 100644 --- a/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/ConstShortcode.php @@ -28,12 +28,7 @@ parsers()->shortcodes()->addHandler('const', static function (ShortcodeInterface if ($s->getBBCode() !== null) { $const = parsers()->shortcodes()->parse($s->getBBCode()); - - if (defined($const)) { - return constant($const); - } else { - return ''; - } + return defined($const) ? constant($const) : ''; } return '';