From 2648e960a7abbc9b2aacedabb97454fefafb68e5 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 80b3de45b..afd372059 100644 --- a/src/Extend/LanguagePack.php +++ b/src/Extend/LanguagePack.php @@ -20,14 +20,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; } @@ -61,11 +61,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.' ); }