PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / vendor_prefixed / symfony / dependency-injection / Argument / ServiceLocator.php

ServiceLocator.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI trunk, at vendor_prefixed/symfony/dependency-injection/Argument/ServiceLocator.php

50 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <[email protected]>
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 YoastSEO_Vendor\Symfony\Component\DependencyInjection\Argument;
12
13 use YoastSEO_Vendor\Symfony\Component\DependencyInjection\ServiceLocator as BaseServiceLocator;
14 /**
15 * @author Nicolas Grekas <[email protected]>
16 *
17 * @internal
18 */
19 class ServiceLocator extends \YoastSEO_Vendor\Symfony\Component\DependencyInjection\ServiceLocator
20 {
21 private $factory;
22 private $serviceMap;
23 private $serviceTypes;
24 public function __construct(\Closure $factory, array $serviceMap, ?array $serviceTypes = null)
25 {
26 $this->factory = $factory;
27 $this->serviceMap = $serviceMap;
28 $this->serviceTypes = $serviceTypes;
29 parent::__construct($serviceMap);
30 }
31 /**
32 * {@inheritdoc}
33 *
34 * @return mixed
35 */
36 public function get(string $id)
37 {
38 return isset($this->serviceMap[$id]) ? ($this->factory)(...$this->serviceMap[$id]) : parent::get($id);
39 }
40 /**
41 * {@inheritdoc}
42 */
43 public function getProvidedServices() : array
44 {
45 return $this->serviceTypes ?? ($this->serviceTypes = \array_map(function () {
46 return '?';
47 }, $this->serviceMap));
48 }
49 }
50