Skip to content

Commit d909085

Browse files
lyrixxnicolas-grekas
authored andcommitted
[String] Added a help message when translation-contracts is not installed
1 parent 6514589 commit d909085

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Slugger/AsciiSlugger.php

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
use Symfony\Component\String\UnicodeString;
1616
use Symfony\Contracts\Translation\LocaleAwareInterface;
1717

18+
if (!interface_exists(LocaleAwareInterface::class)) {
19+
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".');
20+
}
21+
1822
/**
1923
* @author Titouan Galopin <[email protected]>
2024
*

0 commit comments

Comments
 (0)