Skip to content

Commit

Permalink
10.0.1: #279
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Jul 26, 2023
1 parent 9565c27 commit 0e47e4b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Core/lib/caller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
17 changes: 1 addition & 16 deletions Qa/Trace.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);});
}

Expand Down
2 changes: 2 additions & 0 deletions Qa/Trace/Frame.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];}
Expand Down
26 changes: 25 additions & 1 deletion Qa/lib/bt/entry.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
<?php
/**
* 2023-07-26 "Implement `df_bt_entry_file()`": https://github.com/mage2pro/core/issues/279
* @see \Df\Qa\Trace\Frame::filePath()
* @see \Df\Sentry\Trace::info()
* @used-by df_log_l()
* @used-by df_bt_entry_is_phtml()
* @used-by df_caller_module()
* @used-by \Df\Qa\Trace::__construct()
* @used-by \Df\Sentry\Trace::info()
*/
function df_bt_entry_file(array $e):string {return $e['file'];}
function df_bt_entry_file(array $e):string {return
/**
* 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()
*/
dfa($e, 'file', '')
;}

/**
* 2023-07-26
Expand Down
5 changes: 2 additions & 3 deletions Sentry/Trace.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down

0 comments on commit 0e47e4b

Please sign in to comment.