[String] Added a help message when translation-contracts is not installed

This commit is contained in:
Grégoire Pineau 2020-07-07 11:07:44 +02:00 committed by Nicolas Grekas
parent e8fb0d133e
commit 904fb1ae21

View File

@ -15,6 +15,10 @@ use Symfony\Component\String\AbstractUnicodeString;
use Symfony\Component\String\UnicodeString;
use Symfony\Contracts\Translation\LocaleAwareInterface;
if (!interface_exists(LocaleAwareInterface::class)) {
throw new \LogicException('You cannot use the "Symfony\Component\String\Slugger\AsciiSlugger" as the "symfony/translation-contracts" package is not installed. Try running "composer require symfony/translation-contracts".');
}
/**
* @author Titouan Galopin <galopintitouan@gmail.com>
*