prefix
stringlengths
512
512
suffix
stringlengths
256
256
middle
stringlengths
14
229
meta
dict
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Attribute; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Attribute\AutowireCallable; use Symfony\Comp...
lable(callable: 'my_callable', service: 'my_service', method: 'my_method'); } public function testMethodOnly() { $this->expectException(LogicException::class); new AutowireCallable(method: 'my_method'); } public funct
{ $this->expectException(LogicException::class); new AutowireCallable(); } public function testCallableAndService() { $this->expectException(LogicException::class); new AutowireCal
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Attribute/AutowireCallableTest.php", "language": "php", "file_size": 3983, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Attribute; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Attribute\AutowireInline; use Symfony\Component\DependencyInjection\Reference; class AutowireInlin...
'someClass', $autowireInline->value['class']); self::assertSame($calls, $autowireInline->value['calls']); } public static function provideInvalidCalls(): iterable { yield 'missing method' => [[[]]]; yield 'invalid metho
lue['factory']); } #[DataProvider('provideInvalidCalls')] public function testInvalidCallsArray(array $calls) { $autowireInline = new AutowireInline('someClass', calls: $calls); self::assertSame(
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Attribute/AutowireInlineTest.php", "language": "php", "file_size": 7623, "cut_index": 716, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Fixtures; use Psr\Container\ContainerIn...
key')] private ContainerInterface $locator, ) { } public function getLocator(): ContainerInterface { return $this->locator; } public function getContainer(): ?ContainerInterface { return $this->containe
class TaggedLocatorConsumerWithServiceSubscriber implements ServiceSubscriberInterface { private ?ContainerInterface $container = null; public function __construct( #[AutowireLocator('foo_bar', indexAttribute: '
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/TaggedLocatorConsumerWithServiceSubscriber.php", "language": "php", "file_size": 1291, "cut_index": 524, "middle_length": 229 }
/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Argument; /** * Represents a closure a...
teratorArgument = $values; $values = []; } $this->setValues($values); } public function getTaggedIteratorArgument(): ?TaggedIteratorArgument { return $this->taggedIteratorArgument; } public functio
private ?TaggedIteratorArgument $taggedIteratorArgument = null; public function __construct(array|TaggedIteratorArgument $values = []) { if ($values instanceof TaggedIteratorArgument) { $this->taggedI
{ "filepath": "src/Symfony/Component/DependencyInjection/Argument/ServiceLocatorArgument.php", "language": "php", "file_size": 1165, "cut_index": 518, "middle_length": 229 }
) takes the class name as its first argument'); $this->assertSame(['class' => true], $def->getChanges()); $def = new Definition('stdClass', ['foo']); $this->assertEquals(['foo'], $def->getArguments(), '__construct() takes an optional array of arguments as its second argument'); } publi...
all to the array'); $def->setFactory($ref = new Reference('baz')); $this->assertSame([$ref, '__invoke'], $def->getFactory(), '->setFactory() converts service reference to class invoke call'); $def->setFactory($innerDef = new Defin
assertEquals('foo', $def->getFactory(), '->getFactory() returns the factory'); $def->setFactory('Foo::bar'); $this->assertEquals(['Foo', 'bar'], $def->getFactory(), '->setFactory() converts string static method c
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/DefinitionTest.php", "language": "php", "file_size": 19092, "cut_index": 1331, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Extension; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjecti...
iValidConfigExtension; use Symfony\Component\DependencyInjection\Tests\Fixtures\Extension\ValidConfig\Configuration; use Symfony\Component\DependencyInjection\Tests\Fixtures\Extension\ValidConfig\ValidConfigExtension; class ExtensionTest extends TestCase
endencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Tests\Fixtures\Extension\InvalidConfig\InvalidConfigExtension; use Symfony\Component\DependencyInjection\Tests\Fixtures\Extension\SemiValidConfig\Sem
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Extension/ExtensionTest.php", "language": "php", "file_size": 3276, "cut_index": 614, "middle_length": 229 }
is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Fixtures; use Psr\Container\ContainerInterface; us...
t( #[AutowireIterator(AutoconfiguredInterface2::class, exclude: self::class)] public iterable $items, #[AutowireLocator(AutoconfiguredInterface2::class, exclude: self::class)] public ContainerInterface $locator, ) {
onfiguredInterface2 { public function __construc
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/TaggedConsumerWithExclude.php", "language": "php", "file_size": 847, "cut_index": 535, "middle_length": 52 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\Argument\ArgumentInterface; use Symfony\Component\DependencyInjection\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Depend...
h information. You can * retrieve the graph in other passes from the compiler. * * @author Johannes M. Schmitt <schmittjoh@gmail.com> * @author Nicolas Grekas <p@tchwork.com> */ class AnalyzeServiceReferencesPass extends AbstractRecursivePass { pr
ction\Reference; use Symfony\Component\ExpressionLanguage\Expression; /** * Run this pass before passes that need to know more about the relation of * your services. * * This class will populate the ServiceReferenceGraph wit
{ "filepath": "src/Symfony/Component/DependencyInjection/Compiler/AnalyzeServiceReferencesPass.php", "language": "php", "file_size": 7251, "cut_index": 716, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ServicesResetter; use Symfony\Component\DependencyInje...
ResettableService::$counter = 0; ClearableService::$counter = 0; MultiResettableService::$resetFirstCounter = 0; MultiResettableService::$resetSecondCounter = 0; } public function testResetServices() { $resetter
ervice; use Symfony\Component\DependencyInjection\Tests\Fixtures\ResettableService; use Symfony\Component\VarExporter\ProxyHelper; class ServicesResetterTest extends TestCase { protected function setUp(): void {
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/ServicesResetterTest.php", "language": "php", "file_size": 4335, "cut_index": 614, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase...
$alias = new Alias('foo', false); $this->assertEquals('foo', (string) $alias); $this->assertFalse($alias->isPublic()); } public function testCanConstructAPrivateAlias() { $alias = new Alias('foo', false, false);
structor() { $alias = new Alias('foo'); $this->assertEquals('foo', (string) $alias); $this->assertFalse($alias->isPublic()); } public function testCanConstructANonPublicAlias() {
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/AliasTest.php", "language": "php", "file_size": 2778, "cut_index": 563, "middle_length": 229 }
n Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Attribute; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Attribute\Au...
e('foo')], $a->value); } public function testBuildDefinition(?\Closure $dummy = null) { $a = new AutowireMethodOf('foo'); $r = new \ReflectionParameter([__CLASS__, __FUNCTION__], 0); $this->assertEquals([[new Reference
f('foo'); $this->assertEquals([new Referenc
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Attribute/AutowireMethodOfTest.php", "language": "php", "file_size": 982, "cut_index": 582, "middle_length": 52 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
protected $parameters = []; public function __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'foo' => 'getFooService', ]; $this->aliases = []; } public function comp
ted by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { private const NONEMPTY_PARAMETERS = [ 'bar' => 'Did you forget to configure the "foo.bar" option?', ];
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_nonempty_parameters.php", "language": "php", "file_size": 3558, "cut_index": 614, "middle_length": 229 }
gument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\Depende...
onstruct() { $this->services = $this->privates = []; $this->methodMap = [ 'wither' => 'getWitherService', ]; $this->aliases = []; } public function compile(): void { throw new LogicExcep
; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Service_Wither_Lazy extends Container { protected $parameters = []; public function __c
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_wither_lazy.php", "language": "php", "file_size": 2384, "cut_index": 563, "middle_length": 229 }
gument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\Depende...
unction __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'wither' => 'getWitherService', ]; $this->aliases = []; } public function compile(): void { throw new
; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Service_Wither_Lazy_Non_Shared extends Container { protected $parameters = []; public f
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_wither_lazy_non_shared.php", "language": "php", "file_size": 2445, "cut_index": 563, "middle_length": 229 }
ent\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use...
meters = []; public function __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'wither' => 'getWitherService', ]; $this->aliases = []; } public function compile(): vo
rBag\ParameterBagInterface; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Service_WitherStaticReturnType extends Container { protected $para
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_wither_staticreturntype.php", "language": "php", "file_size": 1947, "cut_index": 537, "middle_length": 229 }
ent\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use...
ction __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'static_constructor' => 'getStaticConstructorService', ]; $this->aliases = []; } public function compile(): void
rBag\ParameterBagInterface; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public fun
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/static_constructor.php", "language": "php", "file_size": 1578, "cut_index": 537, "middle_length": 229 }
?php use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; class ProjectExtension implements ExtensionInterface { public function load(array $configs, ContainerBuilder $configuration): void { $configuration->setParameter('pr...
ice.foo', 'FooClass')->setPublic(true); $configuration->setParameter('project.parameter.foo', $config['foo'] ?? 'foobar'); } public function getAlias(): string { return 'project'; } public function getConfiguration(arr
} $configuration->register('project.service.bar', 'FooClass')->setPublic(true); $configuration->setParameter('project.parameter.bar', $config['foo'] ?? 'foobar'); $configuration->register('project.serv
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/ProjectExtension.php", "language": "php", "file_size": 1053, "cut_index": 513, "middle_length": 229 }
_classes.php'; require __DIR__.'/autowiring_classes_80.php'; require __DIR__.'/intersectiontype_classes.php'; require __DIR__.'/compositetype_classes.php'; class Foo { public static int $counter = 0; public int $foo = 0; #[Required] public function cloneFoo(?\stdClass $bar = null): static { ...
public function __construct(A $a) { } } interface DInterface { } interface EInterface extends DInterface { } interface IInterface { } class I implements IInterface { } class F extends I implements EInterface { } class G { public functi
} } class Bar { public function __construct(Foo $foo) { } } interface AInterface { } class A implements AInterface { public static function create(Foo $foo) { } } class B extends A { } class C {
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes.php", "language": "php", "file_size": 11436, "cut_index": 921, "middle_length": 229 }
use Symfony\Component\DependencyInjection\Attribute\Autowire; use Symfony\Component\DependencyInjection\Attribute\AutowireDecorated; use Symfony\Component\DependencyInjection\Attribute\AutowireInline; use Symfony\Component\DependencyInjection\Attribute\AutowireIterator; use Symfony\Component\DependencyInjection\Attrib...
foo): static { return $this; } } class AutowireProperty { #[Required] public Foo $foo; } class AutowirePropertyWithTarget { #[Required] #[Target('foo.target')] public Foo $foo; } class AutowireReadonlyProperty { #
terface; use Symfony\Contracts\Service\Attribute\Required; class AutowireSetter { #[Required] public function setFoo(Foo $foo): void { } } class AutowireWither { #[Required] public function withFoo(Foo $
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/autowiring_classes_80.php", "language": "php", "file_size": 6445, "cut_index": 716, "middle_length": 229 }
\LazyProxy\PhpDumper\DumperInterface; function sc_configure($instance) { $instance->configure(); } class BarClass extends BazClass { protected $baz; public $foo = 'foo'; public function setBaz(BazClass $baz) { $this->baz = $baz; } public function getBaz() { return $th...
tion configureStatic1() { } } class BazInvokableFactory { public function __invoke(): BazClass { return new BazClass(); } } class BazInvokableConfigurator { public function __invoke($instance): void { $instance
tance->configure(); } public static function getInstance() { return new self(); } public static function configureStatic($instance) { $instance->configure(); } public static func
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/classes.php", "language": "php", "file_size": 3351, "cut_index": 614, "middle_length": 229 }
php namespace App; class BarService { } class Db { public Schema $schema; } class Bus { public Handler1 $handler1; public Handler2 $handler2; public function __construct(public Db $db) { } } class Handler1 { public function __construct( public Db $db, public Schema $sch...
{ } } class Processor { public function __construct( public Registry $registry, public Db $db, ) { } } class Registry { public array $processor; } class Schema { public function __construct(public Db $db) {
cessor, )
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/fixture_app_services.php", "language": "php", "file_size": 790, "cut_index": 514, "middle_length": 14 }
public $otherInstances; public $bar = null; public $initialized = false; public $configured = false; public $called = false; public $arguments = []; public function __construct($arguments = []) { $this->arguments = $arguments; } public static function getInstance($argumen...
configured = true; } public function setBar($value = null) { $this->bar = $value; } public function setOtherInstances($otherInstances) { $this->otherInstances = $otherInstances; } } namespace Acme; class Foo
public function configure() { $this->
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/includes/foo.php", "language": "php", "file_size": 946, "cut_index": 606, "middle_length": 52 }
DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass; class BarMethodCall { public $foo; public function setBar(Bar $bar) { } public function setFoo(\stdClass $foo) { $this->foo = $foo; } public function setFoosVariadic(Foo $foo, Foo ...$foos) { $this->foo...
ay(array $array) { } public function setIterable(iterable $iterable) { } public function setCallable(callable $callable): void { } public function setClosure(\Closure $closure): void { } public function s
ool = false) { } public function setArr
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/CheckTypeDeclarationsPass/BarMethodCall.php", "language": "php", "file_size": 894, "cut_index": 547, "middle_length": 52 }
use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; require_once __DIR__.'/../includes/classes.php'; $container = new ContainerBuilder(); $container->setParameter('env(FOO)', 'Bar\FaooClass'); $container->setParameter('foo', '%env(FOO)%'); $container ...
onymousServiceWithFactory->setFactory('Bar\FooClass::getInstance'); $container ->register('service_with_method_call_and_factory', 'Bar\FooClass') ->addMethodCall('setBar', [$anonymousServiceWithFactory]) ->setPublic(true) ; return $container;
ooClass'); $an
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container19.php", "language": "php", "file_size": 788, "cut_index": 518, "middle_length": 14 }
<?php use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; $container = new ContainerBuilder(new ParameterBag([ 'foo' => '%baz%', 'baz' => 'bar', 'bar' => 'foo is %%foo bar', 'escape' => '@escapeme', 'values' => [true, fal...
string' => 'false', 'binary number string' => '0b0110', 'numeric string' => '-1.2E2', 'hexadecimal number string' => '0xFF', 'float string' => '10100.1', 'positive float string' => '+10100.1', 'negative float string' => '-10100.1',
, 'console banner' => "\e[37;44mHello\e[30;43mWorld\e[0m", 'null string' => 'null', 'string of digits' => '123', 'string of digits prefixed with minus character' => '-123', 'true string' => 'true', 'false
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container8.php", "language": "php", "file_size": 1022, "cut_index": 512, "middle_length": 229 }
ponent\DependencyInjection\Argument\TaggedIteratorArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Parameter; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\Expression...
foo%' => 'foo is %foo%', 'foobar' => '%foo%'], true, new Reference('service_container')]) ->setProperties(['foo' => 'bar', 'moo' => new Reference('foo.baz'), 'qux' => ['%foo%' => 'foo is %foo%', 'foobar' => '%foo%']]) ->addMethodCall('setBar', [new
'baz']) ->addTag('nullable', ['bar' => 'bar', 'baz' => null]) ->addTag('foo', ['name' => 'bar', 'baz' => 'baz']) ->setFactory(['Bar\\FooClass', 'getInstance']) ->setArguments(['foo', new Reference('foo.baz'), ['%
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container9.php", "language": "php", "file_size": 7174, "cut_index": 716, "middle_length": 229 }
ilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Tests\Fixtures\FooForCircularWithAddCalls; $public = 'public' === $visibility; $container = new ContainerBuilder(); // factory with lazy injection $container->re...
lic) ->addArgument(new IteratorArgument([new Reference('doctrine.listener')])); $container->register('doctrine.listener', 'stdClass')->setPublic($public) ->addArgument(new Reference('doctrine.entity_manager')); // multiple path detection $contain
manager', 'stdClass')->setPublic(true) ->setFactory([FactoryChecker::class, 'create']) ->addArgument(new Reference('doctrine.config')); $container->register('doctrine.entity_listener_resolver', 'stdClass')->setPublic($pub
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container_almost_circular.php", "language": "php", "file_size": 8822, "cut_index": 716, "middle_length": 229 }
?php use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; $container = new ContainerBuilder(); $container ->register('foo1', 'stdClass') ->setPublic(true) ; $container -...
'foo2' => new Reference('foo2'), 'foo3' => new Reference('foo3'), 'foo4' => new Reference('foo4', $container::RUNTIME_EXCEPTION_ON_INVALID_REFERENCE), 'foo5' => new Reference('foo5', $container::IGNORE_ON_UNINITIALIZED_REFERENCE
->register('foo5', 'stdClass') ->setPublic(true) ->setSynthetic(true) ; $container ->register('bar', 'stdClass') ->setProperty('locator', new ServiceLocatorArgument([ 'foo1' => new Reference('foo1'),
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container_service_locator_argument.php", "language": "php", "file_size": 1053, "cut_index": 513, "middle_length": 229 }
ent\DependencyInjection\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; $container = new ContainerBuilder(); $container ->register('foo1', 'stdClas...
rence('foo2', $container::IGNORE_ON_UNINITIALIZED_REFERENCE)) ->setProperty('foo3', new Reference('foo3', $container::IGNORE_ON_UNINITIALIZED_REFERENCE)) ->setProperty('closures', [ new ServiceClosureArgument(new Reference('foo1', $containe
oo3', new Reference('foo3')) ->setPublic(true) ; $container ->register('bar', 'stdClass') ->setProperty('foo1', new Reference('foo1', $container::IGNORE_ON_UNINITIALIZED_REFERENCE)) ->setProperty('foo2', new Refe
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container_uninitialized_ref.php", "language": "php", "file_size": 1646, "cut_index": 537, "middle_length": 229 }
php namespace Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Component\DependencyInjection\Tests\Fixtures\Bar; use Symfony\Component\DependencyInjection\Tests\Fixtures\BarFactory; return App::config([ 'services' => [ '_defaults' => [ 'public' => true, ], ...
lass' => Bar::class, 'factory' => [service(BarFactory::class), 'getDefaultBar'], ], 'invokable_configurator' => [ 'class' => Bar::class, 'configurator' => service(BarFactory::class), ], ], ]);
], 'array_factory' => [ 'c
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/config/array_config_factory.php", "language": "php", "file_size": 823, "cut_index": 514, "middle_length": 52 }
namespace Testing\NamedClosure; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use function Symfony\Component\DependencyInjection\Loader\Configurator\closure; interface NamedClosureInterface { public function theMethod(); } class NamedClosureClass { public function __c...
as_factory', NamedClosureClass::class) ->factory(NamedClosureClass::getInstance(...)) ->public() ->set('has_configurator', NamedClosureClass::class) ->configurator(NamedClosureClass::configure(...)) -
return function (ContainerConfigurator $c) { $c->services() ->set('from_callable', NamedClosureInterface::class) ->fromCallable(NamedClosureClass::getInstance(...)) ->public() ->set('h
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/config/named_closure.php", "language": "php", "file_size": 1145, "cut_index": 518, "middle_length": 229 }
space Symfony\Component\DependencyInjection\Loader\Configurator; use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype; return function (ContainerConfigurator $c) { $di = $c->services()->defaults() ->tag('baz'); $di->load(Prototype::class.'\\', '../Prototype') ->public() -...
or/package', '1.1', '%service_id%') ->args([0]) ->args([1]) ->autoconfigure(false) ->tag('foo') ->parent('foo'); $di->set('foo')->lazy()->abstract()->public(); $di->get(Prototype\Foo::class)->lazy(false); };
']) ->factory('f') ->deprecate('vend
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/config/prototype_array.php", "language": "php", "file_size": 831, "cut_index": 523, "middle_length": 52 }
eter; use Symfony\Component\DependencyInjection\Reference; require_once __DIR__.'/../includes/classes.php'; require_once __DIR__.'/../includes/foo.php'; return function (ContainerConfigurator $c) { $p = $c->parameters(); $p->set('baz_class', 'BazClass'); $p->set('foo_class', FooClass::class) ->set('...
:getInstance(...)) ->property('foo', 'bar') ->property('moo', service('foo.baz')) ->property('qux', ['%foo%' => 'foo is %foo%', 'foobar' => '%foo%']) ->call('setBar', [service('bar')]) ->call('initialize') ->
vice_container')]) ->class(FooClass::class) ->tag('foo', ['foo' => 'foo']) ->tag('foo', ['bar' => 'bar', 'baz' => 'baz']) ->tag('foo', ['name' => 'bar', 'baz' => 'baz']) ->factory(FooClass:
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/config/services9.php", "language": "php", "file_size": 5568, "cut_index": 716, "middle_length": 229 }
namespace Symfony\Component\DependencyInjection\Loader\Configurator; return function (ContainerConfigurator $configurator) { $services = $configurator->services()->defaults()->public(); $services->set('foo_service', \stdClass::class); $services->set('bar_service', \stdClass::class); $services->set(...
cator_dependent_service_mixed', \ArrayObject::class) ->args([service_locator([ 'foo' => service('foo_service'), service('bar_service'), ])]); $services->set('locator_dependent_inline_service', \ArrayObject::clas
]); $services->set('locator_dependent_service_not_indexed', \ArrayObject::class) ->args([service_locator([ service('foo_service'), service('bar_service'), ])]); $services->set('lo
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/config/services_with_service_locator_argument.php", "language": "php", "file_size": 1167, "cut_index": 518, "middle_length": 229 }
pace Symfony\Component\DependencyInjection\Loader\Configurator; return function (ContainerConfigurator $c) { $services = $c->services(); $services->stack('stack_a', [ inline_service('stdClass') ->property('label', 'A') ->property('inner', service('.inner')), inline_serv...
label', 'B') ->property('inner', service('.inner')), ]); $services->stack('stack_b', [ service('stack_abstract'), inline_service('stdClass') ->property('label', 'C'), ])->public(); $services->stack(
(); $services->stack('stack_abstract', [ inline_service('stdClass') ->property('label', 'A') ->property('inner', service('.inner')), inline_service('stdClass') ->property('
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/config/stack.php", "language": "php", "file_size": 1423, "cut_index": 524, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Kernel; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Depende...
tSame('FooBarBundle', $bundle->getName()); } public function testGetNameExplicit() { $bundle = new ExplicitlyNamedBundle(); $this->assertSame('CustomName', $bundle->getName()); } public function testGetPath() {
ent\DependencyInjection\Loader\Configurator\ContainerConfigurator; class AbstractBundleTest extends TestCase { public function testGetNameIsGuessedFromClass() { $bundle = new FooBarBundle(); $this->asser
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Kernel/AbstractBundleTest.php", "language": "php", "file_size": 3460, "cut_index": 614, "middle_length": 229 }
/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Kernel; use PHPUnit\Framework\Tes...
->willReturn('/bundle-name/some/path'); $locator = new FileLocator($kernel); $this->assertEquals('/bundle-name/some/path', $locator->locate('@BundleName/some/path')); $kernel ->expects($this->never())
tion testLocate() { $kernel = $this->createMock(KernelInterface::class); $kernel ->expects($this->atLeastOnce()) ->method('locateResource') ->with('@BundleName/some/path')
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Kernel/FileLocatorTest.php", "language": "php", "file_size": 1140, "cut_index": 518, "middle_length": 229 }
This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Loader; use PHPUnit\Framework\TestCase;...
->assertFalse($loader->supports('foo.foo'), '->supports() returns true if the resource is loadable'); } public function testLoad() { $loader = new ClosureLoader($container = new ContainerBuilder(), 'some-env'); $loader->load(s
tSupports() { $loader = new ClosureLoader(new ContainerBuilder()); $this->assertTrue($loader->supports(static function ($container) {}), '->supports() returns true if the resource is loadable'); $this
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Loader/ClosureLoaderTest.php", "language": "php", "file_size": 1273, "cut_index": 524, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Loader; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\FileLocator; use Symfony\Component\Config\Loader\LoaderResol...
te ContainerBuilder $container; private DirectoryLoader $loader; public static function setUpBeforeClass(): void { self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'); } protected function setUp(): void { $loca
r; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; class DirectoryLoaderTest extends TestCase { private static string $fixturesPath; priva
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Loader/DirectoryLoaderTest.php", "language": "php", "file_size": 3131, "cut_index": 614, "middle_length": 229 }
e Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Loader\FileLoader; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototy...
rSub; use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\OtherDir\AnotherSub\DeeperBaz; use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\OtherDir\Baz; use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\Stat
ny\Component\DependencyInjection\Tests\Fixtures\Prototype\FooInterface; use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\NotFoo; use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype\OtherDir\Anothe
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Loader/FileLoaderTest.php", "language": "php", "file_size": 23977, "cut_index": 1331, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Loader; use PHPUnit\Framework\TestCase; use Symfony\...
ny-path', 'glob'), '->supports() returns true if the resource has the glob type'); $this->assertFalse($loader->supports('any-path'), '->supports() returns false if the resource is not of glob type'); } public function testLoadAddsTheGlobRe
lobFileLoader; class GlobFileLoaderTest extends TestCase { public function testSupports() { $loader = new GlobFileLoader(new ContainerBuilder(), new FileLocator()); $this->assertTrue($loader->supports('a
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Loader/GlobFileLoaderTest.php", "language": "php", "file_size": 1597, "cut_index": 537, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Loader; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\...
ures/').'/ini')); } public function testIniFileCanBeLoaded() { $this->loader->load('parameters.ini'); $this->assertEquals(['foo' => 'bar', 'bar' => '%foo%'], $this->container->getParameterBag()->all(), '->load() takes a single
rotected IniFileLoader $loader; protected function setUp(): void { $this->container = new ContainerBuilder(); $this->loader = new IniFileLoader($this->container, new FileLocator(realpath(__DIR__.'/../Fixt
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Loader/IniFileLoaderTest.php", "language": "php", "file_size": 5564, "cut_index": 716, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Loader; use PHPUnit\Framework\Attributes\DataProvide...
n\Loader\YamlFileLoader; class LoaderResolverTest extends TestCase { private static string $fixturesPath; private LoaderResolver $resolver; protected function setUp(): void { self::$fixturesPath = realpath(__DIR__.'/../Fixtures/'
Symfony\Component\DependencyInjection\Loader\ClosureLoader; use Symfony\Component\DependencyInjection\Loader\IniFileLoader; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use Symfony\Component\DependencyInjectio
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Loader/LoaderResolverTest.php", "language": "php", "file_size": 1979, "cut_index": 537, "middle_length": 229 }
fixture_app_services.php'; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInje...
ymfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Tests\Fixtures\FooClassWithEnumAttribute; use Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum; class PhpFileLoaderTest extends TestCase { public
nvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Loader\Configurator\App; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use S
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Loader/PhpFileLoaderTest.php", "language": "php", "file_size": 16139, "cut_index": 921, "middle_length": 229 }
mponent\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Loader\IniFileLoader; use Symfony\Component\DependencyInjection\Loader\PhpFi...
use Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum; use Symfony\Component\DependencyInjection\Tests\Fixtures\NamedArgumentsDummy; use Symfony\Component\DependencyInjection\Tests\Fixtures\Prototype; use Symfony\Component\ExpressionLanguag
e Symfony\Component\DependencyInjection\Tests\Fixtures\BarInterface; use Symfony\Component\DependencyInjection\Tests\Fixtures\CaseSensitiveClass; use Symfony\Component\DependencyInjection\Tests\Fixtures\FooClassWithEnumAttribute;
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Loader/YamlFileLoaderTest.php", "language": "php", "file_size": 66413, "cut_index": 2151, "middle_length": 229 }
ent\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use...
ction __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'public_foo' => 'getPublicFooService', ]; $this->aliases = []; } public function compile(): void { thro
rBag\ParameterBagInterface; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public fun
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_in_expression.php", "language": "php", "file_size": 1613, "cut_index": 537, "middle_length": 229 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
{ $this->parameters = $this->getDefaultParameters(); $this->services = $this->privates = []; $this->methodMap = [ 'Symfony\\Component\\DependencyInjection\\Tests\\Dumper\\Rot13EnvVarProcessor' => 'getRot13EnvVarProcess
ted by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Test_Rot13Parameters extends Container { protected $parameters = []; protected \Closure $getService; public function __construct()
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_rot13_env.php", "language": "php", "file_size": 4660, "cut_index": 614, "middle_length": 229 }
gument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\Depende...
$this->services = $this->privates = []; $this->methodMap = [ 'tsantos_serializer' => 'getTsantosSerializerService', ]; $this->aliases = [ 'TSantos\\Serializer\\SerializerInterface' => 'tsantos_seriali
; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public function __construct() {
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_tsantos.php", "language": "php", "file_size": 2387, "cut_index": 563, "middle_length": 229 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
= $this->getDefaultParameters(); $this->services = $this->privates = []; $this->methodMap = [ 'bar$' => 'getBarService', 'bar$!' => 'getBar2Service', 'foo*/oh-no' => 'getFooohnoService', ];
ted by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Test_Unsupported_Characters extends Container { protected $parameters = []; public function __construct() { $this->parameters
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_unsupported_characters.php", "language": "php", "file_size": 3744, "cut_index": 614, "middle_length": 229 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
getDefaultParameters(); $this->services = $this->privates = []; $this->aliases = []; } public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.');
ted by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Test_UrlParameters extends Container { protected $parameters = []; public function __construct() { $this->parameters = $this->
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_url_env.php", "language": "php", "file_size": 3210, "cut_index": 614, "middle_length": 229 }
gument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\Depende...
on __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'wither' => 'getWitherService', ]; $this->aliases = []; } public function compile(): void { throw new Logi
; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Service_Wither_Annotation extends Container { protected $parameters = []; public functi
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_wither_annotation.php", "language": "php", "file_size": 2025, "cut_index": 563, "middle_length": 229 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
.', 'foo_class'], ]; protected $parameters = []; public function __construct() { $this->parameters = $this->getDefaultParameters(); $this->services = $this->privates = []; $this->methodMap = [ 'foo' =>
ted by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { private const DEPRECATED_PARAMETERS = [ 'foo_class' => ['symfony/test', '6.3', 'The parameter "%s" is deprecated
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_deprecated_parameters.php", "language": "php", "file_size": 3494, "cut_index": 614, "middle_length": 229 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
ters(); $this->services = $this->privates = []; $this->methodMap = [ 'bar' => 'getBarService', 'foo' => 'getFooService', ]; $this->aliases = []; } public function compile(): void {
ted by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public function __construct() { $this->parameters = $this->getDefaultParame
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_env_in_id.php", "language": "php", "file_size": 3764, "cut_index": 614, "middle_length": 229 }
n; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Errored_Definition extends Contai...
'b_service' => 'getBServiceService', 'bar' => 'getBar3Service', 'bar2' => 'getBar22Service', 'baz' => 'getBazService', 'configured_service' => 'getConfiguredServiceService', 'configured_se
$this->syntheticIds = [ 'request' => true, ]; $this->methodMap = [ 'BAR' => 'getBARService', 'BAR2' => 'getBAR2Service', 'a_service' => 'getAServiceService',
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_errored_definition.php", "language": "php", "file_size": 16291, "cut_index": 921, "middle_length": 229 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
>getDefaultParameters(); $this->services = $this->privates = []; $this->aliases = []; } public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.');
ted by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Test_JsonParameters extends Container { protected $parameters = []; public function __construct() { $this->parameters = $this-
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_json_env.php", "language": "php", "file_size": 3293, "cut_index": 614, "middle_length": 229 }
y\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; use Symfony\Component\DependencyInjec...
e' => 'getFooServiceService', 'translator.loader_1' => 'getTranslator_Loader1Service', 'translator.loader_2' => 'getTranslator_Loader2Service', 'translator.loader_3' => 'getTranslator_Loader3Service', 'transl
{ protected $parameters = []; public function __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'bar_service' => 'getBarServiceService', 'foo_servic
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_locator.php", "language": "php", "file_size": 5795, "cut_index": 716, "middle_length": 229 }
gument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\Depende...
$this->services = $this->privates = []; $this->methodMap = [ 'bar' => 'getBarService', ]; $this->aliases = []; } public function compile(): void { throw new LogicException('You cannot compil
; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public function __construct() {
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_lazy.php", "language": "php", "file_size": 2134, "cut_index": 563, "middle_length": 229 }
ent\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use...
= []; public function __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'foo' => 'getFooService', ]; $this->aliases = []; } public function compile(): void {
rBag\ParameterBagInterface; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Service_Non_Shared_Lazy extends Container { protected $parameters
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_lazy_public.php", "language": "php", "file_size": 1969, "cut_index": 537, "middle_length": 229 }
ent\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use...
ction __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'bar' => 'getBarService', ]; $this->aliases = []; } public function compile(): void { throw new LogicEx
rBag\ParameterBagInterface; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public fun
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_resettable_as_arg.php", "language": "php", "file_size": 1568, "cut_index": 537, "middle_length": 229 }
ent\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use...
ction __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'foo' => 'getFooService', ]; $this->aliases = []; } public function compile(): void { throw new LogicEx
rBag\ParameterBagInterface; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public fun
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_resettable_multiple.php", "language": "php", "file_size": 1610, "cut_index": 537, "middle_length": 229 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
$this->getDefaultParameters(); $this->services = $this->privates = []; $this->aliases = []; } public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compile
ted by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Test_QueryStringParameters extends Container { protected $parameters = []; public function __construct() { $this->parameters =
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_query_string_env.php", "language": "php", "file_size": 3189, "cut_index": 614, "middle_length": 229 }
y\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; use Symfony\Component\DependencyInjec...
ncyInjection\\Tests\\Fixtures\\TestServiceSubscriber' => 'getTestServiceSubscriberService', 'foo_service' => 'getFooServiceService', 'late_alias' => 'getLateAliasService', ]; $this->aliases = [ 'Symfony\\
{ protected $parameters = []; protected \Closure $getService; public function __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'Symfony\\Component\\Depende
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_subscriber.php", "language": "php", "file_size": 5176, "cut_index": 716, "middle_length": 229 }
ent\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use...
public function __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'wither' => 'getWitherService', ]; $this->aliases = []; } public function compile(): void {
rBag\ParameterBagInterface; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Service_Wither extends Container { protected $parameters = [];
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_wither.php", "language": "php", "file_size": 1974, "cut_index": 537, "middle_length": 229 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
$this->methodMap = [ 'bar' => 'getBarService', 'baz' => 'getBazService', 'buz' => 'getBuzService', 'foo' => 'getFooService', ]; $this->aliases = []; } public function compile():
ted by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public function __construct() { $this->services = $this->privates = [];
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_dedup_lazy.php", "language": "php", "file_size": 3562, "cut_index": 614, "middle_length": 229 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
$this->methodMap = [ 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\ParentNotExists' => 'getParentNotExistsService', 'Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C1' => 'getC1Service
ted by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public function __construct() { $this->services = $this->privates = [];
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_inline_requires.php", "language": "php", "file_size": 3764, "cut_index": 614, "middle_length": 229 }
ent\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use...
ction __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'foo' => 'getFooService', ]; $this->aliases = []; } public function compile(): void { throw new LogicEx
rBag\ParameterBagInterface; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public fun
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_new_in_initializer.php", "language": "php", "file_size": 1544, "cut_index": 537, "middle_length": 229 }
gument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\Depende...
$this->services = $this->privates = []; $this->methodMap = [ 'bar' => 'getBarService', ]; $this->aliases = []; } public function compile(): void { throw new LogicException('You cannot compil
; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public function __construct() {
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_lazy_ghost.php", "language": "php", "file_size": 2262, "cut_index": 563, "middle_length": 229 }
ent\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use...
ction __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'bar_service' => 'getBarServiceService', 'foo_service' => 'getFooServiceService', ]; $this->aliases = []; }
rBag\ParameterBagInterface; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public fun
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_private_frozen.php", "language": "php", "file_size": 1975, "cut_index": 537, "middle_length": 229 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
{ $this->services = $this->privates = []; $this->syntheticIds = [ 'foo5' => true, ]; $this->methodMap = [ 'bar' => 'getBarService', 'foo1' => 'getFoo1Service', ]; $th
ted by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Service_Locator_Argument extends Container { protected $parameters = []; protected \Closure $getService; public function __construct()
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_service_locator_argument.php", "language": "php", "file_size": 3439, "cut_index": 614, "middle_length": 229 }
gument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\Depende...
ruct() { $this->services = $this->privates = []; $this->methodMap = [ 'bar' => 'getBarService', 'foo' => 'getFooService', ]; $this->aliases = []; } public function compile(): void {
; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Test_Deep_Graph extends Container { protected $parameters = []; public function __const
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_deep_graph.php", "language": "php", "file_size": 2515, "cut_index": 563, "middle_length": 229 }
ent\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use...
]; public function __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'App\\Foo' => 'getFooService', ]; $this->aliases = []; } public function compile(): void {
rBag\ParameterBagInterface; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Test_Inline_Self_Ref extends Container { protected $parameters = [
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_inline_self_ref.php", "language": "php", "file_size": 1582, "cut_index": 537, "middle_length": 229 }
ent\DependencyInjection\Argument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use...
ction __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'foo' => 'getFooService', ]; $this->aliases = []; } public function compile(): void { throw new LogicEx
rBag\ParameterBagInterface; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; public fun
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_resettable.php", "language": "php", "file_size": 1601, "cut_index": 537, "middle_length": 229 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
is->getDefaultParameters(); $this->services = $this->privates = []; $this->aliases = []; } public function compile(): void { throw new LogicException('You cannot compile a dumped container that was already compiled.')
ted by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Test_DefaultParameters extends Container { protected $parameters = []; public function __construct() { $this->parameters = $th
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_default_env.php", "language": "php", "file_size": 3481, "cut_index": 614, "middle_length": 229 }
gument\RewindableGenerator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\Depende...
public function __construct() { $this->services = $this->privates = []; $this->methodMap = [ 'bar' => 'getBarService', 'baz' => 'getBazService', ]; $this->aliases = []; } public function
; /** * @internal This class has been auto-generated by the Symfony Dependency Injection Component. */ class ProjectServiceContainer extends Container { protected $parameters = []; protected \Closure $getService;
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_non_shared_duplicates.php", "language": "php", "file_size": 2450, "cut_index": 563, "middle_length": 229 }
ependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Container; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfon...
$this->privates = []; $this->methodMap = [ 'bar' => 'getBarService', 'baz' => 'getBazService', 'foo1' => 'getFoo1Service', ]; $this->aliases = []; } public function compile(): void
ted by the Symfony Dependency Injection Component. */ class Symfony_DI_PhpDumper_Test_Uninitialized_Reference extends Container { protected $parameters = []; public function __construct() { $this->services =
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services_uninitialized_ref.php", "language": "php", "file_size": 3240, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\Depend...
s AbstractRecursivePassTest extends TestCase { public function testGetConstructorResolvesFactoryChildDefinitionsClass() { $container = new ContainerBuilder(); $container->setParameter('factory_dummy_class', FactoryDummy::class);
Injection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Tests\Fixtures\Bar; use Symfony\Component\DependencyInjection\Tests\Fixtures\FactoryDummy; clas
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/AbstractRecursivePassTest.php", "language": "php", "file_size": 4638, "cut_index": 614, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInje...
tainer.do_not_inline', 'container.service_locator', 'container.service_subscriber', 'kernel.event_subscriber', 'kernel.reset', ], $container->getParameter('container.behavior_describing_tags')); }
ocessSetsParameter() { $container = new ContainerBuilder(); (new AddBehaviorDescribingTagsPass(['kernel.event_subscriber', 'kernel.reset']))->process($container); $this->assertSame([ 'con
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/AddBehaviorDescribingTagsPassTest.php", "language": "php", "file_size": 2093, "cut_index": 563, "middle_length": 229 }
part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfon...
$config->addPass($pass1, PassConfig::TYPE_BEFORE_OPTIMIZATION, 10); $pass2 = $this->createStub(CompilerPassInterface::class); $config->addPass($pass2, PassConfig::TYPE_BEFORE_OPTIMIZATION, 30); $passes = $config->getBeforeOptimi
gTest extends TestCase { public function testPassOrdering() { $config = new PassConfig(); $config->setBeforeOptimizationPasses([]); $pass1 = $this->createStub(CompilerPassInterface::class);
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/PassConfigTest.php", "language": "php", "file_size": 1797, "cut_index": 537, "middle_length": 229 }
eofConditionalsPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Tests\Fixtures\BarTagClass; use Symfony\Component\DependencyInject...
'my_service1' => ['my_custom_tag' => ['priority' => 100]], 'my_service2' => ['my_custom_tag' => ['priority' => 200]], 'my_service3' => ['my_custom_tag' => ['priority' => -501]], 'my_service4' => ['my_custom_tag' => []]
lass; use Symfony\Component\DependencyInjection\TypedReference; class PriorityTaggedServiceTraitTest extends TestCase { public function testThatCacheWarmersAreProcessedInPriorityOrder() { $services = [
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/PriorityTaggedServiceTraitTest.php", "language": "php", "file_size": 28408, "cut_index": 1331, "middle_length": 229 }
ony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\Compiler\RegisterAutoconfigureAttributesPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\AutoconfigureFailedException; use Symfony\Component\DependencyInjecti...
tedCalls; use Symfony\Component\DependencyInjection\Tests\Fixtures\AutoconfigureRepeatedOverwrite; use Symfony\Component\DependencyInjection\Tests\Fixtures\AutoconfigureRepeatedProperties; use Symfony\Component\DependencyInjection\Tests\Fixtures\Autoconfig
mponent\DependencyInjection\Tests\Fixtures\AutoconfigureRepeated; use Symfony\Component\DependencyInjection\Tests\Fixtures\AutoconfigureRepeatedBindings; use Symfony\Component\DependencyInjection\Tests\Fixtures\AutoconfigureRepea
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterAutoconfigureAttributesPassTest.php", "language": "php", "file_size": 10676, "cut_index": 921, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Compiler\RegisterEnvVarProcessorsPass; use Sy...
container.env_var_processor'); (new RegisterEnvVarProcessorsPass())->process($container); $this->assertTrue($container->has('container.env_var_processors_locator')); $this->assertInstanceOf(SimpleProcessor::class, $container->get(
eption; class RegisterEnvVarProcessorsPassTest extends TestCase { public function testSimpleProcessor() { $container = new ContainerBuilder(); $container->register('foo', SimpleProcessor::class)->addTag('
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterEnvVarProcessorsPassTest.php", "language": "php", "file_size": 3443, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument; use Symfony\...
{ $container = new ContainerBuilder(); $container->register('foo', 'stdClass'); $container->register('reverse_container', ReverseContainer::class) ->addArgument(new Reference('service_container')) ->addArgu
use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\ReverseContainer; class RegisterReverseContainerPassTest extends TestCase { public function testCompileRemovesUnusedServices()
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterReverseContainerPassTest.php", "language": "php", "file_size": 3123, "cut_index": 614, "middle_length": 229 }
ymfony\Component\DependencyInjection\Compiler\ResolveBindingsPass; use Symfony\Component\DependencyInjection\Compiler\ResolveServiceSubscribersPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Excepti...
estDefinition3; use Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber; use Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriberChild; use Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscri
ures\CustomDefinition; use Symfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition1; use Symfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition2; use Symfony\Component\DependencyInjection\Tests\Fixtures\T
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/RegisterServiceSubscribersPassTest.php", "language": "php", "file_size": 25683, "cut_index": 1331, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Compiler\RemoveBuildParametersPass; use Symfo...
', $builder->getParameter('foo'), '"foo" parameter must be defined.'); $this->assertFalse($builder->hasParameter('.bar'), '".bar" parameter must be removed.'); $this->assertSame(['.bar' => 'Bar'], $pass->getRemovedParameters(), '".bar" para
ContainerBuilder(); $builder->setParameter('foo', 'Foo'); $builder->setParameter('.bar', 'Bar'); $pass = new RemoveBuildParametersPass(); $pass->process($builder); $this->assertSame('Foo
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveBuildParametersPassTest.php", "language": "php", "file_size": 3073, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Compiler\RemoveUnusedDefinitionsPass; use Sym...
register('foo') ; $container ->register('bar') ; $container ->register('moo') ->setPublic(true) ->setArguments([new Reference('bar')]) ; $this->process($contai
use Symfony\Component\DependencyInjection\Reference; class RemoveUnusedDefinitionsPassTest extends TestCase { public function testProcess() { $container = new ContainerBuilder(); $container ->
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/RemoveUnusedDefinitionsPassTest.php", "language": "php", "file_size": 4682, "cut_index": 614, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Compiler\ReplaceAliasByActualDefinitionPass; ...
'\stdClass')->setPublic(true); $aDefinition->setFactory([new Reference('b'), 'createA']); $bDefinition = new Definition('\stdClass'); $container->setDefinition('b', $bDefinition); $container->setAlias('a_alias', 'a')->set
./Fixtures/includes/foo.php'; class ReplaceAliasByActualDefinitionPassTest extends TestCase { public function testProcess() { $container = new ContainerBuilder(); $aDefinition = $container->register('a',
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ReplaceAliasByActualDefinitionPassTest.php", "language": "php", "file_size": 4724, "cut_index": 614, "middle_length": 229 }
ymfony\Component\DependencyInjection\Compiler\ResettableServicePass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use S...
lerPass() { $container = new ContainerBuilder(); $container->register('one', ResettableService::class) ->setPublic(true) ->addTag('kernel.reset', ['method' => 'reset']); $container->register('two', Cleara
ny\Component\DependencyInjection\Tests\Fixtures\MultiResettableService; use Symfony\Component\DependencyInjection\Tests\Fixtures\ResettableService; class ResettableServicePassTest extends TestCase { public function testCompi
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResettableServicePassTest.php", "language": "php", "file_size": 10172, "cut_index": 921, "middle_length": 229 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\Depend...
./Fixtures/includes/autowiring_classes.php'; class ResolveAutowireInlineAttributesPassTest extends TestCase { public function testAttribute() { $container = new ContainerBuilder(); $container->register(Foo::class, Foo::class)
nitionsPass; use Symfony\Component\DependencyInjection\Compiler\ResolveNamedArgumentsPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Reference; require_once __DIR__.'/.
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveAutowireInlineAttributesPassTest.php", "language": "php", "file_size": 3587, "cut_index": 614, "middle_length": 229 }
dencyInjection\Argument\AbstractArgument; use Symfony\Component\DependencyInjection\Argument\BoundArgument; use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument; use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument; use Symfony\Component\DependencyInjection\Attribute\Target; us...
; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Tests\Fixtures\BarInterface; use Symfony\Component\DependencyInjection\Tests\Fixtures\Cas
njection\Compiler\ResolveBindingsPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveBindingsPassTest.php", "language": "php", "file_size": 15507, "cut_index": 921, "middle_length": 229 }
ponent\DependencyInjection\Compiler\ResolveChildDefinitionsPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException; class ResolveChildDefinitionsPassTest extends TestCase { public function testProcess() { $c...
$this->assertNotInstanceOf(ChildDefinition::class, $def); $this->assertEquals('bar', $def->getClass()); $this->assertEquals(['a', 'b'], $def->getArguments()); $this->assertEquals(['foo' => 'bar'], $def->getProperties()); }
inition('parent')) ->replaceArgument(0, 'a') ->setProperty('foo', 'bar') ->setClass('bar') ; $this->process($container); $def = $container->getDefinition('child');
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveChildDefinitionsPassTest.php", "language": "php", "file_size": 13308, "cut_index": 921, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\Compiler\ResolveClassPass; use Symfony\Co...
r->register($serviceId); (new ResolveClassPass())->process($container); $this->assertSame($serviceId, $def->getClass()); } public static function provideValidClassId() { yield [CaseSensitiveClass::class]; } #
veClass; class ResolveClassPassTest extends TestCase { #[DataProvider('provideValidClassId')] public function testResolveClassFromId($serviceId) { $container = new ContainerBuilder(); $def = $containe
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveClassPassTest.php", "language": "php", "file_size": 5176, "cut_index": 716, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\Compiler\DecoratorServicePass; use Symfony\Component\DependencyInjection\Compiler\Resolv...
// The existing service that should be decorated $container->register('original_service', \stdClass::class) ->setPublic(true) ->setProperty('label', 'original'); // Define a stack that decorates the existing servic
ion; use Symfony\Component\DependencyInjection\Reference; class ResolveDecoratorStackPassTest extends TestCase { public function testStackDecoratesExistingService() { $container = new ContainerBuilder();
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveDecoratorStackPassTest.php", "language": "php", "file_size": 9118, "cut_index": 716, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework...
$container = new ContainerBuilder(); $factory = $container->register('factory', 'Foo\Bar'); $factory->setFactory([null, 'create']); $pass = new ResolveFactoryClassPass(); $pass->process($container); $this->as
inition; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Reference; class ResolveFactoryClassPassTest extends TestCase { public function testProcess() {
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveFactoryClassPassTest.php", "language": "php", "file_size": 2832, "cut_index": 563, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInje...
ner->register('foo') ->addTag('container.hot_path') ->addArgument(new IteratorArgument([new Reference('lazy')])) ->addArgument(new Reference('service_container')) ->addArgument(new Definition('', [new Referen
encyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; class ResolveHotPathPassTest extends TestCase { public function testProcess() { $container = new ContainerBuilder(); $contai
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveHotPathPassTest.php", "language": "php", "file_size": 2571, "cut_index": 563, "middle_length": 229 }
nent\Config\ResourceCheckerInterface; use Symfony\Component\DependencyInjection\Argument\BoundArgument; use Symfony\Component\DependencyInjection\ChildDefinition; use Symfony\Component\DependencyInjection\Compiler\ResolveChildDefinitionsPass; use Symfony\Component\DependencyInjection\Compiler\ResolveInstanceofCondition...
tends TestCase { public function testProcess() { $container = new ContainerBuilder(); $def = $container->register('foo', self::class)->addTag('tag')->setAutowired(true)->setChanges([]); $def->setInstanceofConditionals([
eption\RuntimeException; use Symfony\Component\DependencyInjection\Reference; use Symfony\Contracts\Service\ResetInterface; use Symfony\Contracts\Service\ServiceSubscriberInterface; class ResolveInstanceofConditionalsPassTest ex
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInstanceofConditionalsPassTest.php", "language": "php", "file_size": 15486, "cut_index": 921, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; use Symfony\Component\DependencyInjection\Compiler\DecoratorServicePass; use Symfony\Component\DependencyInjection...
->setArguments([ new Reference('bar', ContainerInterface::NULL_ON_INVALID_REFERENCE), new Reference('baz', ContainerInterface::IGNORE_ON_INVALID_REFERENCE), ]) ->addMethodCall('foo', [new Refere
cyInjection\Reference; class ResolveInvalidReferencesPassTest extends TestCase { public function testProcess() { $container = new ContainerBuilder(); $def = $container ->register('foo')
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveInvalidReferencesPassTest.php", "language": "php", "file_size": 6362, "cut_index": 716, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Symfony\Component\DependencyInjection\Compiler\ResolveNamedArgumentsPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\C...
entsDummy; use Symfony\Component\DependencyInjection\Tests\Fixtures\NamedArgumentsVariadicsDummy; use Symfony\Component\DependencyInjection\Tests\Fixtures\SimilarArgumentsDummy; use Symfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition1; /**
Symfony\Component\DependencyInjection\Tests\Fixtures\CaseSensitiveClass; use Symfony\Component\DependencyInjection\Tests\Fixtures\FactoryDummyWithoutReturnTypes; use Symfony\Component\DependencyInjection\Tests\Fixtures\NamedArgum
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveNamedArgumentsPassTest.php", "language": "php", "file_size": 8822, "cut_index": 716, "middle_length": 229 }
ge. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInje...
->addArgument(new Reference('not_preloaded')); $container->register('preloaded') ->addArgument(new Reference('preloaded_dep')) ->addArgument(new Reference('common_dep')); $container->register('not_preloaded')
stCase { public function testProcess() { $container = new ContainerBuilder(); $container->register('entry_point') ->setPublic(true) ->addArgument(new Reference('preloaded'))
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveNoPreloadPassTest.php", "language": "php", "file_size": 2071, "cut_index": 563, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Compiler\ResolveParameterPlaceHoldersPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\De...
>container = $this->createContainerBuilder(); $this->compilerPass->process($this->container); $this->fooDefinition = $this->container->getDefinition('foo'); } public function testClassParametersShouldBeResolved() { $thi
sPass $compilerPass; private ContainerBuilder $container; private Definition $fooDefinition; protected function setUp(): void { $this->compilerPass = new ResolveParameterPlaceHoldersPass(); $this-
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveParameterPlaceHoldersPassTest.php", "language": "php", "file_size": 5276, "cut_index": 716, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\Attributes\IgnoreDeprecations; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Alias; use Symfony\Component\DependencyInjection\Compiler\ResolveReferencesToAliasesPass; use ...
ias('bar', 'foo'); $def = $container ->register('moo') ->setArguments([new Reference('bar')]) ; $this->process($container); $arguments = $def->getArguments(); $this->assertEquals('foo', (str
ion; use Symfony\Component\DependencyInjection\Reference; class ResolveReferencesToAliasesPassTest extends TestCase { public function testProcess() { $container = new ContainerBuilder(); $container->setAl
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveReferencesToAliasesPassTest.php", "language": "php", "file_size": 7072, "cut_index": 716, "middle_length": 229 }