1
0
mirror of https://github.com/Rudloff/alltube.git synced 2024-06-28 07:40:53 +02:00
alltube/classes/Factory/LocaleManagerFactory.php
2020-10-21 22:48:05 +02:00

30 lines
610 B
PHP

<?php
namespace Alltube\Factory;
use Alltube\Exception\DependencyException;
use Alltube\LocaleManager;
use Slim\Container;
/**
* Class LocaleManagerFactory
* @package Alltube
*/
class LocaleManagerFactory
{
/**
* @param Container $container
* @return LocaleManager|null
* @throws DependencyException
*/
public static function create(Container $container)
{
if (!class_exists('Locale')) {
throw new DependencyException('You need to install the intl extension for PHP.');
}
return new LocaleManager($container->get('session'));
}
}