Skip to content

Commit de2472f

Browse files
committed
Fix raw lookup when key doesn't exist
Resolves #3
1 parent 79c5a5b commit de2472f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

src/Runtime.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ public static function encq($var): string
7979
* @param array<array<mixed>|string|int>|string|int|bool|null $v value to be output
8080
* @param int $ex 1 to return untouched value, default is 0
8181
*
82-
* @return array<array<mixed>|string|int>|string The raw value of the specified variable
82+
* @return array<array<mixed>|string|int>|string|null The raw value of the specified variable
8383
*/
84-
public static function raw(array|string|int|bool|null $v, int $ex = 0): string|array
84+
public static function raw(array|string|int|bool|null $v, int $ex = 0): string|array|null
8585
{
8686
if ($ex) {
8787
return $v;

tests/RegressionTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,9 +1123,8 @@ public static function issueProvider(): array
11231123
],
11241124

11251125
[
1126-
'id' => 256,
1127-
'template' => '{{lookup . "foo"}}',
1128-
'data' => ['foo' => 'ok'],
1126+
'id' => 3,
1127+
'template' => 'ok{{{lookup . "missing"}}}',
11291128
'expected' => 'ok',
11301129
],
11311130

0 commit comments

Comments
 (0)