@@ -148,7 +148,7 @@ public function __invoke(int $errorNumber, string $errorString, string $errorFil
148
148
$ suppressed ,
149
149
$ ignoredByBaseline ,
150
150
$ ignoredByTest ,
151
- $ this ->trigger ($ test ),
151
+ $ this ->trigger ($ test, false ),
152
152
);
153
153
154
154
break ;
@@ -162,7 +162,7 @@ public function __invoke(int $errorNumber, string $errorString, string $errorFil
162
162
$ suppressed ,
163
163
$ ignoredByBaseline ,
164
164
$ ignoredByTest ,
165
- $ this ->trigger ($ test ),
165
+ $ this ->trigger ($ test, true ),
166
166
);
167
167
168
168
break ;
@@ -246,13 +246,13 @@ private function ignoredByBaseline(string $file, int $line, string $description)
246
246
return $ this ->baseline ->has (Issue::from ($ file , $ line , null , $ description ));
247
247
}
248
248
249
- private function trigger (TestMethod $ test ): IssueTrigger
249
+ private function trigger (TestMethod $ test, bool $ filterTrigger ): IssueTrigger
250
250
{
251
251
if (!$ this ->source ->notEmpty ()) {
252
252
return IssueTrigger::unknown ();
253
253
}
254
254
255
- $ trace = $ this ->cleanedTrace ();
255
+ $ trace = $ this ->cleanedTrace ($ filterTrigger );
256
256
257
257
assert (isset ($ trace [0 ]['file ' ]));
258
258
assert (isset ($ trace [1 ]['file ' ]));
@@ -281,14 +281,14 @@ private function trigger(TestMethod $test): IssueTrigger
281
281
return IssueTrigger::indirect ();
282
282
}
283
283
284
- private function cleanedTrace (): array
284
+ private function cleanedTrace (bool $ filterTrigger ): array
285
285
{
286
286
$ trace = debug_backtrace (DEBUG_BACKTRACE_IGNORE_ARGS );
287
287
288
288
// self::cleanedTrace(), self::trigger(), self::__invoke()
289
289
unset($ trace [0 ], $ trace [1 ], $ trace [2 ]);
290
290
291
- if ($ this ->deprecationTriggers === null ) {
291
+ if ($ this ->deprecationTriggers === null || ! $ filterTrigger ) {
292
292
return array_values ($ trace );
293
293
}
294
294
0 commit comments