Skip to content

Commit 15e69a6

Browse files
committed
Removed use function import and no longer needed ignored phpstan errors
1 parent cb02d7f commit 15e69a6

File tree

2 files changed

+2
-24
lines changed

2 files changed

+2
-24
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,6 @@ parameters:
1010
count: 1
1111
path: src/PhpWord/Element/AbstractContainer.php
1212

13-
-
14-
message: "#^Parameter \\#1 \\$string of function md5 expects string, int\\<0, max\\> given\\.$#"
15-
count: 1
16-
path: src/PhpWord/Element/AbstractElement.php
17-
18-
-
19-
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\\.$#"
20-
count: 1
21-
path: src/PhpWord/Element/Cell.php
22-
2313
-
2414
message: "#^Method PhpOffice\\\\PhpWord\\\\Element\\\\Field\\:\\:setOptions\\(\\) should return PhpOffice\\\\PhpWord\\\\Element\\\\Field but returns array\\.$#"
2515
count: 1
@@ -40,11 +30,6 @@ parameters:
4030
count: 1
4131
path: src/PhpWord/Element/Field.php
4232

43-
-
44-
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\\.$#"
45-
count: 1
46-
path: src/PhpWord/Element/Footnote.php
47-
4833
-
4934
message: "#^Method PhpOffice\\\\PhpWord\\\\Element\\\\Image\\:\\:getArchiveImageSize\\(\\) should return array\\|null but returns array<int\\|string, int\\|string>\\|false\\|null\\.$#"
5035
count: 1
@@ -85,11 +70,6 @@ parameters:
8570
count: 1
8671
path: src/PhpWord/Element/Section.php
8772

88-
-
89-
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\\.$#"
90-
count: 1
91-
path: src/PhpWord/Element/Section.php
92-
9373
-
9474
message: "#^Parameter \\#3 \\$length of function substr expects int\\|null, int\\|false given\\.$#"
9575
count: 1

src/PhpWord/Element/AbstractElement.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@
1919

2020
use DateTime;
2121
use InvalidArgumentException;
22-
use function is_array;
2322
use PhpOffice\PhpWord\Collection\Comments;
2423
use PhpOffice\PhpWord\Media;
2524
use PhpOffice\PhpWord\PhpWord;
2625
use PhpOffice\PhpWord\Style;
27-
2826
use PhpOffice\PhpWord\Style\AbstractStyle;
2927

3028
/**
@@ -484,13 +482,13 @@ public function isInSection()
484482
/**
485483
* Set new style value.
486484
*
487-
* @param AbstractStyle $styleObject Style object
485+
* @param mixed $styleObject Style object
488486
* @param null|AbstractStyle|array|string|Style $styleValue Style value
489487
* @param bool $returnObject Always return object
490488
*
491489
* @return mixed
492490
*/
493-
protected function setNewStyle($styleObject, $styleValue = null, $returnObject = false)
491+
protected function setNewStyle($styleObject, $styleValue = null, bool $returnObject = false)
494492
{
495493
if ($styleValue instanceof AbstractStyle && get_class($styleValue) === get_class($styleObject)) {
496494
return $styleValue;

0 commit comments

Comments
 (0)