From 60aa58c0ce880aadf7872f245673c6aa0ccf2f17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frederic=20G=2E=20=C3=98stby?= Date: Sat, 28 Dec 2024 23:13:08 +0100 Subject: [PATCH] Cleaning up --- src/mako/application/Package.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mako/application/Package.php b/src/mako/application/Package.php index d9057f50a..fe7255e5a 100644 --- a/src/mako/application/Package.php +++ b/src/mako/application/Package.php @@ -7,7 +7,6 @@ namespace mako\application; -use mako\common\traits\NamespacedFileLoaderTrait; use mako\config\Config; use mako\file\FileSystem; use mako\i18n\I18n; @@ -15,9 +14,8 @@ use mako\view\ViewFactory; use ReflectionClass; -use function class_uses; use function dirname; -use function in_array; +use function method_exists; use function str_replace; use function strrpos; use function strtolower; @@ -157,7 +155,7 @@ public function boot(): void if ($fileSystem->isDirectory($path = $this->getConfigPath())) { $configLoader = $this->container->get(Config::class)->getLoader(); - if (in_array(NamespacedFileLoaderTrait::class, class_uses($configLoader))) { + if (method_exists($configLoader, 'registerNamespace')) { $configLoader->registerNamespace($this->getFileNamespace(), $path); } } @@ -167,7 +165,7 @@ public function boot(): void if ($fileSystem->isDirectory($path = $this->getI18nPath()) && $this->container->has(I18n::class)) { $i18nLoader = $this->container->get(I18n::class)->getLoader(); - if (in_array(NamespacedFileLoaderTrait::class, class_uses($i18nLoader))) { + if (method_exists($i18nLoader, 'registerNamespace')) { $i18nLoader->registerNamespace($this->getFileNamespace(), $path); } }