File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,17 +104,13 @@ $template = Handlebars::compile('{{#equals my_var false}}Equal to false{{else}}N
104104$options = [
105105 'helpers' => [
106106 'equals' => function (mixed $a, mixed $b, HelperOptions $options) {
107- $jsEquals = function (mixed $a, mixed $b): bool {
108- if ($a === null || $b === null || is_string($a) && is_string($b)) {
109- // In JS, null is not equal to blank string or false or zero,
110- // and when both operands are strings no coercion is performed.
111- return $a === $b;
112- }
113-
114- return $a == $b;
115- };
116-
117- return $jsEquals($a, $b) ? $options->fn() : $options->inverse();
107+ // In JS, null is not equal to blank string or false or zero,
108+ // and when both operands are strings no coercion is performed.
109+ $equal = ($a === null || $b === null || is_string($a) && is_string($b))
110+ ? $a === $b
111+ : $a == $b;
112+
113+ return $equal ? $options->fn() : $options->inverse();
118114 },
119115 ],
120116];
You can’t perform that action at this time.
0 commit comments