AbstractProviderFactory.php
1 month ago
Dsn.php
1 month ago
FilteringProvider.php
1 month ago
NullProvider.php
2 years ago
NullProviderFactory.php
2 years ago
ProviderFactoryInterface.php
2 years ago
ProviderInterface.php
2 years ago
TranslationProviderCollection.php
2 years ago
TranslationProviderCollectionFactory.php
1 month ago
NullProviderFactory.php
32 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 IAWPSCOPED\Symfony\Component\Translation\Provider; |
| 12 | |
| 13 | use IAWPSCOPED\Symfony\Component\Translation\Exception\UnsupportedSchemeException; |
| 14 | /** |
| 15 | * @author Mathieu Santostefano <msantostefano@protonmail.com> |
| 16 | * @internal |
| 17 | */ |
| 18 | final class NullProviderFactory extends AbstractProviderFactory |
| 19 | { |
| 20 | public function create(Dsn $dsn) : ProviderInterface |
| 21 | { |
| 22 | if ('null' === $dsn->getScheme()) { |
| 23 | return new NullProvider(); |
| 24 | } |
| 25 | throw new UnsupportedSchemeException($dsn, 'null', $this->getSupportedSchemes()); |
| 26 | } |
| 27 | protected function getSupportedSchemes() : array |
| 28 | { |
| 29 | return ['null']; |
| 30 | } |
| 31 | } |
| 32 |