From 904fb1ae21751cb03d0e4c17a8f1126014730b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Tue, 7 Jul 2020 11:07:44 +0200 Subject: [PATCH] [String] Added a help message when translation-contracts is not installed --- src/Symfony/Component/String/Slugger/AsciiSlugger.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/String/Slugger/AsciiSlugger.php b/src/Symfony/Component/String/Slugger/AsciiSlugger.php index 5a33c465aa..0b8c60c7bf 100644 --- a/src/Symfony/Component/String/Slugger/AsciiSlugger.php +++ b/src/Symfony/Component/String/Slugger/AsciiSlugger.php @@ -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 *