diff --git a/src/QUI/Bricks/Brick.php b/src/QUI/Bricks/Brick.php index 970254a82ef64bb194dad6cd1a81bb8507375e2d..32934c3900053125f1aa356465670314d68b2660 100644 --- a/src/QUI/Bricks/Brick.php +++ b/src/QUI/Bricks/Brick.php @@ -276,7 +276,7 @@ public function create(): string .\md5($this->getType()) .'/' .$this->hash - .'/'.\md5(\serialize($this->getAttributes())); + .'/'.\md5(\serialize($this->getSettings())); if ($this->getAttribute('cacheable')) { try { @@ -567,11 +567,11 @@ public function getCustomFields(): array /** * Add an extra CSS Class to the control * - * @param string $cssClass - Name of the CSS Class + * @param string|array $cssClass - Name of the CSS Class * * @return void */ - public function addCSSClass(string $cssClass) + public function addCSSClass($cssClass) { if (\is_array($cssClass)) { $cssClass = \implode(' ', $cssClass); diff --git a/src/QUI/Bricks/Controls/ContentSwitcher.php b/src/QUI/Bricks/Controls/ContentSwitcher.php index 935d12b28756e011388d25b767d8cc3cce1137a4..dbf47779aae04c930c168280c828e1d10333fb09 100644 --- a/src/QUI/Bricks/Controls/ContentSwitcher.php +++ b/src/QUI/Bricks/Controls/ContentSwitcher.php @@ -20,19 +20,19 @@ class ContentSwitcher extends QUI\Control * * @param array $attributes */ - public function __construct($attributes = array()) + public function __construct($attributes = []) { // default options - $this->setAttributes(array( + $this->setAttributes([ 'title' => 'Content Switcher', 'contentList' => false, - 'entries' => array() - )); + 'entries' => [] + ]); parent::__construct($attributes); $this->addCSSFile( - dirname(__FILE__) . '/ContentSwitcher.css' + dirname(__FILE__).'/ContentSwitcher.css' ); } @@ -46,15 +46,15 @@ public function getBody() $Engine = QUI::getTemplateManager()->getEngine(); $entries = $this->getAttribute('entries'); - if (is_string($entries)) { - $entries = json_decode($entries, true); + if (\is_string($entries)) { + $entries = \json_decode($entries, true); } - $Engine->assign(array( + $Engine->assign([ 'this' => $this, 'entries' => $entries - )); + ]); - return $Engine->fetch(dirname(__FILE__) . '/ContentSwitcher.html'); + return $Engine->fetch(\dirname(__FILE__).'/ContentSwitcher.html'); } } diff --git a/src/QUI/Bricks/Manager.php b/src/QUI/Bricks/Manager.php index 571575c731fa13feeb606ad1ed0313bd1fcc52dd..14dfbd7cdcdad1de0ff0425da493631880d71d79 100644 --- a/src/QUI/Bricks/Manager.php +++ b/src/QUI/Bricks/Manager.php @@ -183,11 +183,11 @@ public function createUniqueSiteBrick(Site $Site, $brickData = []) * * @param integer $brickId - Brick ID * @param Site $Site - Current Site - * @return bool + * @return string * * @throws QUI\Exception */ - protected function createUniqueBrickId(int $brickId, Site $Site): bool + protected function createUniqueBrickId(int $brickId, Site $Site): string { $Project = $Site->getProject(); $uuid = QUI\Utils\Uuid::get();