You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: UPGRADE-4.0.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,10 @@ Debug
77
77
DependencyInjection
78
78
-------------------
79
79
80
+
* Autowiring service auto-registration is not supported anymore.
81
+
Explicitely inject your dependencies or create services whose ids are
82
+
their fully-qualified class name.
83
+
80
84
* Autowiring services based on the types they implement is not supported anymore. Rename (or alias) your services to their FQCN id to make them autowirable.
81
85
82
86
*`_defaults` and `_instanceof` are now reserved service names in Yaml configurations. Please rename any services with that names.
@@ -338,9 +342,9 @@ FrameworkBundle
338
342
class instead.
339
343
340
344
* Using the `KERNEL_DIR` environment variable and the automatic guessing based
341
-
on the `phpunit.xml` file location have been removed from the `KernelTestCase::getKernelClass()`
345
+
on the `phpunit.xml` file location have been removed from the `KernelTestCase::getKernelClass()`
342
346
method implementation. Set the `KERNEL_CLASS` environment variable to the
343
-
fully-qualified class name of your Kernel or override the `KernelTestCase::createKernel()`
347
+
fully-qualified class name of your Kernel or override the `KernelTestCase::createKernel()`
344
348
or `KernelTestCase::getKernelClass()` method instead.
345
349
346
350
* The `Symfony\Bundle\FrameworkBundle\Validator\ConstraintValidatorFactory` class has been removed.
@@ -349,10 +353,10 @@ FrameworkBundle
349
353
* The `--no-prefix` option of the `translation:update` command has
350
354
been removed.
351
355
352
-
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheClearerPass` class has been removed.
356
+
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheClearerPass` class has been removed.
353
357
Use the `Symfony\Component\HttpKernel\DependencyInjection\AddCacheClearerPass` class instead.
354
358
355
-
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheWarmerPass` class has been removed.
359
+
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\AddCacheWarmerPass` class has been removed.
356
360
Use the `Symfony\Component\HttpKernel\DependencyInjection\AddCacheWarmerPass` class instead.
357
361
358
362
* The `Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\TranslationDumperPass`
@@ -554,7 +558,7 @@ TwigBridge
554
558
* The `TwigRendererEngine::setEnvironment()` method has been removed.
555
559
Pass the Twig Environment as second argument of the constructor instead.
556
560
557
-
* Removed `Symfony\Bridge\Twig\Command\DebugCommand::set/getTwigEnvironment` and the ability
561
+
* Removed `Symfony\Bridge\Twig\Command\DebugCommand::set/getTwigEnvironment` and the ability
558
562
to pass a command name as first argument.
559
563
560
564
* Removed `Symfony\Bridge\Twig\Command\LintCommand::set/getTwigEnvironment` and the ability
Copy file name to clipboardExpand all lines: src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -477,6 +477,8 @@ private function createAutowiredDefinition($type)
477
477
$this->currentId = $currentId;
478
478
}
479
479
480
+
@trigger_error(sprintf('Using autowiring service auto-registration for type "%s" is deprecated since version 3.4 and won\'t be supported in 4.0. Create a service named "%s" instead.', $type, $type), E_USER_DEPRECATED);
481
+
480
482
$this->container->log($this, sprintf('Type "%s" has been auto-registered for service "%s".', $type, $this->currentId));
* @expectedDeprecation Using autowiring service auto-registration for type "Symfony\Component\DependencyInjection\Tests\Compiler\Lille" is deprecated since version 3.4 and won't be supported in 4.0. Create a service named "Symfony\Component\DependencyInjection\Tests\Compiler\Lille" instead.
293
+
* @expectedDeprecation Using autowiring service auto-registration for type "Symfony\Component\DependencyInjection\Tests\Compiler\Dunglas" is deprecated since version 3.4 and won't be supported in 4.0. Create a service named "Symfony\Component\DependencyInjection\Tests\Compiler\Dunglas" instead.
294
+
*/
290
295
publicfunctiontestCreateDefinition()
291
296
{
292
297
$container = newContainerBuilder();
@@ -368,6 +373,8 @@ public function testClassNotFoundThrowsException()
@@ -595,6 +604,10 @@ public function testExplicitMethodInjection()
595
604
);
596
605
}
597
606
607
+
/**
608
+
* @group legacy
609
+
* @expectedDeprecation Using autowiring service auto-registration for type "Symfony\Component\DependencyInjection\Tests\Compiler\A" is deprecated since version 3.4 and won't be supported in 4.0. Create a service named "Symfony\Component\DependencyInjection\Tests\Compiler\A" instead.
610
+
*/
598
611
publicfunctiontestTypedReference()
599
612
{
600
613
$container = newContainerBuilder();
@@ -653,6 +666,8 @@ public function testIgnoreServiceWithClassNotExisting()
@@ -87,23 +87,23 @@ protected function getSymfony_Component_DependencyInjection_Tests_Fixtures_TestS
87
87
protectedfunctiongetFooServiceService()
88
88
{
89
89
return$this->services['foo_service'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber(new \Symfony\Component\DependencyInjection\ServiceLocator(array('Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\CustomDefinition' => function () {
return$this->services['autowired.Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition();
107
+
return$this->services['Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition();
0 commit comments