@@ -115,7 +115,7 @@ protected static function parseInlineStyle($node, $styles = array())
115115 // tables, cells
116116 if (false !== strpos ($ val , '% ' )) {
117117 // e.g. <table width="100%"> or <td width="50%">
118- $ styles ['width ' ] = intval ( $ val) * 50 ;
118+ $ styles ['width ' ] = ( int ) $ val * 50 ;
119119 $ styles ['unit ' ] = \PhpOffice \PhpWord \SimpleType \TblWidth::PERCENT ;
120120 } else {
121121 // e.g. <table width="250> where "250" = 250px (always pixels)
@@ -125,7 +125,7 @@ protected static function parseInlineStyle($node, $styles = array())
125125 break ;
126126 case 'cellspacing ' :
127127 // tables e.g. <table cellspacing="2">, where "2" = 2px (always pixels)
128- $ val = intval ( $ val). 'px ' ;
128+ $ val = ( int ) $ val . 'px ' ;
129129 $ styles ['cellSpacing ' ] = Converter::cssToTwip ($ val );
130130 break ;
131131 case 'bgcolor ' :
@@ -693,7 +693,7 @@ protected static function parseStyle($attribute, $styles)
693693 // This may be adjusted, if better ratio or formula found.
694694 // BC change: up to ver. 0.17.0 was $size converted to points - Converter::cssToPoint($size)
695695 $ size = Converter::cssToTwip ($ matches [1 ]);
696- $ size = intval ($ size / 2 );
696+ $ size = ( int ) ($ size / 2 );
697697 // valid variants may be e.g. borderSize, borderTopSize, borderLeftColor, etc ..
698698 $ styles ["border {$ which }Size " ] = $ size ; // twips
699699 $ styles ["border {$ which }Color " ] = trim ($ matches [2 ], '# ' );
@@ -871,9 +871,9 @@ protected static function mapAlign($cssAlignment)
871871 }
872872
873873 /**
874- * Transforms a HTML/CSS alignment into a \PhpOffice\PhpWord\SimpleType\Jc
874+ * Transforms a HTML/CSS vertical alignment
875875 *
876- * @param string $cssAlignment
876+ * @param string $alignment
877877 * @return string|null
878878 */
879879 protected static function mapAlignVertical ($ alignment )
@@ -901,10 +901,10 @@ protected static function mapAlignVertical($alignment)
901901 }
902902
903903 /**
904- * Map list style for ordered list
905- *
906- * @param string $cssListType
907- */
904+ * Map list style for ordered list
905+ *
906+ * @param string $cssListType
907+ */
908908 protected static function mapListType ($ cssListType )
909909 {
910910 switch ($ cssListType ) {
@@ -959,32 +959,32 @@ protected static function parseLink($node, $element, &$styles)
959959 }
960960
961961 /**
962- * Render horizontal rule
963- * Note: Word rule is not the same as HTML's <hr> since it does not support width and thus neither alignment
964- *
965- * @param \DOMNode $node
966- * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
967- */
962+ * Render horizontal rule
963+ * Note: Word rule is not the same as HTML's <hr> since it does not support width and thus neither alignment
964+ *
965+ * @param \DOMNode $node
966+ * @param \PhpOffice\PhpWord\Element\AbstractContainer $element
967+ */
968968 protected static function parseHorizRule ($ node , $ element )
969969 {
970970 $ styles = self ::parseInlineStyle ($ node );
971971
972972 // <hr> is implemented as an empty paragraph - extending 100% inside the section
973973 // Some properties may be controlled, e.g. <hr style="border-bottom: 3px #DDDDDD solid; margin-bottom: 0;">
974974
975- $ fontStyle = $ styles + [ 'size ' => 3 ] ;
975+ $ fontStyle = $ styles + array ( 'size ' => 3 ) ;
976976
977- $ paragraphStyle = $ styles + [
978- 'lineHeight ' => 0.25 , // multiply default line height - e.g. 1, 1.5 etc
979- 'spacing ' => 0 , // twip
980- 'spaceBefore ' => 120 , // twip, 240/2 (default line height)
981- 'spaceAfter ' => 120 , // twip
982- 'borderBottomSize ' => empty ($ styles ['line-height ' ]) ? 1 : $ styles ['line-height ' ],
977+ $ paragraphStyle = $ styles + array (
978+ 'lineHeight ' => 0.25 , // multiply default line height - e.g. 1, 1.5 etc
979+ 'spacing ' => 0 , // twip
980+ 'spaceBefore ' => 120 , // twip, 240/2 (default line height)
981+ 'spaceAfter ' => 120 , // twip
982+ 'borderBottomSize ' => empty ($ styles ['line-height ' ]) ? 1 : $ styles ['line-height ' ],
983983 'borderBottomColor ' => empty ($ styles ['color ' ]) ? '000000 ' : $ styles ['color ' ],
984984 'borderBottomStyle ' => 'single ' , // same as "solid"
985- ] ;
985+ ) ;
986986
987- $ element ->addText ("" , $ fontStyle , $ paragraphStyle );
987+ $ element ->addText ('' , $ fontStyle , $ paragraphStyle );
988988
989989 // Notes: <hr/> cannot be:
990990 // - table - throws error "cannot be inside textruns", e.g. lists
0 commit comments