@@ -27,7 +27,7 @@ class DebugClassLoaderTest extends TestCase
27
27
protected function setUp (): void
28
28
{
29
29
$ this ->patchTypes = getenv ('SYMFONY_PATCH_TYPE_DECLARATIONS ' );
30
- $ this ->errorReporting = error_reporting (E_ALL );
30
+ $ this ->errorReporting = error_reporting (\ E_ALL );
31
31
putenv ('SYMFONY_PATCH_TYPE_DECLARATIONS=deprecations=1 ' );
32
32
$ this ->loader = [new DebugClassLoader ([new ClassLoader (), 'loadClass ' ]), 'loadClass ' ];
33
33
spl_autoload_register ($ this ->loader , true , true );
@@ -132,7 +132,7 @@ class_exists('Test\\'.__NAMESPACE__.'\\'.$class, true);
132
132
unset($ lastError ['file ' ], $ lastError ['line ' ]);
133
133
134
134
$ xError = [
135
- 'type ' => E_USER_DEPRECATED ,
135
+ 'type ' => \ E_USER_DEPRECATED ,
136
136
'message ' => 'The "Test\Symfony\Component\ErrorHandler\Tests \\' .$ class .'" class ' .$ type .' "Symfony\Component\ErrorHandler\Tests\Fixtures \\' .$ super .'" that is deprecated but this is a test deprecation notice. ' ,
137
137
];
138
138
@@ -151,7 +151,7 @@ public function testInterfaceExtendsDeprecatedInterface()
151
151
{
152
152
set_error_handler (fn () => false );
153
153
$ e = error_reporting (0 );
154
- trigger_error ('' , E_USER_NOTICE );
154
+ trigger_error ('' , \ E_USER_NOTICE );
155
155
156
156
class_exists ('Test \\' .NonDeprecatedInterfaceClass::class, true );
157
157
@@ -162,7 +162,7 @@ class_exists('Test\\'.NonDeprecatedInterfaceClass::class, true);
162
162
unset($ lastError ['file ' ], $ lastError ['line ' ]);
163
163
164
164
$ xError = [
165
- 'type ' => E_USER_NOTICE ,
165
+ 'type ' => \ E_USER_NOTICE ,
166
166
'message ' => '' ,
167
167
];
168
168
@@ -173,7 +173,7 @@ public function testDeprecatedSuperInSameNamespace()
173
173
{
174
174
set_error_handler (fn () => false );
175
175
$ e = error_reporting (0 );
176
- trigger_error ('' , E_USER_NOTICE );
176
+ trigger_error ('' , \ E_USER_NOTICE );
177
177
178
178
class_exists (ExtendsDeprecatedParent::class, true );
179
179
@@ -184,7 +184,7 @@ class_exists(ExtendsDeprecatedParent::class, true);
184
184
unset($ lastError ['file ' ], $ lastError ['line ' ]);
185
185
186
186
$ xError = [
187
- 'type ' => E_USER_NOTICE ,
187
+ 'type ' => \ E_USER_NOTICE ,
188
188
'message ' => '' ,
189
189
];
190
190
@@ -195,7 +195,7 @@ public function testExtendedFinalClass()
195
195
{
196
196
$ deprecations = [];
197
197
set_error_handler (function ($ type , $ msg ) use (&$ deprecations ) { $ deprecations [] = $ msg ; });
198
- $ e = error_reporting (E_USER_DEPRECATED );
198
+ $ e = error_reporting (\ E_USER_DEPRECATED );
199
199
200
200
require __DIR__ .'/Fixtures/FinalClasses.php ' ;
201
201
@@ -224,7 +224,7 @@ public function testExtendedFinalMethod()
224
224
{
225
225
$ deprecations = [];
226
226
set_error_handler (function ($ type , $ msg ) use (&$ deprecations ) { $ deprecations [] = $ msg ; });
227
- $ e = error_reporting (E_USER_DEPRECATED );
227
+ $ e = error_reporting (\ E_USER_DEPRECATED );
228
228
229
229
class_exists (Fixtures \ExtendedFinalMethod::class, true );
230
230
@@ -243,7 +243,7 @@ public function testExtendedDeprecatedMethodDoesntTriggerAnyNotice()
243
243
{
244
244
set_error_handler (fn () => false );
245
245
$ e = error_reporting (0 );
246
- trigger_error ('' , E_USER_NOTICE );
246
+ trigger_error ('' , \ E_USER_NOTICE );
247
247
248
248
class_exists ('Test \\' .ExtendsAnnotatedClass::class, true );
249
249
@@ -253,14 +253,14 @@ class_exists('Test\\'.ExtendsAnnotatedClass::class, true);
253
253
$ lastError = error_get_last ();
254
254
unset($ lastError ['file ' ], $ lastError ['line ' ]);
255
255
256
- $ this ->assertSame (['type ' => E_USER_NOTICE , 'message ' => '' ], $ lastError );
256
+ $ this ->assertSame (['type ' => \ E_USER_NOTICE , 'message ' => '' ], $ lastError );
257
257
}
258
258
259
259
public function testInternalsUse ()
260
260
{
261
261
$ deprecations = [];
262
262
set_error_handler (function ($ type , $ msg ) use (&$ deprecations ) { $ deprecations [] = $ msg ; });
263
- $ e = error_reporting (E_USER_DEPRECATED );
263
+ $ e = error_reporting (\ E_USER_DEPRECATED );
264
264
265
265
class_exists ('Test \\' .ExtendsInternals::class, true );
266
266
@@ -279,7 +279,7 @@ public function testExtendedMethodDefinesNewParameters()
279
279
{
280
280
$ deprecations = [];
281
281
set_error_handler (function ($ type , $ msg ) use (&$ deprecations ) { $ deprecations [] = $ msg ; });
282
- $ e = error_reporting (E_USER_DEPRECATED );
282
+ $ e = error_reporting (\ E_USER_DEPRECATED );
283
283
284
284
class_exists (Fixtures \SubClassWithAnnotatedParameters::class, true );
285
285
@@ -301,7 +301,7 @@ public function testUseTraitWithInternalMethod()
301
301
{
302
302
$ deprecations = [];
303
303
set_error_handler (function ($ type , $ msg ) use (&$ deprecations ) { $ deprecations [] = $ msg ; });
304
- $ e = error_reporting (E_USER_DEPRECATED );
304
+ $ e = error_reporting (\ E_USER_DEPRECATED );
305
305
306
306
class_exists ('Test \\' .UseTraitWithInternalMethod::class, true );
307
307
@@ -315,7 +315,7 @@ public function testVirtualUse()
315
315
{
316
316
$ deprecations = [];
317
317
set_error_handler (function ($ type , $ msg ) use (&$ deprecations ) { $ deprecations [] = $ msg ; });
318
- $ e = error_reporting (E_USER_DEPRECATED );
318
+ $ e = error_reporting (\ E_USER_DEPRECATED );
319
319
320
320
class_exists ('Test \\' .ExtendsVirtual::class, true );
321
321
@@ -345,7 +345,7 @@ public function testVirtualUseWithMagicCall()
345
345
{
346
346
$ deprecations = [];
347
347
set_error_handler (function ($ type , $ msg ) use (&$ deprecations ) { $ deprecations [] = $ msg ; });
348
- $ e = error_reporting (E_USER_DEPRECATED );
348
+ $ e = error_reporting (\ E_USER_DEPRECATED );
349
349
350
350
class_exists ('Test \\' .ExtendsVirtualMagicCall::class, true );
351
351
@@ -364,7 +364,7 @@ public function testReturnType()
364
364
{
365
365
$ deprecations = [];
366
366
set_error_handler (function ($ type , $ msg ) use (&$ deprecations ) { $ deprecations [] = $ msg ; });
367
- $ e = error_reporting (E_USER_DEPRECATED );
367
+ $ e = error_reporting (\ E_USER_DEPRECATED );
368
368
369
369
class_exists ('Test \\' .ReturnType::class, true );
370
370
@@ -409,7 +409,7 @@ public function testReturnTypePhp83()
409
409
{
410
410
$ deprecations = [];
411
411
set_error_handler (function ($ type , $ msg ) use (&$ deprecations ) { $ deprecations [] = $ msg ; });
412
- $ e = error_reporting (E_USER_DEPRECATED );
412
+ $ e = error_reporting (\ E_USER_DEPRECATED );
413
413
414
414
class_exists ('Test \\' .ReturnTypePhp83::class, true );
415
415
@@ -425,7 +425,7 @@ public function testOverrideFinalProperty()
425
425
{
426
426
$ deprecations = [];
427
427
set_error_handler (function ($ type , $ msg ) use (&$ deprecations ) { $ deprecations [] = $ msg ; });
428
- $ e = error_reporting (E_USER_DEPRECATED );
428
+ $ e = error_reporting (\ E_USER_DEPRECATED );
429
429
430
430
class_exists (Fixtures \OverrideFinalProperty::class, true );
431
431
class_exists (Fixtures \FinalProperty \OverrideFinalPropertySameNamespace::class, true );
@@ -446,7 +446,7 @@ public function testOverrideFinalConstant()
446
446
{
447
447
$ deprecations = [];
448
448
set_error_handler (function ($ type , $ msg ) use (&$ deprecations ) { $ deprecations [] = $ msg ; });
449
- $ e = error_reporting (E_USER_DEPRECATED );
449
+ $ e = error_reporting (\ E_USER_DEPRECATED );
450
450
451
451
class_exists (Fixtures \FinalConstant \OverrideFinalConstant::class, true );
452
452
@@ -463,9 +463,9 @@ public function testOverrideFinalConstant81()
463
463
{
464
464
$ deprecations = [];
465
465
set_error_handler (function ($ type , $ msg ) use (&$ deprecations ) { $ deprecations [] = $ msg ; });
466
- $ e = error_reporting (E_USER_DEPRECATED );
466
+ $ e = error_reporting (\ E_USER_DEPRECATED );
467
467
468
- class_exists ( Fixtures \FinalConstant \OverrideFinalConstant81::class, true );
468
+ class_exists (Fixtures \FinalConstant \OverrideFinalConstant81::class, true );
469
469
470
470
error_reporting ($ e );
471
471
restore_error_handler ();
@@ -514,7 +514,7 @@ public function findFile($class)
514
514
eval ('namespace Test \\' .__NAMESPACE__ .'; class NonDeprecatedInterfaceClass implements \\' .__NAMESPACE__ .'\Fixtures\NonDeprecatedInterface {} ' );
515
515
} elseif ('Test \\' .Float::class === $ class ) {
516
516
eval ('namespace Test \\' .__NAMESPACE__ .'; class Float {} ' );
517
- } elseif (str_starts_with ($ class , 'Test \\' . ExtendsFinalClass::class)) {
517
+ } elseif (str_starts_with ($ class , 'Test \\' . ExtendsFinalClass::class)) {
518
518
$ classShortName = substr ($ class , strrpos ($ class , '\\' ) + 1 );
519
519
eval ('namespace Test \\' .__NAMESPACE__ .'; class ' .$ classShortName .' extends \\' .__NAMESPACE__ .'\Fixtures \\' .substr ($ classShortName , 7 ).' {} ' );
520
520
} elseif ('Test \\' .ExtendsAnnotatedClass::class === $ class ) {
0 commit comments