Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
loader_resolver
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 2
20
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 resolve
0.00% covered (danger)
0.00%
0 / 5
0.00% covered (danger)
0.00%
0 / 1
12
1<?php
2/**
3*
4* This file is part of the phpBB Forum Software package.
5*
6* @copyright (c) phpBB Limited <https://www.phpbb.com>
7* @license       GNU General Public License, version 2 (GPL-2.0)
8*
9* For full copyright and license information, please see
10* the docs/CREDITS.txt file.
11*
12*/
13
14namespace phpbb\routing;
15
16use Symfony\Component\Config\Loader\LoaderResolverInterface;
17
18/**
19 * @see Symfony\Component\Config\Loader\LoaderResolver
20 */
21class loader_resolver implements LoaderResolverInterface
22{
23    /**
24     * @var \Symfony\Component\Config\Loader\LoaderInterface[] An array of LoaderInterface objects
25     */
26    protected $loaders = [];
27
28    public function __construct($loaders = [])
29    {
30        $this->loaders = $loaders;
31    }
32
33    /**
34     * {@inheritdoc}
35     */
36    public function resolve($resource, $type = null): false|\Symfony\Component\Config\Loader\LoaderInterface
37    {
38        /** @var \Symfony\Component\Config\Loader\LoaderInterface $loader */
39        foreach ($this->loaders as $loader)
40        {
41            if ($loader->supports($resource, $type))
42            {
43                $loader->setResolver($this);
44                return $loader;
45            }
46        }
47
48        return false;
49    }
50}