File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -311,11 +311,22 @@ public function implementedEvents(): array
311
311
/**
312
312
* Returns action input params
313
313
*
314
- * @return array
314
+ * @param string|null $name Dot separated name of the value to read. Or null to read all data.
315
+ * @param mixed $default The default data.
316
+ * @return mixed The value being read.
315
317
*/
316
- public function getData (): array
318
+ public function getData ($ name = null , $ default = null )
317
319
{
318
- return $ this ->getService ()->getParser ()->getParams ();
320
+ $ data = $ this ->getService ()->getParser ()->getParams ();
321
+ if ($ name === null ) {
322
+ return $ data ;
323
+ }
324
+ if (!is_array ($ data ) && $ name ) {
325
+ return $ default ;
326
+ }
327
+
328
+ /** @psalm-suppress PossiblyNullArgument */
329
+ return Hash::get ($ data , $ name , $ default );
319
330
}
320
331
321
332
/**
You can’t perform that action at this time.
0 commit comments