@@ -70,6 +70,7 @@ public static function isFileIgnored(string $filePath): bool
7070 public static function isCallerIgnored (?string $ callerClass = null , ?string $ callerFunction = null ): bool
7171 {
7272 if (! Config::isRespectIgnoreTagsEnabled ()) {
73+ fwrite (STDERR , "[DEBUG IgnoreManager] respect_ignore_tags is disabled. \n" );
7374 return false ;
7475 }
7576
@@ -93,56 +94,74 @@ public static function isCallerIgnored(?string $callerClass = null, ?string $cal
9394 $ depth = Config::getIgnoreTraceDepth ();
9495 $ trace = debug_backtrace (DEBUG_BACKTRACE_IGNORE_ARGS , $ depth );
9596
97+ fwrite (STDERR , "\n======================================================= \n" );
98+ fwrite (STDERR , " [DEBUG IgnoreManager] Scanning trace (depth limit: {$ depth }, actual frames: " . \count ($ trace ) . ") \n" );
99+ fwrite (STDERR , "======================================================= \n" );
100+
96101 for ($ i = 1 ; $ i < \count ($ trace ); $ i ++) {
97102 $ frame = $ trace [$ i ];
98103 $ class = $ frame ['class ' ] ?? '' ;
99104 $ function = $ frame ['function ' ];
100105 $ file = $ frame ['file ' ] ?? '' ;
106+ $ line = $ frame ['line ' ] ?? '? ' ;
107+
108+ fwrite (STDERR , " # {$ i } {$ class }:: {$ function }() called at [ {$ file }: {$ line }] \n" );
101109
102110 if ($ class !== '' && (str_starts_with ($ class , 'TypePHP \\Internal \\' ) || $ class === 'TypePHP \\TypePHP ' )) {
111+ fwrite (STDERR , " -> skipped (internal engine frame) \n" );
103112 continue ;
104113 }
105114
106115 if ($ class === '' && \in_array ($ function , ['call_user_func ' , 'call_user_func_array ' ], true )) {
116+ fwrite (STDERR , " -> skipped (call_user_func trampoline) \n" );
107117 continue ;
108118 }
109119
110- if ($ file !== '' && self ::isFileIgnored ($ file )) {
111- return true ;
120+ if ($ file !== '' ) {
121+ $ fileIsIgnored = self ::isFileIgnored ($ file );
122+ if ($ fileIsIgnored ) {
123+ fwrite (STDERR , " => [SUPPRESSED] File is registered in fileCache: {$ file }\n" );
124+ return true ;
125+ }
112126 }
113127
114128 if ($ class !== '' ) {
115129 $ key = $ class . ':: ' . $ function ;
116130 if (isset (self ::$ callerCache [$ key ])) {
117131 if (self ::$ callerCache [$ key ]) {
132+ fwrite (STDERR , " => [SUPPRESSED] Found cached ignored method: {$ key }\n" );
118133 return true ;
119134 }
120135
121136 continue ;
122137 }
123138
124139 if (self ::checkMethodIgnored ($ class , $ function )) {
140+ fwrite (STDERR , " => [SUPPRESSED] checkMethodIgnored returned TRUE for: {$ key }\n" );
125141 return self ::$ callerCache [$ key ] = true ;
126142 }
127143
128144 self ::$ callerCache [$ key ] = false ;
129145 } elseif (! str_contains ($ function , '{closure} ' )) {
130146 if (isset (self ::$ callerCache [$ function ])) {
131147 if (self ::$ callerCache [$ function ]) {
148+ fwrite (STDERR , " => [SUPPRESSED] Found cached ignored function: {$ function }\n" );
132149 return true ;
133150 }
134151
135152 continue ;
136153 }
137154
138155 if (self ::checkFunctionIgnored ($ function )) {
156+ fwrite (STDERR , " => [SUPPRESSED] checkFunctionIgnored returned TRUE for: {$ function }\n" );
139157 return self ::$ callerCache [$ function ] = true ;
140158 }
141159
142160 self ::$ callerCache [$ function ] = false ;
143161 }
144162 }
145163
164+ fwrite (STDERR , " => [NOT SUPPRESSED] No ignore tags found in scanned frames. \n\n" );
146165 return false ;
147166 }
148167
0 commit comments