diff --git a/Core/lib/caller.php b/Core/lib/caller.php index c5c65db75..1f850a747 100644 --- a/Core/lib/caller.php +++ b/Core/lib/caller.php @@ -160,5 +160,5 @@ function df_caller_module(int $o = 0):string { # https://github.com/mage2pro/core/issues/268 || df_bt_entry_is_phtml($e) ;})); - return df_bt_entry_is_method($e) ? df_module_name(df_cc_method($e)) : df_module_name_by_path($e['file']); + return df_bt_entry_is_method($e) ? df_module_name(df_cc_method($e)) : df_module_name_by_path(df_bt_entry_file($e)); } \ No newline at end of file diff --git a/Qa/Trace.php b/Qa/Trace.php index 9b5704b29..1a750a32e 100644 --- a/Qa/Trace.php +++ b/Qa/Trace.php @@ -24,24 +24,9 @@ function __construct(array $ff) { * а не возбуждает исключительную ситуацию. * Однако мне в стеке вызовов в любом случае не нужна бинарная каша, * поэтому я отсекаю ту часть стека, которая находится внутри Phar. - * 2023-01-28 - * 1) The 'file' key can be absent in a stack frame, e.g.: - * { - * "function": "loadClass", - * "class": "Composer\\Autoload\\ClassLoader", - * "type": "->", - * "args": ["Df\\Framework\\Plugin\\App\\Router\\ActionList\\Interceptor"] - * }, - * { - * "function": "spl_autoload_call", - * "args": ["Df\\Framework\\Plugin\\App\\Router\\ActionList\\Interceptor"] - * }, - * 2) «Argument 1 passed to df_starts_with() must be of the type string, null given, - * called in vendor/mage2pro/core/Qa/Trace.php on line 28»: https://github.com/mage2pro/core/issues/186 - * 3) @see \Df\Qa\Trace\Frame::filePath() * 2023-07-26 "Implement `df_filter_tail()`": https://github.com/mage2pro/core/issues/263 */ - $ff = df_filter_tail($ff, function(array $f):bool {return df_starts_with(dfa($f, 'file', ''), 'phar://');}); + $ff = df_filter_tail($ff, function(array $f):bool {return df_starts_with(df_bt_entry_file($f), 'phar://');}); $this->_frames = df_map($ff, function(array $f):F {return F::i($f);}); } diff --git a/Qa/Trace/Frame.php b/Qa/Trace/Frame.php index a557bed3a..8213b3d69 100644 --- a/Qa/Trace/Frame.php +++ b/Qa/Trace/Frame.php @@ -20,6 +20,8 @@ final class Frame extends \Df\Core\O { * 2) @see \Df\Qa\Trace::__construct() * 3) «Argument 1 passed to df_path_relative() must be of the type string, null given, * called in vendor/mage2pro/core/Qa/Trace/Formatter.php on line 37»: https://github.com/mage2pro/core/issues/187 + * @see df_bt_entry_file() + * @see \Df\Sentry\Trace::info() * @used-by \Df\Qa\Trace\Formatter::frame() */ function filePath():string {return (string)$this['file'];} diff --git a/Qa/lib/bt/entry.php b/Qa/lib/bt/entry.php index c6dc9ac6e..2c2f8502e 100644 --- a/Qa/lib/bt/entry.php +++ b/Qa/lib/bt/entry.php @@ -1,10 +1,34 @@ ", + * "args": ["Df\\Framework\\Plugin\\App\\Router\\ActionList\\Interceptor"] + * }, + * { + * "function": "spl_autoload_call", + * "args": ["Df\\Framework\\Plugin\\App\\Router\\ActionList\\Interceptor"] + * }, + * 2) «Argument 1 passed to df_starts_with() must be of the type string, null given, + * called in vendor/mage2pro/core/Qa/Trace.php on line 28»: https://github.com/mage2pro/core/issues/186 + * 3) @see \Df\Qa\Trace\Frame::filePath() + */ + dfa($e, 'file', '') +;} /** * 2023-07-26 diff --git a/Sentry/Trace.php b/Sentry/Trace.php index f5140c11e..c9071bfd9 100644 --- a/Sentry/Trace.php +++ b/Sentry/Trace.php @@ -34,9 +34,8 @@ static function info(array $frames):array { * @see \Df\Qa\Trace::__construct() * @see \Df\Qa\Trace\Frame::filePath() */ - if (array_key_exists('file', $frame)) { - $context = self::code((string)$frame['file'], (int)$frame['line']); - $file = $frame['file']; + if ($file = df_bt_entry_file($frame)) { + $context = self::code($file, (int)$frame['line']); } else { $file = ''; diff --git a/composer.json b/composer.json index 467254bc4..768df163c 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "mage2pro/core" - ,"version": "10.0.0" + ,"version": "10.0.1" ,"description": "Mage2.PRO core package." ,"type": "magento2-module" ,"homepage": "https://mage2.pro"