Skip to content

Commit

Permalink
fix: CoreBundle must not reference other bundles classes.
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Jun 27, 2023
1 parent b3a1ac0 commit 701cbf3
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions lib/RoadizCoreBundle/src/Entity/Theme.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace RZ\Roadiz\CoreBundle\Entity;

use RZ\Roadiz\CompatBundle\Controller\AppController;
use RZ\Roadiz\Core\AbstractEntities\AbstractEntity;

/**
Expand Down Expand Up @@ -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 [];
Expand Down

0 comments on commit 701cbf3

Please sign in to comment.