@@ -55,22 +55,22 @@ private function readPageSettingStyles(DOMDocument $styleDom): void
55
55
56
56
foreach ($ styles as $ styleSet ) {
57
57
$ styleName = $ styleSet ->getAttributeNS ($ this ->stylesNs , 'name ' );
58
- $ pageLayoutProperties = $ styleSet ->getElementsByTagNameNS ($ this ->stylesNs , 'page-layout-properties ' )[ 0 ] ;
59
- $ styleOrientation = $ pageLayoutProperties ->getAttributeNS ($ this ->stylesNs , 'print-orientation ' );
60
- $ styleScale = $ pageLayoutProperties ->getAttributeNS ($ this ->stylesNs , 'scale-to ' );
61
- $ stylePrintOrder = $ pageLayoutProperties ->getAttributeNS ($ this ->stylesNs , 'print-page-order ' );
62
- $ centered = $ pageLayoutProperties ->getAttributeNS ($ this ->stylesNs , 'table-centering ' );
63
-
64
- $ marginLeft = $ pageLayoutProperties ->getAttributeNS ($ this ->stylesFo , 'margin-left ' );
65
- $ marginRight = $ pageLayoutProperties ->getAttributeNS ($ this ->stylesFo , 'margin-right ' );
66
- $ marginTop = $ pageLayoutProperties ->getAttributeNS ($ this ->stylesFo , 'margin-top ' );
67
- $ marginBottom = $ pageLayoutProperties ->getAttributeNS ($ this ->stylesFo , 'margin-bottom ' );
68
- $ header = $ styleSet ->getElementsByTagNameNS ($ this ->stylesNs , 'header-style ' )[ 0 ] ;
69
- $ headerProperties = $ header ->getElementsByTagNameNS ($ this ->stylesNs , 'header-footer-properties ' )[ 0 ] ;
70
- $ marginHeader = isset ( $ headerProperties) ? $ headerProperties ->getAttributeNS ($ this ->stylesFo , 'min-height ' ) : null ;
71
- $ footer = $ styleSet ->getElementsByTagNameNS ($ this ->stylesNs , 'footer-style ' )[ 0 ] ;
72
- $ footerProperties = $ footer ->getElementsByTagNameNS ($ this ->stylesNs , 'header-footer-properties ' )[ 0 ] ;
73
- $ marginFooter = isset ( $ footerProperties) ? $ footerProperties ->getAttributeNS ($ this ->stylesFo , 'min-height ' ) : null ;
58
+ $ pageLayoutProperties = $ styleSet ->getElementsByTagNameNS ($ this ->stylesNs , 'page-layout-properties ' )-> item ( 0 ) ;
59
+ $ styleOrientation = $ pageLayoutProperties? ->getAttributeNS($ this ->stylesNs , 'print-orientation ' );
60
+ $ styleScale = $ pageLayoutProperties? ->getAttributeNS($ this ->stylesNs , 'scale-to ' );
61
+ $ stylePrintOrder = $ pageLayoutProperties? ->getAttributeNS($ this ->stylesNs , 'print-page-order ' );
62
+ $ centered = $ pageLayoutProperties? ->getAttributeNS($ this ->stylesNs , 'table-centering ' );
63
+
64
+ $ marginLeft = $ pageLayoutProperties? ->getAttributeNS($ this ->stylesFo , 'margin-left ' );
65
+ $ marginRight = $ pageLayoutProperties? ->getAttributeNS($ this ->stylesFo , 'margin-right ' );
66
+ $ marginTop = $ pageLayoutProperties? ->getAttributeNS($ this ->stylesFo , 'margin-top ' );
67
+ $ marginBottom = $ pageLayoutProperties? ->getAttributeNS($ this ->stylesFo , 'margin-bottom ' );
68
+ $ header = $ styleSet ->getElementsByTagNameNS ($ this ->stylesNs , 'header-style ' )-> item ( 0 ) ;
69
+ $ headerProperties = $ header? ->getElementsByTagNameNS($ this ->stylesNs , 'header-footer-properties ' )?->item( 0 ) ;
70
+ $ marginHeader = $ headerProperties? ->getAttributeNS($ this ->stylesFo , 'min-height ' );
71
+ $ footer = $ styleSet ->getElementsByTagNameNS ($ this ->stylesNs , 'footer-style ' )-> item ( 0 ) ;
72
+ $ footerProperties = $ footer? ->getElementsByTagNameNS($ this ->stylesNs , 'header-footer-properties ' )?->item( 0 ) ;
73
+ $ marginFooter = $ footerProperties? ->getAttributeNS($ this ->stylesFo , 'min-height ' );
74
74
75
75
$ this ->pageLayoutStyles [$ styleName ] = (object ) [
76
76
'orientation ' => $ styleOrientation ?: PageSetup::ORIENTATION_DEFAULT ,
0 commit comments