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\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument; use Symfony\...
container = new ContainerBuilder(); $container->register('a', 'stdClass')->addTag('foo'); $container->register('b', 'stdClass')->addTag('foo', ['priority' => 20]); $container->register('c', 'stdClass')->addTag('foo', ['priority' =>
ymfony\Component\DependencyInjection\TypedReference; /** * @author Roland Franssen <franssen.roland@gmail.com> */ class ResolveTaggedIteratorArgumentPassTest extends TestCase { public function testProcess() { $
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ResolveTaggedIteratorArgumentPassTest.php", "language": "php", "file_size": 4183, "cut_index": 614, "middle_length": 229 }
ony\Component\DependencyInjection\Argument\ServiceLocatorArgument; use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument; use Symfony\Component\DependencyInjection\Attribute\AsTaggedItem; use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; use Symfony\Component\DependencyInject...
fony\Component\DependencyInjection\Tests\Fixtures\TestDefinition2; require_once __DIR__.'/../Fixtures/includes/classes.php'; class ServiceLocatorTagPassTest extends TestCase { public function testNoServices() { $this->expectException(Inva
ion\Reference; use Symfony\Component\DependencyInjection\ServiceLocator; use Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition; use Symfony\Component\DependencyInjection\Tests\Fixtures\TestDefinition1; use Sym
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ServiceLocatorTagPassTest.php", "language": "php", "file_size": 12926, "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\DecoratorServicePass; use Symfony\Co...
r('foo', \stdClass::class)->addTag('tag'); $container->register('bar', \stdClass::class)->addTag('tag'); $container->register('decorator', \stdClass::class)->addResourceTag('container.tag_decorator', ['decorates_tag' => 'tag']); $t
ponent\DependencyInjection\Exception\ServiceNotFoundException; class TagDecoratorPassTest extends TestCase { public function testDecorateByTag() { $container = new ContainerBuilder(); $container->registe
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/TagDecoratorPassTest.php", "language": "php", "file_size": 4569, "cut_index": 614, "middle_length": 229 }
omponent\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException; use Symfony\Component\Config\Definition\Exception\InvalidTypeException; use Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass; use Symfony\Component\Dependency...
nConfig() { $container = new ContainerBuilder(); $container->setParameter('env(NULLED)', null); $container->setParameter('env(FLOATISH)', '3.2'); $container->registerExtension($ext = new EnvExtension()); $contain
Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Extension\Extension; class ValidateEnvPlaceholdersPassTest extends TestCase { public function testEnvsAreValidatedI
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ValidateEnvPlaceholdersPassTest.php", "language": "php", "file_size": 16592, "cut_index": 921, "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\Argument; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInje...
from a lazy closure.'); $closure->foo; } public function testThrowsWhenNotUsingInterface() { $this->expectException(\RuntimeException::class); $this->expectExceptionMessage('Cannot create adapter for service "foo" bec
ic function testMagicGetThrows() { $closure = new LazyClosure(static fn () => null); $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Cannot read property "foo"
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Argument/LazyClosureTest.php", "language": "php", "file_size": 2288, "cut_index": 563, "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\Argument; use PHPUnit\Framework\TestCas...
ic function () { yield 1; }, 3); $this->assertCount(3, $generator); } public function testCountUsesProvidedValueAsCallback() { $called = 0; $generator = new RewindableGenerator(static function () {
assertInstanceOf(\Countable::class, new RewindableGenerator(static function () { yield 1; }, 1)); } public function testCountUsesProvidedValue() { $generator = new RewindableGenerator(stat
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Argument/RewindableGeneratorTest.php", "language": "php", "file_size": 1368, "cut_index": 524, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Argument; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\IgnoreDeprecations; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Argumen...
$this->assertFalse($taggedIteratorArgument->needsIndexes()); $this->assertNull($taggedIteratorArgument->getDefaultPriorityMethod(false)); } public function testOnlyTagWithNeedsIndexes() { $taggedIteratorArgument = new Tagge
$this->assertSame('foo', $taggedIteratorArgument->getTag()); $this->assertNull($taggedIteratorArgument->getIndexAttribute()); $this->assertNull($taggedIteratorArgument->getDefaultIndexMethod(false));
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Argument/TaggedIteratorArgumentTest.php", "language": "php", "file_size": 5440, "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\Config; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\T...
tainer $container; protected function setUp(): void { $this->resource = new ContainerParametersResource(['locales' => ['fr', 'en'], 'default_locale' => 'fr']); $this->container = new Container(); $this->resourceChecker = ne
t\DependencyInjection\Container; class ContainerParametersResourceCheckerTest extends TestCase { private ContainerParametersResource $resource; private ContainerParametersResourceChecker $resourceChecker; private Con
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Config/ContainerParametersResourceCheckerTest.php", "language": "php", "file_size": 2087, "cut_index": 563, "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\Config; use PHPUnit\Framework\Tes...
Same('container_parameters_f2f012423c221eddf6c9a6305f965327', (string) $this->resource); } public function testSerializeUnserialize() { $unserialized = unserialize(serialize($this->resource)); $this->assertEquals($this->resour
; protected function setUp(): void { $this->resource = new ContainerParametersResource(['locales' => ['fr', 'en'], 'default_locale' => 'fr']); } public function testToString() { $this->assert
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Config/ContainerParametersResourceTest.php", "language": "php", "file_size": 1200, "cut_index": 518, "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...
->register('foo') ->setPublic(true) ->addTag('container.private', ['package' => 'foo/bar', 'version' => '1.2']); (new AliasDeprecatedPublicServicesPass())->process($container); $this->assertTrue($container->hasAlia
ection\Exception\InvalidArgumentException; final class AliasDeprecatedPublicServicesPassTest extends TestCase { public function testProcess() { $container = new ContainerBuilder(); $container
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/AliasDeprecatedPublicServicesPassTest.php", "language": "php", "file_size": 2743, "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\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; use Symfony\Component\DependencyInjecti...
'b')) ; $container ->register('b') ->addMethodCall('setA', [$ref2 = new Reference('a')]) ; $container ->register('c') ->addArgument($ref3 = new Reference('a')) ->
yzeServiceReferencesPassTest extends TestCase { public function testProcess() { $container = new ContainerBuilder(); $container ->register('a') ->addArgument($ref1 = new Reference(
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/AnalyzeServiceReferencesPassTest.php", "language": "php", "file_size": 6986, "cut_index": 716, "middle_length": 229 }
rocess($container); try { (new AutowirePass())->process($container); $this->fail('AutowirePass should have thrown an exception'); } catch (AutowiringFailedException $e) { $this->assertSame('Cannot autowire service "Symfony\Component\DependencyInjection\Tests\Compiler\...
:class); $definition->setAutowired(true); (new ResolveClassPass())->process($container); (new AutowirePass())->process($container); $this->assertCount(1, $container->getDefinition('fooVariadic')->getArguments()); $
ge()); } } public function testProcessVariadic() { $container = new ContainerBuilder(); $container->register(Foo::class); $definition = $container->register('fooVariadic', FooVariadic:
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowirePassTest.php", "language": "php", "file_size": 71903, "cut_index": 3790, "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\AutowireRequiredMethodsPass; use Sym...
ainerBuilder(); $container->register(Foo::class); $container ->register('setter_injection', AutowireSetter::class) ->setAutowired(true); (new ResolveClassPass())->process($container); (new AutowireR
eturnType; require_once __DIR__.'/../Fixtures/includes/autowiring_classes.php'; class AutowireRequiredMethodsPassTest extends TestCase { public function testSetterInjectionWithAttribute() { $container = new Cont
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowireRequiredMethodsPassTest.php", "language": "php", "file_size": 3351, "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\CheckAliasValidityPass; use Symfony\...
eckAliasValidityPass\FooNotImplementing; class CheckAliasValidityPassTest extends TestCase { public function testProcessDetectsClassNotImplementingAliasedInterface() { $this->expectException(RuntimeException::class); $container = n
\DependencyInjection\Tests\Fixtures\CheckAliasValidityPass\FooImplementing; use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckAliasValidityPass\FooInterface; use Symfony\Component\DependencyInjection\Tests\Fixtures\Ch
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckAliasValidityPassTest.php", "language": "php", "file_size": 3115, "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\Attributes\DataProvider; use PHPUnit\Framework...
$definition = $container->register('foo'); $definition->setArguments([null, 1, 'a']); $definition->setMethodCalls([ ['bar', ['a', 'b']], ['baz', ['c', 'd']], ]); $pass = new CheckArgumentsValidityP
Exception\RuntimeException; /** * @author Kévin Dunglas <dunglas@gmail.com> */ class CheckArgumentsValidityPassTest extends TestCase { public function testProcess() { $container = new ContainerBuilder();
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckArgumentsValidityPassTest.php", "language": "php", "file_size": 2415, "cut_index": 563, "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\Attributes\TestWith; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Ar...
mfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException; use Symfony\Component\DependencyInjection\Reference; class CheckExceptionOnInvalidReferenceBehaviorPassTest extends TestCase {
orPass; use Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass; use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Sy
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckExceptionOnInvalidReferenceBehaviorPassTest.php", "language": "php", "file_size": 5084, "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\Compiler; use PHPUnit\Framework\TestCas...
true); $container->register('b')->addArgument(new Reference('a')); $this->expectException(\RuntimeException::class); $this->process($container); } public function testProcess() { $container = new ContainerBuil
e; class CheckReferenceValidityPassTest extends TestCase { public function testProcessDetectsReferenceToAbstractDefinition() { $container = new ContainerBuilder(); $container->register('a')->setAbstract(
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckReferenceValidityPassTest.php", "language": "php", "file_size": 1363, "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\Tests\Compiler; use PHPUnit\Framework\TestCas...
$container = new ContainerBuilder(); $container->register('test', 'stdClass') ->setPublic(true) ->setArguments([new Expression('custom_func("foobar")')]); $container->addExpressionLanguageProvider(new class implem
onent\ExpressionLanguage\ExpressionFunction; use Symfony\Component\ExpressionLanguage\ExpressionFunctionProviderInterface; class CustomExpressionLanguageFunctionTest extends TestCase { public function testDump() {
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/CustomExpressionLanguageFunctionTest.php", "language": "php", "file_size": 1457, "cut_index": 524, "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...
untimeException::class); $this->expectExceptionMessage('Things went wrong!'); $container = new ContainerBuilder(); $def = new Definition(); $def->addError('Things went wrong!'); $def->addError('Now something else!');
njection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Reference; class DefinitionErrorExceptionPassTest extends TestCase { public function testThrowsException() { $this->expectException(R
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/DefinitionErrorExceptionPassTest.php", "language": "php", "file_size": 3038, "cut_index": 563, "middle_length": 229 }
ymfony\Component\DependencyInjection\Argument\ServiceClosureArgument; use Symfony\Component\DependencyInjection\Compiler\AnalyzeServiceReferencesPass; use Symfony\Component\DependencyInjection\Compiler\InlineServiceDefinitionsPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\Depend...
->register('service') ->setArguments([new Reference('inlinable.service')]) ; $this->process($container); $arguments = $container->getDefinition('service')->getArguments(); $this->assertInstanceOf(Defini
tionsPassTest extends TestCase { public function testProcess() { $container = new ContainerBuilder(); $inlineable = $container ->register('inlinable.service') ; $container
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/InlineServiceDefinitionsPassTest.php", "language": "php", "file_size": 11454, "cut_index": 921, "middle_length": 229 }
omponent\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\Resource\FileResource; use Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationContainerBuilder; use Symfony\Component\DependencyInjection\Compiler\MergeExtensionConfigurationPass; use Symfony\Component\DependencyInjec...
ressionFunctionProviderInterface; class MergeExtensionConfigurationPassTest extends TestCase { public function testExpressionLanguageProviderForwarding() { $tmpProviders = []; $extension = $this->createMock(ExtensionInterface::cla
nt\DependencyInjection\Extension\Extension; use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; use Symfony\Component\ExpressionLanguage\Exp
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/MergeExtensionConfigurationPassTest.php", "language": "php", "file_size": 9554, "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\Loader\Configurator; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Loader\Configurator\AppReference; ...
config = array_replace_recursive([ 'services' => [ '_defaults' => [ 'autowire' => true, 'autoconfigure' => true, ], ], ], $config); $this->asse
'resource' => '../src/', ], 'my_service' => [ 'class' => 'MyClass', ], ], ]; $result = AppReference::config($config); $
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Loader/Configurator/AppReferenceTest.php", "language": "php", "file_size": 4034, "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\Loader\Configurator; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\IgnoreDeprecations; use PHPUnit\Fra...
ection\Loader\Configurator\tagged_iterator; use function Symfony\Component\DependencyInjection\Loader\Configurator\tagged_locator; class ContainerConfiguratorTest extends TestCase { public function testImportForwardsExcludeAndIgnoreErrors() {
endencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; use Symfony\Component\DependencyInjection\Loader\PhpFileLoader; use function Symfony\Component\DependencyInj
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Loader/Configurator/ContainerConfiguratorTest.php", "language": "php", "file_size": 4028, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\ParameterBag; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjec...
num(StringBackedEnum::class), '%'); $this->assertIsString($bag->get($name)); } public function testGetThrowsInvalidArgumentExceptionIfEnvNameContainsNonWordCharacters() { $bag = new EnvPlaceholderParameterBag(); $this->
edEnum; class EnvPlaceholderParameterBagTest extends TestCase { public function testEnumEnvVarProcessorPassesRegex() { $bag = new EnvPlaceholderParameterBag(); $name = trim((new EnvConfigurator('FOO'))->e
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/ParameterBag/EnvPlaceholderParameterBagTest.php", "language": "php", "file_size": 8316, "cut_index": 716, "middle_length": 229 }
e PHPUnit\Framework\Attributes\TestWith; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Exception\EmptyParameterValueException; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\ParameterCircularReferenceException...
); $this->assertEquals($parameters, $bag->all(), '__construct() takes an array of parameters as its first argument'); } public function testClear() { $bag = new ParameterBag($parameters = [ 'foo' => 'foo',
n\ParameterBag\ParameterBag; class ParameterBagTest extends TestCase { public function testConstructor() { $bag = new ParameterBag($parameters = [ 'foo' => 'foo', 'bar' => 'bar', ]
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ParameterBagTest.php", "language": "php", "file_size": 17031, "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\AutoAliasServicePass; use Symfony\Co...
('auto_alias', ['format' => '%non_existing%.example']); $pass = new AutoAliasServicePass(); $this->expectException(ParameterNotFoundException::class); $pass->process($container); } public function testProcessWithMissingF
dException; class AutoAliasServicePassTest extends TestCase { public function testProcessWithMissingParameter() { $container = new ContainerBuilder(); $container->register('example') ->addTag
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/AutoAliasServicePassTest.php", "language": "php", "file_size": 4083, "cut_index": 614, "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\Compiler\CheckDefinitionValidityPass; use Symfony\Component\DependencyInjection\ContainerBuilder; us...
ption(RuntimeException::class); $this->process($container); } public function testProcessDetectsNonSyntheticNonAbstractDefinitionWithoutClass() { $container = new ContainerBuilder(); $container->register('a')->setSynth
stCase { public function testProcessDetectsSyntheticNonPublicDefinitions() { $container = new ContainerBuilder(); $container->register('a')->setSynthetic(true)->setPublic(false); $this->expectExce
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckDefinitionValidityPassTest.php", "language": "php", "file_size": 5771, "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\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\Argument\ServiceLocatorArgument; use Symfony\Component\DependencyInjection\Arg...
ection\Exception\ServiceCircularReferenceException; use Symfony\Component\DependencyInjection\Reference; class CheckCircularReferencesPassTest extends TestCase { public function testProcess() { $container = new ContainerBuilder();
se Symfony\Component\DependencyInjection\Compiler\Compiler; use Symfony\Component\DependencyInjection\Compiler\ServiceLocatorTagPass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInj
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckCircularReferencesPassTest.php", "language": "php", "file_size": 5883, "cut_index": 716, "middle_length": 229 }
endencyInjection\Compiler\DecoratorServicePass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundExcep...
dService('foo') ; $barDefinition = $container ->register('bar') ->setPublic(true) ; $barExtendedDefinition = $container ->register('bar.extended') ->setPublic(true)
inerBuilder(); $fooDefinition = $container ->register('foo') ; $fooExtendedDefinition = $container ->register('foo.extended') ->setPublic(true) ->setDecorate
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/DecoratorServicePassTest.php", "language": "php", "file_size": 11656, "cut_index": 921, "middle_length": 229 }
jection\Tests\Fixtures\Attribute\CustomPropertyAttribute; use Symfony\Component\DependencyInjection\Tests\Fixtures\AutoconfiguredInterface2; use Symfony\Component\DependencyInjection\Tests\Fixtures\AutoconfiguredService1; use Symfony\Component\DependencyInjection\Tests\Fixtures\AutoconfiguredService2; use Symfony\Compo...
s\Fixtures\StaticMethodTag; use Symfony\Component\DependencyInjection\Tests\Fixtures\TaggedConsumerWithExclude; use Symfony\Component\DependencyInjection\Tests\Fixtures\TaggedIteratorConsumer; use Symfony\Component\DependencyInjection\Tests\Fixtures\Tagged
FooBarTaggedClass; use Symfony\Component\DependencyInjection\Tests\Fixtures\FooBarTaggedForDefaultPriorityClass; use Symfony\Component\DependencyInjection\Tests\Fixtures\FooTagClass; use Symfony\Component\DependencyInjection\Test
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/IntegrationTest.php", "language": "php", "file_size": 50338, "cut_index": 2151, "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\Loader\Configurator; use PHPUnit\Framework\TestCase; use Symfony\Component\Dep...
ass AbstractConfiguratorTest extends TestCase { public function testInlineServiceIsNotAllowedWithoutAllowServices() { $configurator = new InlineServiceConfigurator(new Definition('stdClass')); $this->expectException(InvalidArgument
se Symfony\Component\DependencyInjection\Loader\Configurator\InlineServiceConfigurator; use Symfony\Component\DependencyInjection\Loader\Configurator\ReferenceConfigurator; use Symfony\Component\DependencyInjection\Reference; cl
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Loader/Configurator/AbstractConfiguratorTest.php", "language": "php", "file_size": 3005, "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\ParameterBag; use PHPUnit\Framework\Attributes\IgnoreDeprecations; use PHPUnit...
rameters as its first argument'); } public function testClear() { $this->expectException(\LogicException::class); $bag = new FrozenParameterBag([]); $bag->clear(); } public function testSet() { $thi
$parameters = [ 'foo' => 'foo', 'bar' => 'bar', ]; $bag = new FrozenParameterBag($parameters); $this->assertEquals($parameters, $bag->all(), '__construct() takes an array of pa
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/ParameterBag/FrozenParameterBagTest.php", "language": "php", "file_size": 2239, "cut_index": 563, "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\Attribute\Target; use Symfony\Component\Depen...
iesPassTest extends TestCase { public function testAttribute() { $container = new ContainerBuilder(); $container->register(Foo::class); $container->register('property_injection', AutowireProperty::class) ->setAu
fony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\DependencyInjection\TypedReference; require_once __DIR__.'/../Fixtures/includes/autowiring_classes.php'; class AutowireRequiredPropert
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/AutowireRequiredPropertiesPassTest.php", "language": "php", "file_size": 3636, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\Tests\Compiler; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenc...
->useExtension(...)" and silently // produce a half-built service. $container = new ContainerBuilder(); $container->register('builder', 'stdClass') ->addMethodCall('useExtension', [new Reference('extension')]); $
cesProduct() { // The consumer ("extension") is private and used only by the builder's // method call, so it gets inlined into the builder. The dumper would emit // "$instance = $a->build()" before "$a
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckFactoryBuilderCircularReferencePassTest.php", "language": "php", "file_size": 7989, "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...
protected function setUp(): void { $this->container = new ContainerBuilder(); $this->pass = new ExtensionCompilerPass(); } public function testProcess() { $extension1 = new CompilerPassExtension('extension1');
t\DependencyInjection\Extension\Extension; /** * @author Wouter J <wouter@wouterj.nl> */ class ExtensionCompilerPassTest extends TestCase { private ContainerBuilder $container; private ExtensionCompilerPass $pass;
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/ExtensionCompilerPassTest.php", "language": "php", "file_size": 2307, "cut_index": 563, "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\Attribute\AsTaggedItem; use Symfony\Component...
der(); $container->registerAttributeForAutoconfiguration(AsTaggedItem::class, static function () {}); $container->register('foo', \stdClass::class) ->setAutoconfigured(true) ; (new AttributeAutoconfigurationPass
\Component\DependencyInjection\Exception\LogicException; class AttributeAutoconfigurationPassTest extends TestCase { public function testProcessAddsNoEmptyInstanceofConditionals() { $container = new ContainerBuil
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/AttributeAutoconfigurationPassTest.php", "language": "php", "file_size": 3090, "cut_index": 614, "middle_length": 229 }
ss\Deprecated; use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\Foo; use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\FooObject; use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\IntersectionConstructor; use Symfony\Com...
s\Fixtures\CheckTypeDeclarationsPass\Wobble; use Symfony\Component\ExpressionLanguage\Expression; /** * @author Nicolas Grekas <p@tchwork.com> * @author Julien Maulny <jmaulny@darkmira.fr> */ class CheckTypeDeclarationsPassTest extends TestCase { p
use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\Waldo; use Symfony\Component\DependencyInjection\Tests\Fixtures\CheckTypeDeclarationsPass\WaldoFoo; use Symfony\Component\DependencyInjection\Test
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Compiler/CheckTypeDeclarationsPassTest.php", "language": "php", "file_size": 41134, "cut_index": 2151, "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\ParameterBag; use PHPUnit\Framework\TestCase; use Ps...
ction\ParameterBag\ParameterBag; class ContainerBagTest extends TestCase { private ParameterBag $parameterBag; private ContainerBag $containerBag; protected function setUp(): void { $this->parameterBag = new ParameterBag(['foo' =>
ncyInjection\ParameterBag\ContainerBag; use Symfony\Component\DependencyInjection\ParameterBag\ContainerBagInterface; use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; use Symfony\Component\DependencyInje
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/ParameterBag/ContainerBagTest.php", "language": "php", "file_size": 2014, "cut_index": 537, "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\Configurator; use PHPUnit\Framework\Attribute...
figurator); } public static function provide(): iterable { yield ['%env(FOO)%', new EnvConfigurator('FOO')]; yield ['%env(string:FOO)%', new EnvConfigurator('string:FOO')]; yield ['%env(string:FOO)%', (new EnvConfigurat
ckedEnum; final class EnvConfiguratorTest extends TestCase { #[DataProvider('provide')] public function test(string $expected, EnvConfigurator $envConfigurator) { $this->assertSame($expected, (string) $envCon
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Loader/Configurator/EnvConfiguratorTest.php", "language": "php", "file_size": 1513, "cut_index": 537, "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\LazyProxy\Instantiator; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Compo...
/** * @param-immediately-invoked-callable $realInstantiator * * @return object The real service instance */ public function instantiateProxy(ContainerInterface $container, Definition $definition, string $id, callable $realInstan
viceInstantiator implements InstantiatorInterface {
{ "filepath": "src/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/RealServiceInstantiator.php", "language": "php", "file_size": 956, "cut_index": 582, "middle_length": 52 }
he 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\Uid\Exception; /** * The $invalidValue property holds the raw value that failed validat...
blic * properties) without redacting or truncating $invalidValue. */ class InvalidArgumentException extends \InvalidArgumentException { public function __construct( string $message, public readonly mixed $invalidValue = null, ) {
var_export, serialize, structured loggers dumping pu
{ "filepath": "src/Symfony/Component/Uid/Exception/InvalidArgumentException.php", "language": "php", "file_size": 902, "cut_index": 547, "middle_length": 52 }
buted with this source code. */ namespace Symfony\Component\Uid\Factory; use Symfony\Component\Uid\Exception\InvalidArgumentException; use Symfony\Component\Uid\Exception\LogicException; use Symfony\Component\Uid\TimeBasedUidInterface; use Symfony\Component\Uid\Uuid; use Symfony\Component\Uid\UuidV1; use Symfony\Com...
pace = null, ) { $this->sequence = match (true) { \is_array($uuids) => new \ArrayIterator($uuids), $uuids instanceof \Iterator => $uuids, $uuids instanceof \Traversable => new \IteratorIterator($uuids),
uence; /** * @param iterable<string|Uuid> $uuids */ public function __construct( iterable $uuids, private Uuid|string|null $timeBasedNode = null, private Uuid|string|null $nameBasedNames
{ "filepath": "src/Symfony/Component/Uid/Factory/MockUuidFactory.php", "language": "php", "file_size": 5346, "cut_index": 716, "middle_length": 229 }
<?php /* * 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\Uid\Factory; use Symfony\Component\Uid\Uuid; use Symf...
d::v3($this->namespace, $name); } if (is_subclass_of($class, UuidV5::class)) { $uuid = Uuid::v5($this->namespace, $name); } else { $uuid = Uuid::v3($this->namespace, $name); } return new $cl
{ } public function create(string $name): UuidV5|UuidV3 { switch ($class = $this->class) { case UuidV5::class: return Uuid::v5($this->namespace, $name); case UuidV3::class: return Uui
{ "filepath": "src/Symfony/Component/Uid/Factory/NameBasedUuidFactory.php", "language": "php", "file_size": 1017, "cut_index": 512, "middle_length": 229 }
ackage. * * (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\Uid\Factory; use Symfony\Component\Uid\TimeBasedUidInterface; use Symfony\Component\Uid\Uuid; class...
?\DateTimeInterface $time = null): Uuid&TimeBasedUidInterface { $class = $this->class; if (null === $time && null === $this->node) { return new $class(); } return new $class($class::generate($time, $this->n
e = null, ) { } public function create(
{ "filepath": "src/Symfony/Component/Uid/Factory/TimeBasedUuidFactory.php", "language": "php", "file_size": 882, "cut_index": 559, "middle_length": 52 }
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Uid\Factory; use Symfony\Component\Uid\Exception\LogicException; use Symfony\Component\Uid\Uuid; use Symfony\Component\Uid\UuidV1; use Symfony\Component\Ui...
uidV7::class, string|int $nameBasedClass = UuidV5::class, string|int $randomBasedClass = UuidV4::class, Uuid|string|null $timeBasedNode = null, Uuid|string|null $nameBasedNamespace = null) { if (null !== $timeBasedNode && !$timeBasedNode instan
eBasedClass; private string $randomBasedClass; private ?Uuid $timeBasedNode; private ?Uuid $nameBasedNamespace; public function __construct(string|int $defaultClass = UuidV7::class, string|int $timeBasedClass = U
{ "filepath": "src/Symfony/Component/Uid/Factory/UuidFactory.php", "language": "php", "file_size": 3417, "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\Uid\Command; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Completion\Com...
ate', description: 'Generate a ULID')] class GenerateUlidCommand extends Command { public function __construct( private UlidFactory $factory = new UlidFactory(), ) { parent::__construct(); } protected function configure():
omponent\Console\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Uid\Factory\UlidFactory; #[AsCommand(name: 'ulid:gener
{ "filepath": "src/Symfony/Component/Uid/Command/GenerateUlidCommand.php", "language": "php", "file_size": 3927, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Uid\Command; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Completion\CompletionInput; use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component\Co...
'Generate a UUID')] class GenerateUuidCommand extends Command { public function __construct( private UuidFactory $factory = new UuidFactory(), ) { parent::__construct(); } protected function configure(): void {
use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Uid\Exception\LogicException; use Symfony\Component\Uid\Factory\UuidFactory; use Symfony\Component\Uid\Uuid; #[AsCommand(name: 'uuid:generate', description:
{ "filepath": "src/Symfony/Component/Uid/Command/GenerateUuidCommand.php", "language": "php", "file_size": 7769, "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\Uid\Command; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Co...
ID')] class InspectUlidCommand extends Command { protected function configure(): void { $this ->setDefinition([ new InputArgument('ulid', InputArgument::REQUIRED, 'The ULID to inspect'), ])
\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Uid\Ulid; #[AsCommand(name: 'ulid:inspect', description: 'Inspect a UL
{ "filepath": "src/Symfony/Component/Uid/Command/InspectUlidCommand.php", "language": "php", "file_size": 2255, "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\Uid\Command; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Co...
id\TimeBasedUidInterface; use Symfony\Component\Uid\Uuid; #[AsCommand(name: 'uuid:inspect', description: 'Inspect a UUID')] class InspectUuidCommand extends Command { protected function configure(): void { $this ->setDefinition
\Output\ConsoleOutputInterface; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Uid\MaxUuid; use Symfony\Component\Uid\NilUuid; use Symfony\Component\U
{ "filepath": "src/Symfony/Component/Uid/Command/InspectUuidCommand.php", "language": "php", "file_size": 2742, "cut_index": 563, "middle_length": 229 }
se PHPUnit\Framework\TestCase; use Symfony\Component\Uid\Exception\InvalidArgumentException; use Symfony\Component\Uid\MaxUlid; use Symfony\Component\Uid\NilUlid; use Symfony\Component\Uid\Tests\Fixtures\CustomUlid; use Symfony\Component\Uid\Ulid; use Symfony\Component\Uid\UuidV4; class UlidTest extends TestCase { ...
b, -6), 'ABCDEFGHJKMNPQRSTVWXYZ', 'abcdefghijklmnopqrstuv'), 32, 10); $c = base_convert(strtr(substr($c, -6), 'ABCDEFGHJKMNPQRSTVWXYZ', 'abcdefghijklmnopqrstuv'), 32, 10); $this->assertSame(1, $b - $a); $this->assertSame(1, $c - $b)
me(0, strncmp($a, $b, 20)); $this->assertSame(0, strncmp($a, $c, 20)); $a = base_convert(strtr(substr($a, -6), 'ABCDEFGHJKMNPQRSTVWXYZ', 'abcdefghijklmnopqrstuv'), 32, 10); $b = base_convert(strtr(substr($
{ "filepath": "src/Symfony/Component/Uid/Tests/UlidTest.php", "language": "php", "file_size": 13032, "cut_index": 921, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Uid\Tests; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\RequiresPhpExtension; use PHPUnit\Framework\Attributes\TestWith; use PHPUnit\Framework\TestCase; use Symfony\Component\Uid\Exception\InvalidArgumentException; use Sym...
adcfe')); } #[TestWith([''])] #[TestWith(['x'])] #[TestWith(['tooshort'])] #[TestWith(['123456789012345'])] public function testConstructorRequiresAtLeast16ByteKey(string $secret) { $this->expectException(InvalidArgumen
private function createConverter(): Uuid47Transformer { // K0 = 0x0123456789abcdef, K1 = 0xfedcba9876543210 (little-endian byte representation) return new Uuid47Transformer(hex2bin('efcdab89674523011032547698b
{ "filepath": "src/Symfony/Component/Uid/Tests/Uuid47TransformerTest.php", "language": "php", "file_size": 6996, "cut_index": 716, "middle_length": 229 }
se Symfony\Component\Uid\UuidV5; use Symfony\Component\Uid\UuidV6; use Symfony\Component\Uid\UuidV7; class UuidTest extends TestCase { private const A_UUID_V1 = 'd9e7a184-5d5b-11ea-a62a-3499710062d0'; private const A_UUID_V4 = 'd6b3345b-2905-4048-a83c-b5988e765d98'; private const A_UUID_V7 = '017f22e2-79b0...
'these are just thirty-six characters']; } public function testInvalidUuidContainsInvalidValue() { $invalidUuid = 'this is not a uuid'; try { Uuid::fromString($invalidUuid); $this->fail(\sprintf('Expect
tion::class); $this->expectExceptionMessage('Invalid UUID.'); Uuid::fromString($uuid); } public static function provideInvalidUuids(): iterable { yield ['this is not a uuid']; yield [
{ "filepath": "src/Symfony/Component/Uid/Tests/UuidTest.php", "language": "php", "file_size": 20548, "cut_index": 1331, "middle_length": 229 }
rgumentException; use Symfony\Component\Uid\Exception\LogicException; use Symfony\Component\Uid\Factory\MockUuidFactory; use Symfony\Component\Uid\UuidV1; use Symfony\Component\Uid\UuidV3; use Symfony\Component\Uid\UuidV4; use Symfony\Component\Uid\UuidV5; use Symfony\Component\Uid\UuidV6; use Symfony\Component\Uid\Uui...
nces(): \Generator { $uuid1String = '6ba7b810-9dad-11d1-80b4-00c04fd430c8'; $uuid3String = '6ba7b810-9dad-31d1-80b4-00c04fd430c8'; $uuid4String = '6ba7b810-9dad-41d1-80b4-00c04fd430c8'; $uuid5String = '6ba7b810-9dad-51d1
{ $factory = new MockUuidFactory($sequence); foreach ($expected as $expectedUuid) { $this->assertEquals($expectedUuid, $factory->create()); } } public static function provideSeque
{ "filepath": "src/Symfony/Component/Uid/Tests/Factory/MockUuidFactoryTest.php", "language": "php", "file_size": 10852, "cut_index": 921, "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\Uid\Tests\Factory; use PHPUnit\Framework\TestCase; use Symfony\Co...
$ulid2 = $ulidFactory->create(new \DateTimeImmutable('@999999.123000')); $this->assertSame('999999.123000', $ulid2->getDateTime()->format('U.u')); $this->assertFalse($ulid1->equals($ulid2)); $this->assertSame(-1, $ulid1->co
lidFactory = new UlidFactory(); $ulidFactory->create(); $ulid1 = $ulidFactory->create(new \DateTimeImmutable('@999999.123000')); $this->assertSame('999999.123000', $ulid1->getDateTime()->format('U.u'));
{ "filepath": "src/Symfony/Component/Uid/Tests/Factory/UlidFactoryTest.php", "language": "php", "file_size": 1470, "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\Uid\Tests\Factory; use PHPUnit\Framework\TestCase; use Symfony\Component\Uid\Exception\InvalidArgumentException; use Symfony\Component\Uid\Factory\UuidFact...
:class, (new UuidFactory())->nameBased('6f80c216-0492-4421-bd82-c10ab929ae84')->create('foo')); $this->assertInstanceOf(UuidV3::class, (new UuidFactory(6, 6, 3))->nameBased('6f80c216-0492-4421-bd82-c10ab929ae84')->create('foo')); } public
ent\Uid\UuidV5; use Symfony\Component\Uid\UuidV6; use Symfony\Component\Uid\UuidV7; final class UuidFactoryTest extends TestCase { public function testCreateNamedDefaultVersion() { $this->assertInstanceOf(UuidV5:
{ "filepath": "src/Symfony/Component/Uid/Tests/Factory/UuidFactoryTest.php", "language": "php", "file_size": 4080, "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\Uid\Tests\Command; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Symfony\Compo...
).substr($time, 1, 4); $commandTester = new CommandTester(new GenerateUlidCommand()); $this->assertSame(0, $commandTester->execute([])); $ulid = Ulid::fromBase32(trim($commandTester->getDisplay())); $this->assertEquals(\D
d; use Symfony\Component\Uid\Ulid; final class GenerateUlidCommandTest extends TestCase { #[Group('time-sensitive')] public function testDefaults() { $time = microtime(false); $time = substr($time, 11
{ "filepath": "src/Symfony/Component/Uid/Tests/Command/GenerateUlidCommandTest.php", "language": "php", "file_size": 4185, "cut_index": 614, "middle_length": 229 }
se Symfony\Component\Console\Tester\CommandCompletionTester; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Uid\Command\GenerateUuidCommand; use Symfony\Component\Uid\Factory\UuidFactory; use Symfony\Component\Uid\Uuid; use Symfony\Component\Uid\UuidV1; use Symfony\Component\Uid\UuidV3; use S...
)))); $commandTester = new CommandTester(new GenerateUuidCommand(new UuidFactory(UuidV4::class))); $this->assertSame(0, $commandTester->execute([])); $this->assertInstanceOf(UuidV4::class, Uuid::fromRfc4122(trim($commandTester->get
{ $commandTester = new CommandTester(new GenerateUuidCommand()); $this->assertSame(0, $commandTester->execute([])); $this->assertInstanceOf(UuidV7::class, Uuid::fromRfc4122(trim($commandTester->getDisplay(
{ "filepath": "src/Symfony/Component/Uid/Tests/Command/GenerateUuidCommandTest.php", "language": "php", "file_size": 9681, "cut_index": 921, "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\Uid\Tests\Command; use PHPUnit\Framework\TestCase; use Symfony\Component\Conso...
([ '01E439TP9XJZ9RPFH3T1PYBCR8', '1BKocMc5BnrVcuq2ti4Eqm', '0171069d-593d-97d3-8b3e-23d06de5b308', ] as $ulid) { $this->assertSame(0, $commandTester->execute(['ulid' => $ulid])); $this->a
new CommandTester(new InspectUlidCommand()); $this->assertSame(1, $commandTester->execute(['ulid' => 'foobar'])); $this->assertStringContainsString('Invalid ULID.', $commandTester->getDisplay()); foreach
{ "filepath": "src/Symfony/Component/Uid/Tests/Command/InspectUlidCommandTest.php", "language": "php", "file_size": 1944, "cut_index": 537, "middle_length": 229 }
ctUuidCommand; final class InspectUuidCommandTest extends TestCase { public function testInvalid() { $commandTester = new CommandTester(new InspectUuidCommand()); $this->assertSame(1, $commandTester->execute(['uuid' => 'foobar'])); $this->assertStringContainsString('Invalid UUID.', $co...
----------------------- -------------------------------------- Version nil toRfc4122 (canonical) 00000000-0000-0000-0000-000000000000
te(['uuid' => '00000000-0000-0000-0000-000000000000'])); $this->assertSame(<<<EOF ----------------------- -------------------------------------- Label Value
{ "filepath": "src/Symfony/Component/Uid/Tests/Command/InspectUuidCommandTest.php", "language": "php", "file_size": 13149, "cut_index": 921, "middle_length": 229 }
GEX = '(?i:_?[A-Z][A-Z0-9_]*+)'; public const STATE_VARNAME = 0; public const STATE_VALUE = 1; private string $path; private int $cursor; private int $lineno; private string $data; private int $end; private array $values = []; private array $overriddenValues = []; private array ...
$this->prodEnvs = $prodEnvs; return $this; } /** * @param bool $usePutenv If `putenv()` should be used to define environment variables or not. * Beware that `putenv()` is not thread safe, that's why it
tion __construct( private string $envKey = 'APP_ENV', private string $debugKey = 'APP_DEBUG', ) { } /** * @return $this */ public function setProdEnvs(array $prodEnvs): static {
{ "filepath": "src/Symfony/Component/Dotenv/Dotenv.php", "language": "php", "file_size": 31617, "cut_index": 1331, "middle_length": 229 }
ony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Dotenv\Exception; /** * Thrown when a file has a syntax error. * * @author Fabien Potencier <fabien@symfony.com> */ final class FormatException...
ent::__construct(\sprintf("%s in \"%s\" at line %d.\n%s", $message, $context->getPath(), $context->getLineno(), $context->getDetails()), $code, $previous); } public function getContext(): FormatExceptionContext { return $this->context;
?\Throwable $previous = null, ) { par
{ "filepath": "src/Symfony/Component/Dotenv/Exception/FormatException.php", "language": "php", "file_size": 923, "cut_index": 606, "middle_length": 52 }
hp /* * 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\Dotenv\Exception; /** * @author Fabien Potencier <fabie...
{ $before = str_replace("\n", '\n', substr($this->data, max(0, $this->cursor - 20), min(20, $this->cursor))); $after = str_replace("\n", '\n', substr($this->data, $this->cursor, 20)); return '...'.$before.$after."...\n".str_re
e int $cursor, ) { } public function getPath(): string { return $this->path; } public function getLineno(): int { return $this->lineno; } public function getDetails(): string
{ "filepath": "src/Symfony/Component/Dotenv/Exception/FormatExceptionContext.php", "language": "php", "file_size": 1090, "cut_index": 515, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Dotenv\Command; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Completion\CompletionInput; use Symfony\Component\Console\Completion\CompletionSuggestions; use Symfony\Component...
de> */ #[AsCommand(name: 'debug:dotenv', description: 'List all dotenv files with variables and values')] final class DebugCommand extends Command { public function __construct( private string $kernelEnvironment, private string $projec
use Symfony\Component\Console\Style\SymfonyStyle; use Symfony\Component\Dotenv\Dotenv; /** * A console command to debug current dotenv files with variables and values. * * @author Christopher Hertel <mail@christopher-hertel.
{ "filepath": "src/Symfony/Component/Dotenv/Command/DebugCommand.php", "language": "php", "file_size": 7621, "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\Dotenv\Command; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\Input...
as a service, e.g in your services.yaml file: * * ```yaml * services: * # [...] * Symfony\Component\Dotenv\Command\DotenvDumpCommand: ~ * ``` */ #[Autoconfigure(bind: ['$projectDir' => '%kernel.project_dir%', '$defaultEn
dencyInjection\Attribute\Autoconfigure; use Symfony\Component\Dotenv\Dotenv; /** * A console command to compile .env files into a PHP-optimized file called .env.local.php. * * To use this command, first register it explicitly
{ "filepath": "src/Symfony/Component/Dotenv/Command/DotenvDumpCommand.php", "language": "php", "file_size": 4353, "cut_index": 614, "middle_length": 229 }
^ line 1 offset 8"], ['FOO=\'foo', "Missing quote to end the value in \".env\" at line 1.\n...FOO='foo...\n ^ line 1 offset 8"], ["FOO=\"foo\nBAR=\"bar\"", "Missing quote to end the value in \".env\" at line 1.\n...FOO=\"foo\\nBAR=\"bar\"...\n ^ line 1 offs...
fset 9"], ['FOO= BAR', "Whitespace are not supported before the value in \".env\" at line 1.\n...FOO= BAR...\n ^ line 1 offset 4"], ['Стасян', "Invalid character in variable name in \".env\" at line 1.\n...Стасян...\n ^ line 1
an environment variable in \".env\" at line 1.\n...export FOO...\n ^ line 1 offset 10"], ['FOO=${FOO', "Unclosed braces on variable expansion in \".env\" at line 1.\n...FOO=\${FOO...\n ^ line 1 of
{ "filepath": "src/Symfony/Component/Dotenv/Tests/DotenvTest.php", "language": "php", "file_size": 46268, "cut_index": 2151, "middle_length": 229 }
lication; use Symfony\Component\Console\Helper\FormatterHelper; use Symfony\Component\Console\Helper\HelperSet; use Symfony\Component\Console\Tester\CommandCompletionTester; use Symfony\Component\Console\Tester\CommandTester; use Symfony\Component\Dotenv\Command\DebugCommand; use Symfony\Component\Dotenv\Dotenv; class...
r->getDisplay(); $this->assertStringContainsString('[ERROR] Dotenv component is not initialized', $output); } #[RunInSeparateProcess] public function testEmptyDotEnvVarsList() { $_SERVER['SYMFONY_DOTENV_VARS'] = '';
new DebugCommand('dev', __DIR__.'/Fixtures/Scenario1'); $command->setHelperSet(new HelperSet([new FormatterHelper()])); $tester = new CommandTester($command); $tester->execute([]); $output = $teste
{ "filepath": "src/Symfony/Component/Dotenv/Tests/Command/DebugCommandTest.php", "language": "php", "file_size": 14092, "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\Dotenv\Tests\Command; use PHPUnit\Framework\TestCase; use Symfony\Component\Console\Application; use Symfony\Component\Console\Tester\CommandTester; use Sy...
<EOF APP_LOCAL=yes EOF ); } protected function tearDown(): void { @unlink(__DIR__.'/.env'); @unlink(__DIR__.'/.env.local'); @unlink(__DIR__.'/.env.path'); @unlink(__DIR__.'/.env.p
unset($_SERVER['APP_RUNTIME_OPTIONS']); file_put_contents(__DIR__.'/.env', <<<EOF APP_ENV=dev APP_SECRET=abc123 EOF ); file_put_contents(__DIR__.'/.env.local', <<
{ "filepath": "src/Symfony/Component/Dotenv/Tests/Command/DotenvDumpCommandTest.php", "language": "php", "file_size": 3718, "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\WebLink; use Psr\Link\EvolvableLinkProviderInterface; use Psr\Lin...
nks; } public function getLinks(): array { return array_values($this->links); } public function getLinksByRel(string $rel): array { $links = []; foreach ($this->links as $link) { if (\in_array(
terface[] $links */ public function __construct(array $links = []) { $that = $this; foreach ($links as $link) { $that = $that->withLink($link); } $this->links = $that->li
{ "filepath": "src/Symfony/Component/WebLink/GenericLinkProvider.php", "language": "php", "file_size": 1484, "cut_index": 524, "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\WebLink; use Psr\Link\EvolvableLinkProviderInterface; /** * Parse a list of HTTP Link headers into a l...
_PATTERN = '/;\s*([a-zA-Z0-9\-_]+)(?:\s*=\s*(?:"((?:[^"\\\\]|\\\\.)*)"|([^";,\s]+)))?/'; /** * @param string|string[] $headers Value of the "Link" HTTP header */ public function parse(string|array $headers): EvolvableLinkProviderInterfac
<...>; param1=...; param2=... private const LINK_PATTERN = '/<([^>]*)>\s*((?:\s*;\s*[a-zA-Z0-9\-_]+(?:\s*=\s*(?:"(?:[^"\\\\]|\\\\.)*"|[^";,\s]+))?)*)/'; // Regex to match parameters: ; key[=value] private const PARAM
{ "filepath": "src/Symfony/Component/WebLink/HttpHeaderParser.php", "language": "php", "file_size": 3004, "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\WebLink; use Psr\Link\LinkInterface; /** * Serializes a list of Link instanc...
k->isTemplated()) { continue; } $attributesParts = ['', \sprintf('rel="%s"', implode(' ', $link->getRels()))]; foreach ($link->getAttributes() as $key => $value) { if (\is_array($value))
e "Link" HTTP header. * * @param LinkInterface[]|\Traversable $links */ public function serialize(iterable $links): ?string { $elements = []; foreach ($links as $link) { if ($lin
{ "filepath": "src/Symfony/Component/WebLink/HttpHeaderSerializer.php", "language": "php", "file_size": 1751, "cut_index": 537, "middle_length": 229 }
k-relations/link-relations.xhtml public const REL_ABOUT = 'about'; public const REL_ACL = 'acl'; public const REL_ALTERNATE = 'alternate'; public const REL_AMPHTML = 'amphtml'; public const REL_APPENDIX = 'appendix'; public const REL_APPLE_TOUCH_ICON = 'apple-touch-icon'; public const REL_AP...
onst REL_CONTENTS = 'contents'; public const REL_CONVERTEDFROM = 'convertedfrom'; public const REL_COPYRIGHT = 'copyright'; public const REL_CREATE_FORM = 'create-form'; public const REL_CURRENT = 'current'; public const REL_DESCRIBEDBY
ublic const REL_BOOKMARK = 'bookmark'; public const REL_CANONICAL = 'canonical'; public const REL_CHAPTER = 'chapter'; public const REL_CITE_AS = 'cite-as'; public const REL_COLLECTION = 'collection'; public c
{ "filepath": "src/Symfony/Component/WebLink/Link.php", "language": "php", "file_size": 9508, "cut_index": 921, "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\WebLink\EventListener; use Psr\Link\LinkProviderInterface; use Symfony\Compone...
dLinkHeaderListener implements EventSubscriberInterface { public function __construct( private readonly HttpHeaderSerializer $serializer = new HttpHeaderSerializer(), ) { } public function onKernelResponse(ResponseEvent $event): vo
izer; // Help opcache.preload discover always-needed symbols class_exists(HttpHeaderSerializer::class); /** * Adds the Link HTTP header to the response. * * @author Kévin Dunglas <dunglas@gmail.com> * * @final */ class Ad
{ "filepath": "src/Symfony/Component/WebLink/EventListener/AddLinkHeaderListener.php", "language": "php", "file_size": 1547, "cut_index": 537, "middle_length": 229 }
riableCount; private ?\SplObjectStorage $inlinedDefinitions = null; private ?array $serviceCalls = null; private array $reservedVariables = ['instance', 'class', 'this', 'container']; private ExpressionLanguage $expressionLanguage; private ?string $targetDirRegex = null; private int $targetDirMa...
UsePrivateIds = []; private array $preload = []; private bool $addGetService = false; private array $locatedIds = []; private string $serviceLocatorTag; private array $exportedVariables = []; private array $dynamicParameters = [];
ring $hotPathTag; private array $preloadTags; private bool $inlineFactories; private bool $inlineRequires; private array $inlinedRequires = []; private array $circularReferences = []; private array $single
{ "filepath": "src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php", "language": "php", "file_size": 104226, "cut_index": 3790, "middle_length": 229 }
nt; use Symfony\Component\DependencyInjection\Argument\ArgumentInterface; use Symfony\Component\DependencyInjection\Argument\EnvClosureArgument; use Symfony\Component\DependencyInjection\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; use Symfony\Component\Dependenc...
ter; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\ExpressionLanguage\Expression; use Symfony\Component\Yaml\Dumper as YmlDumper; use Symfony\Component\Yaml\Parser; use Symfony\Component\Yaml\Tag\TaggedValue; use Symfony\Compon
\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\LogicException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Parame
{ "filepath": "src/Symfony/Component/DependencyInjection/Dumper/YamlDumper.php", "language": "php", "file_size": 15110, "cut_index": 921, "middle_length": 229 }
ment\TaggedIteratorArgument; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Parameter; use Symfony\Component\DependencyInjection\Reference;...
xml version="1.0" encoding="utf-8"?> <container xmlns="http://symfony.com/schema/dic/services" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://symfony.com/schema/dic/services https://symfony.com/schema/dic/servi
<martin.hason@gmail.com> */ class XmlDumper extends Dumper { /** * Dumps the service container as an XML string. */ public function dump(array $options = []): string { $xml = <<<EOXML <?
{ "filepath": "src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php", "language": "php", "file_size": 19946, "cut_index": 1331, "middle_length": 229 }
ackage. * * (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\Uid; if (interface_exists(\Ds\Key::class)) { /** * @internal */ interface Hashable...
ce extends \Ds\Hashable { public function hash(): string; } } else { /** * @internal */ interface HashableInterface { public function equals(mixed $other): bool; public function hash(): string; } }
* @internal */ interface HashableInterfa
{ "filepath": "src/Symfony/Component/Uid/HashableInterface.php", "language": "php", "file_size": 868, "cut_index": 559, "middle_length": 52 }
buted with this source code. */ namespace Symfony\Component\Uid; use Symfony\Component\Uid\Exception\InvalidArgumentException; /** * @author Grégoire Pineau <lyrixx@lyrixx.info> * * @see https://datatracker.ietf.org/doc/html/rfc9562/#section-6.6 for details about namespaces */ class Uuid extends AbstractUid { ...
ic const FORMAT_RFC_4122 = 1 << 3; public const FORMAT_RFC_9562 = self::FORMAT_RFC_4122; public const FORMAT_ALL = -1; protected const TYPE = 0; protected const NIL = '00000000-0000-0000-0000-000000000000'; protected const MAX = 'fffff
-11d1-80b4-00c04fd430c8'; public const NAMESPACE_X500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8'; public const FORMAT_BINARY = 1; public const FORMAT_BASE_32 = 1 << 1; public const FORMAT_BASE_58 = 1 << 2; publ
{ "filepath": "src/Symfony/Component/Uid/Uuid.php", "language": "php", "file_size": 7492, "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\Uid; use Symfony\Component\Uid\Exception\InvalidArgumentException; use Symfony\Component\Uid\Exception\LogicException; /** * Converts between UUIDv7 and ...
del: this is timestamp obfuscation, not authenticated encryption. * The transformation carries no integrity tag, so any well-formed v4 will * decode to some v7; callers must not treat decoded values as authentic and * should validate them against applic
. * * The 48-bit timestamp of a UUIDv7 is XOR-masked with a keyed SipHash-2-4 * digest derived from the UUID's own random bits, producing a valid UUIDv4. * The transformation is reversible with the same key. * * Security mo
{ "filepath": "src/Symfony/Component/Uid/Uuid47Transformer.php", "language": "php", "file_size": 4594, "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\Uid; use Symfony\Component\Uid\Exception\InvalidArgumentException; /** * A v6 UUID is lexicographically sortable and contains a 60-bit timestamp and 62 e...
} else { parent::__construct($uuid, true); } } public function getDateTime(): \DateTimeImmutable { return BinaryUtil::hexToDateTime('0'.substr($this->uid, 0, 8).substr($this->uid, 9, 4).substr($this->uid, 15
ents TimeBasedUidInterface { protected const TYPE = 6; private static string $node; public function __construct(?string $uuid = null) { if (null === $uuid) { $this->uid = static::generate();
{ "filepath": "src/Symfony/Component/Uid/UuidV6.php", "language": "php", "file_size": 3142, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Uid; use Symfony\Component\Uid\Exception\InvalidArgumentException; /** * A v7 UUID is lexicographically sortable and contains a 58-bit timestamp and 64 extra unique bits. * * Within the same millisecond, the unique bits are incremented by a 24-bit rando...
rivate static string $seed; private static array $seedParts; private static int $seedIndex = 0; public function __construct(?string $uuid = null) { if (null === $uuid) { $this->uid = static::generate(); } else {
s <p@tchwork.com> */ class UuidV7 extends Uuid implements TimeBasedUidInterface { protected const TYPE = 7; private static string $time = ''; private static int $subMs = 0; private static array $rand = []; p
{ "filepath": "src/Symfony/Component/Uid/UuidV7.php", "language": "php", "file_size": 6336, "cut_index": 716, "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\LazyProxy\PhpDumper; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\De...
mper() { $dumper = new NullDumper(); $definition = new Definition('stdClass'); $this->assertFalse($dumper->isProxyCandidate($definition)); $this->assertSame('', $dumper->getProxyFactoryCode($definition, 'foo', '(false)'
st extends TestCase { public function testNullDu
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/LazyProxy/PhpDumper/NullDumperTest.php", "language": "php", "file_size": 969, "cut_index": 582, "middle_length": 52 }
<?php /* * 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\LazyProxy\Instantiator; use...
y() { $instantiator = new RealServiceInstantiator(); $instance = new \stdClass(); $callback = static fn () => $instance; $this->assertSame($instance, $instantiator->instantiateProxy(new Container(), new Definition(), 'f
antiator\RealServiceInstantiator; /** * Tests for {@see RealServiceInstantiator}. * * @author Marco Pivetta <ocramius@gmail.com> */ class RealServiceInstantiatorTest extends TestCase { public function testInstantiateProx
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/LazyProxy/Instantiator/RealServiceInstantiatorTest.php", "language": "php", "file_size": 1023, "cut_index": 512, "middle_length": 229 }
nent\DependencyInjection\Tests\Compiler\Listener2; use Symfony\Component\DependencyInjection\Tests\Compiler\ListenerResolver; use Symfony\Component\DependencyInjection\Tests\Compiler\MyCallable; use Symfony\Component\DependencyInjection\Tests\Compiler\MyFactory; use Symfony\Component\DependencyInjection\Tests\Compiler\...
sts\Fixtures\DependencyContainerInterface; use Symfony\Component\DependencyInjection\Tests\Fixtures\FooClassWithEnumAttribute; use Symfony\Component\DependencyInjection\Tests\Fixtures\FooUnitEnum; use Symfony\Component\DependencyInjection\Tests\Fixtures\Fo
cyInjection\Tests\Fixtures\Bar; use Symfony\Component\DependencyInjection\Tests\Fixtures\CustomDefinition; use Symfony\Component\DependencyInjection\Tests\Fixtures\DependencyContainer; use Symfony\Component\DependencyInjection\Te
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php", "language": "php", "file_size": 110940, "cut_index": 3790, "middle_length": 229 }
\Attributes\IgnoreDeprecations; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInjection\Argument\AbstractArgument; use Symfony\Component\DependencyInjection\Argument\EnvClosureArgument; use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument; use Symfony\Component\DependencyInjection...
Component\DependencyInjection\Tests\Fixtures\FooClassWithDefaultArrayAttribute; use Symfony\Component\DependencyInjection\Tests\Fixtures\FooClassWithDefaultEnumAttribute; use Symfony\Component\DependencyInjection\Tests\Fixtures\FooClassWithDefaultObjectAtt
ent\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Dumper\XmlDumper; use Symfony\Component\DependencyInjection\Reference; use Symfony\
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Dumper/XmlDumperTest.php", "language": "php", "file_size": 16517, "cut_index": 921, "middle_length": 229 }
ony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Config; use Symfony\Component\Config\Resource\ResourceInterface; /** * Tracks container parameters. * * @author Maxime Stei...
private array $parameters, ) { } public function __toString(): string { return 'container_parameters_'.hash('xxh128', serialize($this->parameters)); } public function getParameters(): array { return $this->pa
rack */ public function __construct(
{ "filepath": "src/Symfony/Component/DependencyInjection/Config/ContainerParametersResource.php", "language": "php", "file_size": 932, "cut_index": 606, "middle_length": 52 }
buted with this source code. */ namespace Symfony\Component\DependencyInjection\LazyProxy\PhpDumper; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; use Symfony\Component\VarExporter\Exception\LogicException; use Symfony\Component\Va...
if (!$definition->isLazy()) { throw new InvalidArgumentException(\sprintf('Invalid definition for service "%s": setting the "proxy" tag on a service requires it to be "lazy".', $id ?? $definition->getClass())); }
lt = '', ) { } public function isProxyCandidate(Definition $definition, ?bool &$asGhostObject = null, ?string $id = null): bool { $asGhostObject = false; if ($definition->hasTag('proxy')) {
{ "filepath": "src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/LazyServiceDumper.php", "language": "php", "file_size": 6639, "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\LazyProxy\Instantiator; use Symfony\Component\DependencyIn...
-callable $realInstantiator * * @param string $id Identifier of the requested service * @param (callable(): object)|(callable(object): void) $realInstantiator A callback that creates or in
s and a callback that produces the real service instance. * * @author Marco Pivetta <ocramius@gmail.com> */ interface InstantiatorInterface { /** * Instantiates a proxy object. * * @param-immediately-invoked
{ "filepath": "src/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/InstantiatorInterface.php", "language": "php", "file_size": 1607, "cut_index": 537, "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\LazyProxy\Instantiator; use Symfony\Component\DependencyIn...
stantiator */ public function instantiateProxy(ContainerInterface $container, Definition $definition, string $id, callable $realInstantiator): object { $dumper = new LazyServiceDumper(); if (!$dumper->isProxyCandidate($definit
Injection\LazyProxy\PhpDumper\LazyServiceDumper; /** * @author Nicolas Grekas <p@tchwork.com> */ final class LazyServiceInstantiator implements InstantiatorInterface { /** * @param-immediately-invoked-callable $realIn
{ "filepath": "src/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/LazyServiceInstantiator.php", "language": "php", "file_size": 1771, "cut_index": 537, "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\Dumper; /** * @author Nicolas Grekas <p@tchwork.com> */ final class Preloader { public static function append(string $file, array...
acheDir)), \DIRECTORY_SEPARATOR, '/'), true)), \FILE_APPEND); continue; } $classes[] = \sprintf("\$classes[] = %s;\n", var_export($item, true)); } file_put_contents($file, \sprintf("\n\$classes = []
$classes = []; foreach ($list as $item) { if (str_starts_with($item, $cacheDir)) { file_put_contents($file, \sprintf("require_once __DIR__.%s;\n", var_export(strtr(substr($item, \strlen($c
{ "filepath": "src/Symfony/Component/DependencyInjection/Dumper/Preloader.php", "language": "php", "file_size": 4057, "cut_index": 614, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Uid; use Symfony\Component\Uid\Exception\InvalidArgumentException; /** * @internal * * @author Nicolas Grekas <p@tchwork.com> */ class BinaryUtil { public const BASE10 = [ '' => '0123456789', 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ]; ...
31, 'Z' => 32, 'a' => 33, 'b' => 34, 'c' => 35, 'd' => 36, 'e' => 37, 'f' => 38, 'g' => 39, 'h' => 40, 'i' => 41, 'j' => 42, 'k' => 43, 'm' => 44, 'n' => 45, 'o' => 46, 'p' => 47, 'q' => 48, 'r' => 49, 's' => 50, 't' => 51,
'E' => 13, 'F' => 14, 'G' => 15, 'H' => 16, 'J' => 17, 'K' => 18, 'L' => 19, 'M' => 20, 'N' => 21, 'P' => 22, 'Q' => 23, 'R' => 24, 'S' => 25, 'T' => 26, 'U' => 27, 'V' => 28, 'W' => 29, 'X' => 30, 'Y' =>
{ "filepath": "src/Symfony/Component/Uid/BinaryUtil.php", "language": "php", "file_size": 6726, "cut_index": 716, "middle_length": 229 }
p and 80-bit of crypto-random entropy. * * @see https://github.com/ulid/spec * * @author Nicolas Grekas <p@tchwork.com> */ class Ulid extends AbstractUid implements TimeBasedUidInterface { public const FORMAT_BINARY = 1; public const FORMAT_BASE_32 = 1 << 1; public const FORMAT_BASE_58 = 1 << 2; pu...
$this->uid = static::generate(); } elseif (self::NIL === $ulid) { $this->uid = self::NIL; } else { $this->uid = strtoupper($ulid); if (self::MAX === $this->uid) { $this->uid = self::MAX;
otected const MAX = '7ZZZZZZZZZZZZZZZZZZZZZZZZZ'; private static string $time = ''; private static array $rand = []; public function __construct(?string $ulid = null) { if (null === $ulid) {
{ "filepath": "src/Symfony/Component/Uid/Ulid.php", "language": "php", "file_size": 9992, "cut_index": 921, "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\Uid; /** * A v4 UUID contains a 122-bit random number. * * @au...
/ xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx $uuid[8] = $uuid[13] = $uuid[18] = $uuid[23] = '-'; // Set the UUID version to 4 // xxxxxxxx-xxxx-4xxx-xxxx-xxxxxxxxxxxx $uuid[14] = '4'; // Set the UUID var
{ // Generate 36 random hex characters (144 bits) // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $uuid = bin2hex(random_bytes(18)); // Insert dashes to match the UUID format /
{ "filepath": "src/Symfony/Component/Uid/UuidV4.php", "language": "php", "file_size": 1357, "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\Tests\LazyProxy\Instantiator; use PHPUnit\Fra...
iator = new LazyServiceInstantiator(); $instance = new class extends AbstractSayClass { public int $calls = 0; public function say(): string { ++$this->calls; return 'Hello from
yServiceInstantiator; use Symfony\Component\DependencyInjection\Tests\Fixtures\AbstractSayClass; class LazyServiceInstantiatorTest extends TestCase { public function testInstantiateAbstractClassProxy() { $instant
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/LazyProxy/Instantiator/LazyServiceInstantiatorTest.php", "language": "php", "file_size": 1446, "cut_index": 524, "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\Dumper; use PHPUnit\Framework\TestCase; use Symfony\Component\DependencyInject...
s\Preload\DummyWithInterface; use Symfony\Component\DependencyInjection\Tests\Fixtures\Preload\E; use Symfony\Component\DependencyInjection\Tests\Fixtures\Preload\F; use Symfony\Component\DependencyInjection\Tests\Fixtures\Preload\G; use Symfony\Component\
jection\Tests\Fixtures\Preload\C; use Symfony\Component\DependencyInjection\Tests\Fixtures\Preload\D; use Symfony\Component\DependencyInjection\Tests\Fixtures\Preload\Dummy; use Symfony\Component\DependencyInjection\Tests\Fixture
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Dumper/PreloaderTest.php", "language": "php", "file_size": 3001, "cut_index": 563, "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\LazyProxy\PhpDumper; use Symfony\Component\De...
is a ghost object */ public function isProxyCandidate(Definition $definition, ?bool &$asGhostObject = null, ?string $id = null): bool; /** * Generates the code to be used to instantiate a proxy in the dumped factory code. */ pub
ace DumperInterface { /** * Inspects whether the given definitions should produce proxy instantiation logic in the dumped container. * * @param bool|null &$asGhostObject Set to true after the call if the proxy
{ "filepath": "src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php", "language": "php", "file_size": 1259, "cut_index": 524, "middle_length": 229 }
ntainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; use Symfony\Component\DependencyInjection\Parameter; use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag; use Symfony\Component\DependencyInjection\Refere...
[ 'graph' => ['ratio' => 'compress'], 'node' => ['fontsize' => '11', 'fontname' => 'Arial', 'shape' => 'record'], 'edge' => ['fontsize' => '9', 'fontname' => 'Arial', 'color' => 'grey', 'arrowhead' => 'open', 'arrowsize' => '0.5'],
ner.dot > foo.png * * @author Fabien Potencier <fabien@symfony.com> */ class GraphvizDumper extends Dumper { private array $nodes; private array $edges; // All values should be strings private array $options =
{ "filepath": "src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php", "language": "php", "file_size": 9278, "cut_index": 921, "middle_length": 229 }
buted with this source code. */ namespace Symfony\Component\Uid; use Symfony\Component\Uid\Exception\InvalidArgumentException; /** * @author Nicolas Grekas <p@tchwork.com> */ abstract class AbstractUid implements \JsonSerializable, \Stringable, HashableInterface { /** * The identifier in its canonic repr...
ic static function fromString(string $uid): static; /** * @throws InvalidArgumentException When the passed value is not valid */ public static function fromBinary(string $uid): static { if (16 !== \strlen($uid)) {
tring $uid): bool; /** * Creates an AbstractUid from an identifier represented in any of the supported formats. * * @throws InvalidArgumentException When the passed value is not valid */ abstract publ
{ "filepath": "src/Symfony/Component/Uid/AbstractUid.php", "language": "php", "file_size": 5679, "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\LazyProxy\PhpDumper; use PHPUnit\Framework\TestCase; use Psr\Container\ContainerInterface; use Symfony\Component\DependencyInject...
$dumper = new LazyServiceDumper(); $definition = (new Definition(ContainerInterface::class))->setLazy(true); $this->assertTrue($dumper->isProxyCandidate($definition)); $this->assertStringContainsString('function get(', $dumper-
nent\DependencyInjection\Tests\Fixtures\AbstractSayClass; use Symfony\Component\DependencyInjection\Tests\Fixtures\ReadOnlyClass; class LazyServiceDumperTest extends TestCase { public function testProxyInterface() {
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/LazyProxy/PhpDumper/LazyServiceDumperTest.php", "language": "php", "file_size": 3053, "cut_index": 614, "middle_length": 229 }
\Attributes\IgnoreDeprecations; use PHPUnit\Framework\TestCase; use Symfony\Component\Config\FileLocator; use Symfony\Component\DependencyInjection\Argument\AbstractArgument; use Symfony\Component\DependencyInjection\Argument\EnvClosureArgument; use Symfony\Component\DependencyInjection\Argument\ServiceClosureArgument;...
ncyInjection\Dumper\YamlDumper; use Symfony\Component\DependencyInjection\Loader\YamlFileLoader; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\Tests\Fixtures\FooClassWithDefaultArrayAttribute; use Symfony\Co
\Compiler\AutowirePass; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\Depende
{ "filepath": "src/Symfony/Component/DependencyInjection/Tests/Dumper/YamlDumperTest.php", "language": "php", "file_size": 12779, "cut_index": 921, "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\LazyProxy\PhpDumper; use Symfony\Component\DependencyInjection\Definition; /** * Null dumper, negates...
GhostObject = null, ?string $id = null): bool { return $asGhostObject = false; } public function getProxyFactoryCode(Definition $definition, string $id, string $factoryCode): string { return ''; } public function g
isProxyCandidate(Definition $definition, ?bool &$as
{ "filepath": "src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/NullDumper.php", "language": "php", "file_size": 987, "cut_index": 582, "middle_length": 52 }