|
| 1 | +Array |
| 2 | +( |
| 3 | + [Container%s/removed-ids.php] => <?php |
| 4 | + |
| 5 | +namespace Container%s; |
| 6 | + |
| 7 | +return [ |
| 8 | + 'Bar' => true, |
| 9 | + 'stdClass' => true, |
| 10 | +]; |
| 11 | + |
| 12 | + [Container%s/ProjectServiceContainer.php] => <?php |
| 13 | + |
| 14 | +namespace Container%s; |
| 15 | + |
| 16 | +use Symfony\Component\DependencyInjection\Argument\RewindableGenerator; |
| 17 | +use Symfony\Component\DependencyInjection\ContainerInterface; |
| 18 | +use Symfony\Component\DependencyInjection\Container; |
| 19 | +use Symfony\Component\DependencyInjection\Exception\LogicException; |
| 20 | +use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; |
| 21 | +use Symfony\Component\DependencyInjection\Exception\RuntimeException; |
| 22 | +use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag; |
| 23 | +use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface; |
| 24 | + |
| 25 | +/** |
| 26 | + * @internal This class has been auto-generated by the Symfony Dependency Injection Component. |
| 27 | + */ |
| 28 | +class ProjectServiceContainer extends Container |
| 29 | +{ |
| 30 | + protected $targetDir; |
| 31 | + protected $parameters = []; |
| 32 | + protected readonly \WeakReference $ref; |
| 33 | + |
| 34 | + public function __construct(private array $buildParameters = [], protected string $containerDir = __DIR__) |
| 35 | + { |
| 36 | + $this->ref = \WeakReference::create($this); |
| 37 | + $this->targetDir = \dirname($containerDir); |
| 38 | + $this->services = $this->privates = []; |
|
F438
39 | + $this->methodMap = [ |
| 40 | + 'foo' => 'getFooService', |
| 41 | + ]; |
| 42 | + |
| 43 | + $this->aliases = []; |
| 44 | + } |
| 45 | + |
| 46 | + public function compile(): void |
| 47 | + { |
| 48 | + throw new LogicException('You cannot compile a dumped container that was already compiled.'); |
| 49 | + } |
| 50 | + |
| 51 | + public function isCompiled(): bool |
| 52 | + { |
| 53 | + return true; |
| 54 | + } |
| 55 | + |
| 56 | + public function getRemovedIds(): array |
| 57 | + { |
| 58 | + return require $this->containerDir.\DIRECTORY_SEPARATOR.'removed-ids.php'; |
| 59 | + } |
| 60 | + |
| 61 | + /** |
| 62 | + * Gets the public 'foo' service. |
| 63 | + * |
| 64 | + * @return \Symfony\Component\DependencyInjection\Tests\Dumper\FooClass |
| 65 | + */ |
| 66 | + protected static function getFooService($container) |
| 67 | + { |
| 68 | + $containerRef = $container->ref; |
| 69 | + |
| 70 | + $container->factories['foo'] = function ($container) use ($containerRef) { |
| 71 | + $instance = new \Symfony\Component\DependencyInjection\Tests\Dumper\FooClass(); |
| 72 | + |
| 73 | + $instance->setOtherInstances(new RewindableGenerator(function () use ($containerRef) { |
| 74 | + $container = $containerRef->get(); |
| 75 | + |
| 76 | + yield 0 => ($container->privates['Bar'] ??= new \Bar()); |
| 77 | + yield 1 => ($container->privates['stdClass'] ??= new \stdClass()); |
| 78 | + }, 2)); |
| 79 | + |
| 80 | + return $instance; |
| 81 | + }; |
| 82 | + |
| 83 | + return $container->factories['foo']($container); |
| 84 | + } |
| 85 | +} |
| 86 | + |
| 87 | + [ProjectServiceContainer.preload.php] => <?php |
| 88 | + |
| 89 | +// This file has been auto-generated by the Symfony Dependency Injection Component |
| 90 | +// You can reference it in the "opcache.preload" php.ini setting on PHP >= 7.4 when preloading is desired |
| 91 | + |
| 92 | +use Symfony\Component\DependencyInjection\Dumper\Preloader; |
| 93 | + |
| 94 | +if (in_array(PHP_SAPI, ['cli', 'phpdbg'], true)) { |
| 95 | + return; |
| 96 | +} |
| 97 | + |
| 98 | +require dirname(__DIR__, %d).'/vendor/autoload.php'; |
| 99 | +(require __DIR__.'/ProjectServiceContainer.php')->set(\Container%s\ProjectServiceContainer::class, null); |
| 100 | + |
| 101 | +$classes = []; |
| 102 | +$classes[] = 'Bar'; |
| 103 | +$classes[] = 'Symfony\Component\DependencyInjection\Tests\Dumper\FooClass'; |
| 104 | +$classes[] = 'Symfony\Component\DependencyInjection\ContainerInterface'; |
| 105 | + |
| 106 | +$preloaded = Preloader::preload($classes); |
| 107 | + |
| 108 | + [ProjectServiceContainer.php] => <?php |
| 109 | + |
| 110 | +// This file has been auto-generated by the Symfony Dependency Injection Component for internal use. |
| 111 | + |
| 112 | +if (\class_exists(\Container%s\ProjectServiceContainer::class, false)) { |
| 113 | + // no-op |
| 114 | +} elseif (!include __DIR__.'/Container%s/ProjectServiceContainer.php') { |
| 115 | + touch(__DIR__.'/Container%s.legacy'); |
| 116 | + |
| 117 | + return; |
| 118 | +} |
| 119 | + |
| 120 | +if (!\class_exists(ProjectServiceContainer::class, false)) { |
| 121 | + \class_alias(\Container%s\ProjectServiceContainer::class, ProjectServiceContainer::class, false); |
| 122 | +} |
| 123 | + |
| 124 | +return new \Container%s\ProjectServiceContainer([ |
| 125 | + 'container.build_hash' => '%s', |
| 126 | + 'container.build_id' => '3f6e2bc2', |
| 127 | + 'container.build_time' => 1563381341, |
| 128 | +], __DIR__.\DIRECTORY_SEPARATOR.'Container%s'); |
| 129 | + |
| 130 | +) |
0 commit comments