From 701cbf3c0a7e5218032ccb3d05a837149dfbf31f Mon Sep 17 00:00:00 2001 From: Ambroise Maupate Date: Wed, 28 Jun 2023 00:40:17 +0200 Subject: [PATCH] fix: CoreBundle must not reference other bundles classes. --- lib/RoadizCoreBundle/src/Entity/Theme.php | 24 ++++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/RoadizCoreBundle/src/Entity/Theme.php b/lib/RoadizCoreBundle/src/Entity/Theme.php index 61ad9e64..57d5afd6 100644 --- a/lib/RoadizCoreBundle/src/Entity/Theme.php +++ b/lib/RoadizCoreBundle/src/Entity/Theme.php @@ -4,7 +4,6 @@ namespace RZ\Roadiz\CoreBundle\Entity; -use RZ\Roadiz\CompatBundle\Controller\AppController; use RZ\Roadiz\Core\AbstractEntities\AbstractEntity; /** @@ -88,19 +87,16 @@ public function getInformations(): array $class = $this->getClassName(); if (class_exists($class)) { - $reflector = new \ReflectionClass($class); - if ($reflector->isSubclassOf(AppController::class)) { - $nameCallable = [$class, 'getThemeName']; - $authorCallable = [$class, 'getThemeAuthor']; - $copyrightCallable = [$class, 'getThemeCopyright']; - $dirCallable = [$class, 'getThemeDir']; - return [ - 'name' => \is_callable($nameCallable) ? call_user_func($nameCallable) : null, - 'author' => \is_callable($authorCallable) ? call_user_func($authorCallable) : null, - 'copyright' => \is_callable($copyrightCallable) ? call_user_func($copyrightCallable) : null, - 'dir' => \is_callable($dirCallable) ? call_user_func($dirCallable) : null, - ]; - } + $nameCallable = [$class, 'getThemeName']; + $authorCallable = [$class, 'getThemeAuthor']; + $copyrightCallable = [$class, 'getThemeCopyright']; + $dirCallable = [$class, 'getThemeDir']; + return [ + 'name' => \is_callable($nameCallable) ? call_user_func($nameCallable) : null, + 'author' => \is_callable($authorCallable) ? call_user_func($authorCallable) : null, + 'copyright' => \is_callable($copyrightCallable) ? call_user_func($copyrightCallable) : null, + 'dir' => \is_callable($dirCallable) ? call_user_func($dirCallable) : null, + ]; } return [];