Proyectos de Subversion Moodle

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1441 ariadna 1
<?php
2
 
3
/**
4
 * Slim Framework (https://slimframework.com)
5
 *
6
 * @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License)
7
 */
8
 
9
declare(strict_types=1);
10
 
11
namespace Slim\Factory\Psr17;
12
 
13
use Slim\Interfaces\Psr17FactoryProviderInterface;
14
 
15
use function array_unshift;
16
 
17
class Psr17FactoryProvider implements Psr17FactoryProviderInterface
18
{
19
    /**
20
     * @var string[]
21
     */
22
    protected static array $factories = [
23
        SlimPsr17Factory::class,
24
        HttpSoftPsr17Factory::class,
25
        NyholmPsr17Factory::class,
26
        LaminasDiactorosPsr17Factory::class,
27
        GuzzlePsr17Factory::class,
28
    ];
29
 
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public static function getFactories(): array
34
    {
35
        return static::$factories;
36
    }
37
 
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public static function setFactories(array $factories): void
42
    {
43
        static::$factories = $factories;
44
    }
45
 
46
    /**
47
     * {@inheritdoc}
48
     */
49
    public static function addFactory(string $factory): void
50
    {
51
        array_unshift(static::$factories, $factory);
52
    }
53
}