Add Core\Logger to the introspection skip class list

- Make class list explicit to avoid confusion between similar class names
- Update skipped class string match to a safer "starts with" condition
This commit is contained in:
Hypolite Petovan 2022-12-28 17:54:37 -05:00
parent 9dbcbe0482
commit 8b1947bd78
2 changed files with 4 additions and 5 deletions

View File

@ -20,8 +20,6 @@
*/ */
namespace Friendica\Core\Logger\Capabilities; namespace Friendica\Core\Logger\Capabilities;
use Friendica\Core\Logger\Factory\Logger;
use Friendica\Util\Profiler;
interface IHaveCallIntrospections interface IHaveCallIntrospections
{ {
@ -31,9 +29,10 @@ interface IHaveCallIntrospections
* @var string[] * @var string[]
*/ */
public const IGNORE_CLASS_LIST = [ public const IGNORE_CLASS_LIST = [
Logger::class, \Friendica\Core\Logger::class,
Profiler::class, \Friendica\Core\Logger\Factory\Logger::class,
'Friendica\\Core\\Logger\\Type', 'Friendica\\Core\\Logger\\Type',
\Friendica\Util\Profiler::class,
]; ];
/** /**

View File

@ -104,7 +104,7 @@ class Introspection implements IHaveCallIntrospections
if (isset($traceItem['class'])) { if (isset($traceItem['class'])) {
foreach ($this->skipClassesPartials as $part) { foreach ($this->skipClassesPartials as $part) {
if (strpos($traceItem['class'], $part) !== false) { if (strpos($traceItem['class'], $part) === 0) {
return true; return true;
} }
} }