taskman_bhl/bhl_flt.inc.php

29 lines
618 B
PHP
Raw Normal View History

2023-05-18 15:09:35 +03:00
<?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']}");
2023-05-18 15:09:35 +03:00
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);
2023-05-18 15:09:35 +03:00
return $val;
}