From 773bc1b5d9739289adec0ebf76b7b4e9f52c9cf3 Mon Sep 17 00:00:00 2001 From: Pavel Shevaev Date: Wed, 16 Aug 2023 14:10:53 +0300 Subject: [PATCH] Making PHPStan happy --- bhl.inc.php | 2 +- bhl_flt.inc.php | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bhl.inc.php b/bhl.inc.php index d8de72a..c67b661 100644 --- a/bhl.inc.php +++ b/bhl.inc.php @@ -128,7 +128,7 @@ function bhl_handle_error_result(array $ret_out, $err_file, $exit = true) { if(!is_file($err_file)) { - stderr("Something went wrong: " . (is_array($ret_out) ? implode("\n", $ret_out) : "????")); + stderr("Something went wrong: " . implode("\n", $ret_out)); if($exit) exit(1); } diff --git a/bhl_flt.inc.php b/bhl_flt.inc.php index 3b73d4a..269e9a7 100644 --- a/bhl_flt.inc.php +++ b/bhl_flt.inc.php @@ -2,7 +2,7 @@ namespace metagen_php; use Exception; -function flt_bhl_ref($val, $name, $struct, $args) +function flt_bhl_ref($val, $name, $struct, $str_args) { if(!$val) return $val; @@ -17,11 +17,9 @@ function flt_bhl_ref($val, $name, $struct, $args) if(!isset($val['fn'])) throw new Exception("Missing 'fn'"); - $signature = explode(",", $args); - if(!$signature) - throw new Exception("Invalid signature: $args"); + $args = explode(",", $str_args); - \taskman\bhl_validate_func_ref($module_file, $val['fn'], $signature); + \taskman\bhl_validate_func_ref($module_file, $val['fn'], $args); return $val; }