@@ -107,7 +107,7 @@ public static function register($mode = 0)
107
107
108
108
$ trace = debug_backtrace (true );
109
109
$ group = 'other ' ;
110
-
110
+ $ isVendor = false ;
111
111
$ isWeak = DeprecationErrorHandler::MODE_WEAK === $ mode || (DeprecationErrorHandler::MODE_WEAK_VENDORS === $ mode && $ isVendor = $ inVendors ($ file ));
112
112
113
113
$ i = count ($ trace );
@@ -121,6 +121,11 @@ public static function register($mode = 0)
121
121
$ msg = $ parsedMsg ['deprecation ' ];
122
122
$ class = $ parsedMsg ['class ' ];
123
123
$ method = $ parsedMsg ['method ' ];
124
+ // If the deprecation has been triggered via
125
+ // \Symfony\Bridge\PhpUnit\Legacy\SymfonyTestsListenerTrait::endTest()
126
+ // then we need to use the serialized information to determine
127
+ // if the error has been triggered from vendor code.
128
+ $ isWeak = DeprecationErrorHandler::MODE_WEAK === $ mode || (DeprecationErrorHandler::MODE_WEAK_VENDORS === $ mode && $ isVendor = $ inVendors ($ parsedMsg ['triggering_file ' ]));
124
129
} else {
125
130
$ class = isset ($ trace [$ i ]['object ' ]) ? get_class ($ trace [$ i ]['object ' ]) : $ trace [$ i ]['class ' ];
126
131
$ method = $ trace [$ i ]['function ' ];
@@ -261,7 +266,7 @@ public static function collectDeprecations($outputFile)
261
266
262
267
return $ ErrorHandler ::handleError ($ type , $ msg , $ file , $ line , $ context );
263
268
}
264
- $ deprecations [] = array (error_reporting (), $ msg );
269
+ $ deprecations [] = array (error_reporting (), $ msg, $ file );
265
270
});
266
271
267
272
register_shutdown_function (function () use ($ outputFile , &$ deprecations ) {
0 commit comments