8000 Throw exception for the short factory notation · symfony/symfony@81ead82 · GitHub
[go: up one dir, main page]

Skip to content

Commit 81ead82

Browse files
committed
Throw exception for the short factory notation
1 parent 92efb2e commit 81ead82

File tree

1 file changed

+2
-3
lines changed
  • src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits

1 file changed

+2
-3
lines changed

src/Symfony/Component/DependencyInjection/Loader/Configurator/Traits/FactoryTrait.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Symfony\Component\DependencyInjection\Loader\Configurator\Traits;
1313

14-
use Symfony\Component\DependencyInjection\Reference;
14+
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
1515

1616
trait FactoryTrait
1717
{
@@ -25,8 +25,7 @@ trait FactoryTrait
2525
final public function factory($factory)
2626
{
2727
if (is_string($factory) && 1 === substr_count($factory, ':')) {
28-
$factory = explode(':', $factory);
29-
$factory[0] = new Reference($factory[0]);
28+
throw new InvalidArgumentException('The short factory notation is not supported by the PHP-based DI configuration.');
3029
}
3130

3231
$this->definition->setFactory(static::processValue($factory, true));

0 commit comments

Comments
 (0)
0