public function __construct($hash, $name, $value, array &$args, array $targs) { $global = get_default($args, 'global', false); if ($global) { $nameParts = LibraryManager::SplitNamespace($value); $value = $nameParts[\count($nameParts) - 1]; } parent::__construct(InfoKind::T_FUNC, $hash, $name, $value, $args, $targs); grokit_assert(array_key_exists('input', $args), 'Malformed return value from function generator ' . $name . ': No input defined.'); $this->args = $args['input']; grokit_assert(array_key_exists('result', $args), 'Malformed return value from function generator ' . $name . ': No result type defined.'); $this->resultType = $args['result']; if (array_key_exists('deterministic', $args)) { $this->deterministic = $args['deterministic']; } }
public function __construct($kind, $hash, $name, $value, array $args, array $targs) { parent::__construct($kind, $hash, $name, $value, $args, $targs); if (array_key_exists('required_states', $args)) { $this->req_states = $args['required_states']; } if (array_key_exists('generated_state', $args)) { $this->gen_state = $args['generated_state']; } $this->configurable = get_default($args, 'configurable', false); if (array_key_exists('generated_states', $args)) { grokit_warning('"generated_states" type information parameter is deprecated. Please use "generated_state" instead.'); $this->gen_states = ensure_unique_names($args['generated_states'], 'gen_state'); if (is_null($this->gen_state) && \count($this->gen_states) == 1) { $this->gen_state = array_get_index($this->gen_states, 0); } } if (array_key_exists('constructor_args', $args)) { grokit_warning('"constructor_args" type information parameter is deprecated.'); $this->constructor_args = ensure_unique_names($args['constructor_args'], 'const_arg'); } }