29 lines
618 B
PHP
29 lines
618 B
PHP
<?php
|
|
namespace metagen_php;
|
|
use Exception;
|
|
|
|
function flt_bhl_ref($val, $name, $struct, $args)
|
|
{
|
|
if(!$val)
|
|
return $val;
|
|
|
|
if(!isset($val['module']))
|
|
throw new Exception("Missing 'module'");
|
|
|
|
$module_file = \taskman\bhl_map_module_to_file($val['module']);
|
|
if(!$module_file)
|
|
throw new Exception("Module not found '{$val['module']}");
|
|
|
|
if(!isset($val['fn']))
|
|
throw new Exception("Missing 'fn'");
|
|
|
|
$signature = explode(",", $args);
|
|
if(!$signature)
|
|
throw new Exception("Invalid signature: $args");
|
|
|
|
\taskman\bhl_validate_func_ref($module_file, $val['fn'], $signature);
|
|
|
|
return $val;
|
|
}
|
|
|