@@ -58,24 +58,10 @@ public static function isec(mixed $v): bool
58
58
return $ v === null || $ v === false || (is_array ($ v ) && count ($ v ) === 0 );
59
59
}
60
60
61
- /**
62
- * For {{var}} .
63
- *
64
- * @param array<array|string|int>|string|int|null $var value to be htmlencoded
65
- */
66
- public static function enc ($ var ): string
67
- {
68
- if ($ var instanceof SafeString) {
69
- return (string ) $ var ;
70
- }
71
-
72
- return Encoder::enc ($ var );
73
- }
74
-
75
61
/**
76
62
* For {{var}} , do html encode just like handlebars.js .
77
63
*
78
- * @param array<array|string|int>|string|int|null $var value to be htmlencoded
64
+ * @param array<array|string|int>|string|SafeString| int|null $var value to be htmlencoded
79
65
*
80
66
* @return string The htmlencoded value of the specified variable
81
67
*/
@@ -91,7 +77,7 @@ public static function encq($var): string
91
77
/**
92
78
* Get string value
93
79
*
94
- * @param array<array|string|int>|string|int|null $v value to be output
80
+ * @param array<array|string|int>|string|int|bool| null $v value to be output
95
81
* @param int $ex 1 to return untouched value, default is 0
96
82
*
97
83
* @return array<array|string|int>|string|int|null The raw value of the specified variable
@@ -128,7 +114,7 @@ public static function raw($v, int $ex = 0)
128
114
/**
129
115
* For {{#var}} or {{#each}} .
130
116
*
131
- * @param array<array|string|int>|string|int|null|\Traversable $v value for the section
117
+ * @param array<array|string|int>|string|int|bool| null|\Traversable $v value for the section
132
118
* @param array<string>|null $bp block parameters
133
119
* @param array<array|string|int>|string|int|null $in input data with current scope
134
120
* @param bool $each true when rendering #each
@@ -239,7 +225,7 @@ public static function sec(RuntimeContext $cx, mixed $v, ?array $bp, mixed $in,
239
225
/**
240
226
* For {{#with}} .
241
227
*
242
- * @param array<array|string|int>|string|int|null $v value to be the new context
228
+ * @param array<array|string|int>|string|int|bool| null $v value to be the new context
243
229
* @param array<array|string|int>|\stdClass|null $in input data with current scope
244
230
* @param array<string>|null $bp block parameters
245
231
* @param \Closure $cb callback function to render child context
@@ -266,13 +252,13 @@ public static function wi(RuntimeContext $cx, mixed $v, ?array $bp, array|\stdCl
266
252
/**
267
253
* Get merged context.
268
254
*
269
- * @param array<array|string|int>|string|int|null $a the context to be merged
255
+ * @param array<array|string|int>|object| string|int|null $a the context to be merged
270
256
* @param array<array|string|int>|string|int|null $b the new context to overwrite
271
257
*
272
258
* @return array<array|string|int>|string|int the merged context object
273
259
*
274
260
*/
275
- public static function merge ($ a , $ b )
261
+ public static function merge (mixed $ a , mixed $ b )
276
262
{
277
263
if (is_array ($ b )) {
278
264
if ($ a === null ) {
0 commit comments