From 80546b9ed78526c80645164830dcf5a7f7210a6b Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Thu, 1 Aug 2019 22:25:15 +0200 Subject: [PATCH] Make exception message dynamic as well --- src/Extend/LanguagePack.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Extend/LanguagePack.php b/src/Extend/LanguagePack.php index 956a575b5..13599acad 100644 --- a/src/Extend/LanguagePack.php +++ b/src/Extend/LanguagePack.php @@ -18,14 +18,14 @@ use RuntimeException; class LanguagePack implements ExtenderInterface, LifecycleInterface { - protected $path; + private $path; /** * LanguagePack constructor. * * @param string|null $path Path to yaml language files. */ - public function __construct(string $path = null) + public function __construct(string $path = '/locale') { $this->path = $path; } @@ -59,11 +59,11 @@ class LanguagePack implements ExtenderInterface, LifecycleInterface { $locales->addLocale($locale, $title); - $directory = $extension->getPath().($this->path ?? '/locale'); + $directory = $extension->getPath().$this->path; if (! is_dir($directory)) { throw new RuntimeException( - 'Language packs must have a "locale" subdirectory.' + 'Expected to find "'.$this->path.'" directory in language pack.' ); }