diff --git a/application/models/TemplateConfig.php b/application/models/TemplateConfig.php index 11531eed12a..f93567dbf16 100644 --- a/application/models/TemplateConfig.php +++ b/application/models/TemplateConfig.php @@ -59,7 +59,7 @@ class TemplateConfig extends CActiveRecord */ public $oMotherTemplate; - /** @var array $oOptions The template options */ + /** @var object $oOptions The template options */ public $oOptions; public $oOptionAttributes; @@ -348,7 +348,7 @@ protected function getFilePath($sFile, $oTemplate) * Get the depends package * @uses self::@package * @param TemplateConfiguration $oTemplate - * @return string[] + * @return stdClass[] */ protected function getDependsPackages($oTemplate) { diff --git a/application/models/TemplateConfiguration.php b/application/models/TemplateConfiguration.php index 6a53330d919..62d350e9aab 100755 --- a/application/models/TemplateConfiguration.php +++ b/application/models/TemplateConfiguration.php @@ -1125,9 +1125,8 @@ protected function getOfiles($oTemplate, $sField) if ($oFiles === null) { App()->setFlashMessage( sprintf( - gT('Error: Malformed JSON - field %s must be either a JSON array or the string "inherit". Found "%s".'), - $sField, - $oFiles + gT('Error: Malformed JSON - field %s must be either a JSON array or the string "inherit". Found "null".'), + $sField ), 'error' ); @@ -1164,7 +1163,7 @@ protected function setMotherTemplates() $sMotherTemplateName = $this->template->extends; $instance = TemplateConfiguration::getInstanceFromTemplateName($sMotherTemplateName); $instance->template->checkTemplate(); - $this->oMotherTemplate = $instance->prepareTemplateRendering($sMotherTemplateName, null); + $this->oMotherTemplate = $instance->prepareTemplateRendering($sMotherTemplateName, ''); } } @@ -1241,6 +1240,7 @@ protected function setThisTemplate() /** * @todo document me + * @return void */ private function setCssFramework() { @@ -1250,18 +1250,22 @@ private function setCssFramework() $this->cssFramework->css = json_decode($this->cssframework_css); $this->cssFramework->js = json_decode($this->cssframework_js); } else { - $this->cssFramework = ''; + $this->cssFramework = new \stdClass(); + $this->cssFramework->name = ''; + $this->cssFramework->css = ''; + $this->cssFramework->js = ''; } } /** * @todo document me + * @return void */ protected function setOptions() { - $this->oOptions = array(); + $this->oOptions = new stdClass(); if (!empty($this->options)) { - $this->oOptions = json_decode($this->options); + $this->oOptions = json_decode($this->options, true); } // unset "comment" property which is auto generated from HTML comments in xml file unset($this->oOptions->comment); diff --git a/psalm.xml b/psalm.xml index a44babda238..bf49b65781e 100644 --- a/psalm.xml +++ b/psalm.xml @@ -11,6 +11,7 @@ +