Skip to content

Commit 4b18dd1

Browse files
[ErrorHandler] trigger deprecations for @final properties
1 parent dddea31 commit 4b18dd1

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

Tests/ContainerTest.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -413,16 +413,6 @@ class ProjectServiceContainer extends Container
413413
public $__foo_bar;
414414
public $__foo_baz;
415415
public $__internal;
416-
protected $privates;
417-
protected $methodMap = [
418-
'bar' => 'getBarService',
419-
'foo_bar' => 'getFooBarService',
420-
'foo.baz' => 'getFoo_BazService',
421-
'circular' => 'getCircularService',
422-
'throw_exception' => 'getThrowExceptionService',
423-
'throws_exception_on_service_configuration' => 'getThrowsExceptionOnServiceConfigurationService',
424-
'internal_dependency' => 'getInternalDependencyService',
425-
];
426416

427417
public function __construct()
428418
{
@@ -434,6 +424,15 @@ public function __construct()
434424
$this->__internal = new \stdClass();
435425
$this->privates = [];
436426
$this->aliases = ['alias' => 'bar'];
427+
$this->methodMap = [
428+
'bar' => 'getBarService',
429+
'foo_bar' => 'getFooBarService',
430+
'foo.baz' => 'getFoo_BazService',
431+
'circular' => 'getCircularService',
432+
'throw_exception' => 'getThrowExceptionService',
433+
'throws_exception_on_service_configuration' => 'getThrowsExceptionOnServiceConfigurationService',
434+
'internal_dependency' => 'getInternalDependencyService',
435+
];
437436
}
438437

439438
protected function getInternalService()

Tests/Loader/FileLoaderTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function testRegisterClasses()
8989
$container = new ContainerBuilder();
9090
$container->setParameter('sub_dir', 'Sub');
9191
$loader = new TestFileLoader($container, new FileLocator(self::$fixturesPath.'/Fixtures'));
92-
$loader->autoRegisterAliasesForSinglyImplementedInterfaces = false;
92+
$loader->noAutoRegisterAliasesForSinglyImplementedInterfaces();
9393

9494
$loader->registerClasses(new Definition(), 'Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\\', 'Prototype/%sub_dir%/*');
9595
$loader->registerClasses(new Definition(), 'Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Sub\\', 'Prototype/%sub_dir%/*'); // loading twice should not be an issue
@@ -270,7 +270,10 @@ public function testRegisterClassesWithWhenEnv(?string $env, bool $expected)
270270

271271
class TestFileLoader extends FileLoader
272272
{
273-
public $autoRegisterAliasesForSinglyImplementedInterfaces = true;
273+
public function noAutoRegisterAliasesForSinglyImplementedInterfaces()
274+
{
275+
$this->autoRegisterAliasesForSinglyImplementedInterfaces = false;
276+
}
274277

275278
public function load(mixed $resource, string $type = null): mixed
276279
{

0 commit comments

Comments
 (0)