File tree Expand file tree Collapse file tree 4 files changed +14
-32
lines changed Expand file tree Collapse file tree 4 files changed +14
-32
lines changed Original file line number Diff line number Diff line change @@ -1760,36 +1760,11 @@ parameters:
1760
1760
count : 1
1761
1761
path : tests/PhpWordTests/Style/FontTest.php
1762
1762
1763
- -
1764
- message : " #^Binary operation \"\\ *\" between 1\\ |120\\ |240\\ |'atLeast'\\ |'auto'\\ |'Normal'\\ |'numStyle'\\ |bool and 720 results in an error\\ .$#"
1765
- count : 1
1766
- path : tests/PhpWordTests/Style/ParagraphTest.php
1767
-
1768
1763
-
1769
1764
message : " #^Cannot call method setLineHeight\\ (\\ ) on PhpOffice\\\\ PhpWord\\\\ Style\\\\ Paragraph\\ |string\\ .$#"
1770
1765
count : 1
1771
1766
path : tests/PhpWordTests/Style/ParagraphTest.php
1772
1767
1773
- -
1774
- message : " #^Method PhpOffice\\\\ PhpWordTests\\\\ Style\\\\ ParagraphTest\\ :\\ :findGetter\\ (\\ ) has no return type specified\\ .$#"
1775
- count : 1
1776
- path : tests/PhpWordTests/Style/ParagraphTest.php
1777
-
1778
- -
1779
- message : " #^Method PhpOffice\\\\ PhpWordTests\\\\ Style\\\\ ParagraphTest\\ :\\ :findGetter\\ (\\ ) has parameter \\ $key with no type specified\\ .$#"
1780
- count : 1
1781
- path : tests/PhpWordTests/Style/ParagraphTest.php
1782
-
1783
- -
1784
- message : " #^Method PhpOffice\\\\ PhpWordTests\\\\ Style\\\\ ParagraphTest\\ :\\ :findGetter\\ (\\ ) has parameter \\ $object with no type specified\\ .$#"
1785
- count : 1
1786
- path : tests/PhpWordTests/Style/ParagraphTest.php
1787
-
1788
- -
1789
- message : " #^Method PhpOffice\\\\ PhpWordTests\\\\ Style\\\\ ParagraphTest\\ :\\ :findGetter\\ (\\ ) has parameter \\ $value with no type specified\\ .$#"
1790
- count : 1
1791
- path : tests/PhpWordTests/Style/ParagraphTest.php
1792
-
1793
1768
-
1794
1769
message : " #^Parameter \\ #2 \\ $value of method PhpOffice\\\\ PhpWord\\\\ Style\\\\ AbstractStyle\\ :\\ :setStyleValue\\ (\\ ) expects array\\ |int\\ |string, bool given\\ .$#"
1795
1770
count : 1
Original file line number Diff line number Diff line change @@ -199,9 +199,9 @@ class Paragraph extends Border
199
199
public function setStyleValue ($ key , $ value )
200
200
{
201
201
$ key = Text::removeUnderscorePrefix ($ key );
202
- if ('indent ' == $ key || 'hanging ' == $ key ) {
203
- $ value = $ value * 720 ; // 720 twips is 0.5 inch
204
- }
202
+ // if ('indent' == $key || 'hanging' == $key) {
203
+ // $value = $value * 720; // 720 twips is 0.5 inch
204
+ // }
205
205
206
206
return parent ::setStyleValue ($ key , $ value );
207
207
}
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ public function write()
95
95
}
96
96
$ ind = $ style ->getIndentation ();
97
97
if ($ ind != null ) {
98
- $ tcpdf = $ this ->getParentWriter ()-> isTcpdf ();
98
+ $ tcpdf = ( $ this ->getParentWriter () === null ) ? false : $ this -> getParentWriter ()-> isTcpdf (); // @phpstan-ignore-line
99
99
$ left = $ ind ->getLeft ();
100
100
$ inches = $ left * 1.0 / \PhpOffice \PhpWord \Shared \Converter::INCH_TO_TWIP ;
101
101
$ css [$ tcpdf ? 'text-indent ' : 'margin-left ' ] = ((string ) $ inches ) . 'in ' ;
Original file line number Diff line number Diff line change @@ -91,13 +91,20 @@ public function testSetStyleValueNormal(): void
91
91
foreach ($ attributes as $ key => $ value ) {
92
92
$ get = $ this ->findGetter ($ key , $ value , $ object );
93
93
$ object ->setStyleValue ("$ key " , $ value );
94
- if ('indent ' == $ key || 'hanging ' == $ key ) {
95
- $ value = $ value * 720 ;
96
- }
94
+ // if ('indent' == $key || 'hanging' == $key) {
95
+ // $value = $value * 720;
96
+ // }
97
97
self ::assertEquals ($ value , $ object ->$ get ());
98
98
}
99
99
}
100
100
101
+ /**
102
+ * @param string $key
103
+ * @param mixed $value
104
+ * @param object $object
105
+ *
106
+ * @return string
107
+ */
101
108
private function findGetter ($ key , $ value , $ object )
102
109
{
103
110
if (is_bool ($ value )) {
You can’t perform that action at this time.
0 commit comments