@@ -76,10 +76,7 @@ public function write()
76
76
$ content .= $ this ->openingText ;
77
77
$ content .= $ this ->openingTags ;
78
78
if (Settings::isOutputEscapingEnabled ()) {
79
- // Scrutinizer notes that escapeHTML does not exist on AbstractEscaper.
80
- // Nevertheless, it does exist for HTML writer.
81
79
$ escaper = $ this ->escaper ;
82
- /** @scrutinizer ignore-call */
83
80
$ contenx = $ escaper ->escapeHtml ($ element ->getText ());
84
81
} else {
85
82
$ contenx = $ element ->getText ();
@@ -124,10 +121,7 @@ protected function writeOpening()
124
121
{
125
122
$ content = '' ;
126
123
if (!$ this ->withoutP ) {
127
- $ style = '' ;
128
- if (method_exists ($ this ->element , 'getParagraphStyle ' )) {
129
- $ style = $ this ->getParagraphStyle ();
130
- }
124
+ $ style = $ this ->getParagraphStyle ();
131
125
$ content .= "<p {$ style }> " ;
132
126
}
133
127
@@ -151,10 +145,7 @@ protected function writeClosing()
151
145
152
146
if (!$ this ->withoutP ) {
153
147
if (Settings::isOutputEscapingEnabled ()) {
154
- // Scrutinizer notes that escapeHTML does not exist on AbstractEscaper.
155
- // Nevertheless, it does exist for HTML writer.
156
148
$ escaper = $ this ->escaper ;
157
- /** @scrutinizer ignore-call */
158
149
$ contenx = $ escaper ->escapeHtml ($ this ->closingText );
159
150
$ content .= $ contenx ;
160
151
} else {
@@ -275,12 +266,10 @@ private function getFontStyle()
275
266
$ lang = $ fontStyle ->getLang ();
276
267
} elseif (!empty ($ fontStyle )) {
277
268
$ style = " class= \"$ fontStyle \"" ;
278
- $ styl2 = Style::getStyle ($ fontStyle );
279
- if (!empty ($ styl2 )) {
280
- // Scrutinizer notes that getLang does not exist on Abstract Style.
281
- // Nevertheless, it does exist for Font Style.
282
- /** @scrutinizer ignore-call */
283
- $ lang = $ styl2 ->getLang ();
269
+ /** @var \PhpOffice\PhpWord\Style\Font $styl3 Type hint */
270
+ $ styl3 = Style::getStyle ($ fontStyle );
271
+ if (!empty ($ styl3 )) {
272
+ $ lang = $ styl3 ->getLang ();
284
273
}
285
274
}
286
275
if ($ lang ) {
0 commit comments