PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / trunk
Matomo Analytics – Powerful, Privacy-First Insights for WordPress vtrunk
5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / vendor / prefixed / symfony / http-kernel / DependencyInjection / ResettableServicePass.php
matomo / app / vendor / prefixed / symfony / http-kernel / DependencyInjection Last commit date
AddAnnotatedClassesToCachePass.php 1 year ago ConfigurableExtension.php 2 years ago ControllerArgumentValueResolverPass.php 2 years ago Extension.php 2 years ago FragmentRendererPass.php 1 year ago LazyLoadingFragmentHandler.php 1 year ago LoggerPass.php 1 year ago MergeExtensionConfigurationPass.php 2 years ago RegisterControllerArgumentLocatorsPass.php 1 year ago RegisterLocaleAwareServicesPass.php 2 years ago RemoveEmptyControllerArgumentLocatorsPass.php 1 year ago ResettableServicePass.php 1 year ago ServicesResetter.php 2 years ago
ResettableServicePass.php
64 lines
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 namespace Matomo\Dependencies\Symfony\Component\HttpKernel\DependencyInjection;
12
13 use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
14 use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
15 use Symfony\Component\DependencyInjection\ContainerBuilder;
16 use Symfony\Component\DependencyInjection\ContainerInterface;
17 use Symfony\Component\DependencyInjection\Exception\RuntimeException;
18 use Symfony\Component\DependencyInjection\Reference;
19 /**
20 * @author Alexander M. Turek <me@derrabus.de>
21 */
22 class ResettableServicePass implements CompilerPassInterface
23 {
24 private $tagName;
25 public function __construct(string $tagName = 'kernel.reset')
26 {
27 if (0 < \func_num_args()) {
28 trigger_deprecation('symfony/http-kernel', '5.3', 'Configuring "%s" is deprecated.', __CLASS__);
29 }
30 $this->tagName = $tagName;
31 }
32 /**
33 * {@inheritdoc}
34 */
35 public function process(ContainerBuilder $container)
36 {
37 if (!$container->has('services_resetter')) {
38 return;
39 }
40 $services = $methods = [];
41 foreach ($container->findTaggedServiceIds($this->tagName, \true) as $id => $tags) {
42 $services[$id] = new Reference($id, ContainerInterface::IGNORE_ON_UNINITIALIZED_REFERENCE);
43 foreach ($tags as $attributes) {
44 if (!isset($attributes['method'])) {
45 throw new RuntimeException(sprintf('Tag "%s" requires the "method" attribute to be set.', $this->tagName));
46 }
47 if (!isset($methods[$id])) {
48 $methods[$id] = [];
49 }
50 if ('ignore' === ($attributes['on_invalid'] ?? null)) {
51 $attributes['method'] = '?' . $attributes['method'];
52 }
53 $methods[$id][] = $attributes['method'];
54 }
55 }
56 if (!$services) {
57 $container->removeAlias('services_resetter');
58 $container->removeDefinition('services_resetter');
59 return;
60 }
61 $container->findDefinition('services_resetter')->setArgument(0, new IteratorArgument($services))->setArgument(1, $methods);
62 }
63 }
64