Skip to content

Commit

Permalink
Removed use function import and no longer needed ignored phpstan errors
Browse files Browse the repository at this point in the history
  • Loading branch information
hazington committed Sep 22, 2024
1 parent cb02d7f commit 15e69a6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 24 deletions.
20 changes: 0 additions & 20 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<int\\|string, int\\|string>\\|false\\|null\\.$#"
count: 1
Expand Down Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions src/PhpWord/Element/AbstractElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

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

0 comments on commit 15e69a6

Please sign in to comment.