alltube/classes/Factory/LocaleManagerFactory.php

28 lines
509 B
PHP
Raw Normal View History

<?php
2020-10-20 23:29:50 +02:00
namespace Alltube\Factory;
use Alltube\Exception\DependencyException;
2020-10-20 23:29:50 +02:00
use Alltube\LocaleManager;
/**
* Class LocaleManagerFactory
* @package Alltube
*/
class LocaleManagerFactory
{
/**
* @return LocaleManager|null
* @throws DependencyException
*/
public static function create()
{
if (!class_exists('Locale')) {
throw new DependencyException('You need to install the intl extension for PHP.');
}
return new LocaleManager();
}
}