Skip to content

Commit

Permalink
Cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
freost committed Dec 28, 2024
1 parent f2a4054 commit 60aa58c
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/mako/application/Package.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,15 @@

namespace mako\application;

use mako\common\traits\NamespacedFileLoaderTrait;
use mako\config\Config;
use mako\file\FileSystem;
use mako\i18n\I18n;
use mako\syringe\Container;
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;
Expand Down Expand Up @@ -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);
}
}
Expand All @@ -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);
}
}
Expand Down

0 comments on commit 60aa58c

Please sign in to comment.