diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 909718b83b..b89529645b 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -10,16 +10,6 @@ parameters: count: 1 path: src/PhpWord/Element/AbstractContainer.php - - - message: "#^Parameter \\#1 \\$string of function md5 expects string, int\\<0, max\\> given\\.$#" - count: 1 - path: src/PhpWord/Element/AbstractElement.php - - - - message: "#^Parameter \\#2 \\$styleValue of method PhpOffice\\\\PhpWord\\\\Element\\\\AbstractElement\\:\\:setNewStyle\\(\\) expects array\\|PhpOffice\\\\PhpWord\\\\Style\\|string\\|null, array\\|PhpOffice\\\\PhpWord\\\\Style\\\\Cell\\|null given\\.$#" - count: 1 - path: src/PhpWord/Element/Cell.php - - message: "#^Method PhpOffice\\\\PhpWord\\\\Element\\\\Field\\:\\:setOptions\\(\\) should return PhpOffice\\\\PhpWord\\\\Element\\\\Field but returns array\\.$#" count: 1 @@ -40,11 +30,6 @@ parameters: count: 1 path: src/PhpWord/Element/Field.php - - - message: "#^Parameter \\#2 \\$styleValue of method PhpOffice\\\\PhpWord\\\\Element\\\\AbstractElement\\:\\:setNewStyle\\(\\) expects array\\|PhpOffice\\\\PhpWord\\\\Style\\|string\\|null, array\\|PhpOffice\\\\PhpWord\\\\Style\\\\Paragraph\\|string\\|null given\\.$#" - count: 1 - path: src/PhpWord/Element/Footnote.php - - message: "#^Method PhpOffice\\\\PhpWord\\\\Element\\\\Image\\:\\:getArchiveImageSize\\(\\) should return array\\|null but returns array\\|false\\|null\\.$#" count: 1 @@ -85,11 +70,6 @@ parameters: count: 1 path: src/PhpWord/Element/Section.php - - - message: "#^Parameter \\#2 \\$styleValue of method PhpOffice\\\\PhpWord\\\\Element\\\\AbstractElement\\:\\:setNewStyle\\(\\) expects array\\|PhpOffice\\\\PhpWord\\\\Style\\|string\\|null, array\\|PhpOffice\\\\PhpWord\\\\Style\\|PhpOffice\\\\PhpWord\\\\Style\\\\Section\\|string given\\.$#" - count: 1 - path: src/PhpWord/Element/Section.php - - message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, int\\|false given\\.$#" count: 1 diff --git a/src/PhpWord/Element/AbstractElement.php b/src/PhpWord/Element/AbstractElement.php index 42d55b1e7b..92d08d8b00 100644 --- a/src/PhpWord/Element/AbstractElement.php +++ b/src/PhpWord/Element/AbstractElement.php @@ -19,12 +19,10 @@ use DateTime; use InvalidArgumentException; -use function is_array; use PhpOffice\PhpWord\Collection\Comments; use PhpOffice\PhpWord\Media; use PhpOffice\PhpWord\PhpWord; use PhpOffice\PhpWord\Style; - use PhpOffice\PhpWord\Style\AbstractStyle; /** @@ -484,13 +482,13 @@ public function isInSection() /** * Set new style value. * - * @param AbstractStyle $styleObject Style object + * @param mixed $styleObject Style object * @param null|AbstractStyle|array|string|Style $styleValue Style value * @param bool $returnObject Always return object * * @return mixed */ - protected function setNewStyle($styleObject, $styleValue = null, $returnObject = false) + protected function setNewStyle($styleObject, $styleValue = null, bool $returnObject = false) { if ($styleValue instanceof AbstractStyle && get_class($styleValue) === get_class($styleObject)) { return $styleValue;