@@ -82,11 +82,14 @@ protected function modify(string $key): string|null
82
82
: value ($ this ->values [$ key ]);
83
83
}
84
84
85
- /** Set one or more values. */
85
+ /**
86
+ * Set one or more values.
87
+ *
88
+ * @param string|array<string, string> $key
89
+ */
86
90
public function set (string |array $ key , string |Closure |null $ value = null ): string |array |null
87
91
{
88
92
if (is_array ($ key )) {
89
- /** @var array<string, string> $key */
90
93
foreach ($ key as $ k => $ v ) {
91
94
$ this ->set ($ k , $ v );
92
95
}
@@ -166,7 +169,7 @@ public function flipp(string $alias, string|array $data = null): string|static
166
169
];
167
170
}
168
171
169
- $ query = base64_encode (json_encode ($ data ));
172
+ $ query = base64_encode (json_encode ($ data, JSON_THROW_ON_ERROR ));
170
173
171
174
/** @var string $template */
172
175
$ template = $ this ->meta ("flipp.templates. $ alias " );
@@ -220,7 +223,7 @@ public function tag(string $property, string $content): static
220
223
* Get or set metadata.
221
224
* @param string|array $key The key or key-value pair being set.
222
225
* @param string|array|null $value The value (if a single key is provided).
223
- * @return $this|string
226
+ * @return $this|string|null
224
227
*/
225
228
public function meta (string |array $ key , string |array $ value = null ): mixed
226
229
{
@@ -281,7 +284,11 @@ public function __get(string $key): string|null
281
284
return $ this ->get (Str::snake ($ key , '. ' ));
282
285
}
283
286
284
- /** Handle magic set. */
287
+ /**
288
+ * Handle magic set.
289
+ *
290
+ * @return string|array|null
291
+ */
285
292
public function __set (string $ key , string $ value )
286
293
{
287
294
return $ this ->set (Str::snake ($ key , '. ' ), $ value );
0 commit comments