diff --git a/_examples/mp_dev_tools_example_module/php/class.mp.dev.tools.example.module.php b/_examples/mp_dev_tools_example_module/php/class.mp.dev.tools.example.module.php index d2ad61b..d6210f2 100644 --- a/_examples/mp_dev_tools_example_module/php/class.mp.dev.tools.example.module.php +++ b/_examples/mp_dev_tools_example_module/php/class.mp.dev.tools.example.module.php @@ -12,6 +12,7 @@ */ use CONTENIDO\Plugin\MpDevTools\Gui\FieldsetTable; +use CONTENIDO\Plugin\MpDevTools\Gui\Table; use CONTENIDO\Plugin\MpDevTools\Module\AbstractBase; /** @@ -111,7 +112,7 @@ public function addCodeRow($table, string $codeLabel, $result): MpDevToolsExampl * * @return string */ - public function renderModuleInputStyles() + public function renderModuleInputStyles(): string { static $stylesRendered; diff --git a/classes/Gui/AbstractBaseSelect.php b/classes/Gui/AbstractBaseSelect.php index 4b9f775..9e0849d 100644 --- a/classes/Gui/AbstractBaseSelect.php +++ b/classes/Gui/AbstractBaseSelect.php @@ -138,6 +138,7 @@ protected function createSelect(): \cHTMLSelectElement * Creates the first option element for the select box. * * @return \cHTMLOptionElement|null + * @throws \cException */ protected function createFirstOption() { @@ -245,6 +246,8 @@ protected function getSpacer(int $level): string * defined one from the constant. * * @return bool|mixed|string|string[] + * @throws \cDbException + * @throws \cException */ protected function getFolderSymbol() { diff --git a/classes/Gui/ArticleSelect.php b/classes/Gui/ArticleSelect.php index 9c4e30e..ba5fec8 100644 --- a/classes/Gui/ArticleSelect.php +++ b/classes/Gui/ArticleSelect.php @@ -51,7 +51,6 @@ public function __construct( * ] * @return string * @throws \cDbException - * @throws \cException * @throws \cInvalidArgumentException */ public function render( @@ -62,10 +61,7 @@ public function render( $selCatArt = explode(self::VALUES_DELIMITER, $selCatArt); array_map(function ($item) { - $idcatat = self::toCategoryArticleId($item); - if ($idcatat > 0) { - return $idcatat; - } + return self::toCategoryArticleId($item); }, $selCatArt); $categoryId = CategorySelect::toCategoryId($categoryId); @@ -125,6 +121,8 @@ public static function getSelectedValues($value): array * @param int $level * @param \cDb|null $db * @return void + * @throws \cDbException + * @throws \cInvalidArgumentException */ protected function addArticleOptions(int $categoryId, array $selCatArt, int $level, \cDb $db = null) { diff --git a/classes/Gui/UploadSelect.php b/classes/Gui/UploadSelect.php index faeb644..b8c85bc 100644 --- a/classes/Gui/UploadSelect.php +++ b/classes/Gui/UploadSelect.php @@ -152,6 +152,8 @@ public static function getSelectedValues($value): array * @param array $files * @param array $selUpload * @return void + * @throws \cDbException + * @throws \cException */ private function fillOptions(array $files, array $selUpload) { @@ -276,6 +278,8 @@ private function isFile(string $path, \stdClass $item): bool * * @param string $path The path to filter for. * @return int Number of found records. + * @throws \cDbException + * @throws \cInvalidArgumentException */ private function fetchUploadFiles(string $path): int { @@ -381,6 +385,8 @@ private function fetchUploadFiles(string $path): int * * @param string $path The path to filter for. * @return int Number of found records. + * @throws \cDbException + * @throws \cInvalidArgumentException */ private function fetchDbfsFiles(string $path): int { diff --git a/classes/Module/CmsToken.php b/classes/Module/CmsToken.php index dc481d7..26b6a63 100644 --- a/classes/Module/CmsToken.php +++ b/classes/Module/CmsToken.php @@ -105,7 +105,7 @@ public function __toString(): string * Magic getter for properties index, var, and value. * * @param string $name - * @return mixed|null + * @return bool|int|string * @throws \cException */ public function __get(string $name) diff --git a/classes/Plugin/AbstractBase.php b/classes/Plugin/AbstractBase.php index dd1d3c3..c0b8819 100644 --- a/classes/Plugin/AbstractBase.php +++ b/classes/Plugin/AbstractBase.php @@ -357,7 +357,7 @@ public function templateExists(string $file): bool * @throws \cDbException * @throws \cInvalidArgumentException */ - public function getPluginInfo() + public function getPluginInfo(): \stdClass { if (!isset($this->pluginInfo)) { $this->pluginInfo = new \stdClass();