1: <?php declare( strict_types = 1 );
2:
3: namespace Waves\Model;
4:
5: use Waves\Common\JsonBase;
6: use Waves\Common\Value;
7:
8: class ScriptMeta extends JsonBase
9: {
10: function metaVersion(): int { return $this->json->get( 'version' )->asInt(); }
11: /**
12: * Gets a map of callable functions with their arguments as ArgMeta
13: *
14: * @return array<string, array<int, ArgMeta>>
15: */
16: function callableFunctions(): array
17: {
18: $map = [];
19: $arrayFuncs = $this->json->get( 'callableFuncTypes' )->asArray();
20: foreach( $arrayFuncs as $key => $value )
21: {
22: $function = Value::as( $key )->asString();
23: $args = [];
24: $arrayArgs = Value::as( $value )->asArray();
25: foreach( $arrayArgs as $arg )
26: $args[] = Value::as( $arg )->asArgMeta();
27: $map[$function] = $args;
28: }
29:
30: return $map;
31: }
32: }
33: