@@ -267,7 +267,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
267
267
* @param integer $index the XF index for the format.
268
268
* @param array $properties array with properties to be set on initialization.
269
269
*/
270
- public function __construct ($ BIFF_version , $ index = 0 , $ properties = array () )
270
+ public function __construct ($ BIFF_version , $ index = 0 , $ properties = [] )
271
271
{
272
272
$ this ->_xf_index = $ index ;
273
273
$ this ->_BIFF_version = $ BIFF_version ;
@@ -314,10 +314,9 @@ public function __construct($BIFF_version, $index = 0, $properties = array())
314
314
$ this ->_diag_color = 0x40 ;
315
315
316
316
// Set properties passed to Spreadsheet_Excel_Writer_Workbook::addFormat()
317
- foreach ($ properties as $ property => $ value )
318
- {
319
- if (method_exists ($ this , 'set ' .ucwords ($ property ))) {
320
- $ method_name = 'set ' .ucwords ($ property );
317
+ foreach ($ properties as $ property => $ value ) {
318
+ if (method_exists ($ this , 'set ' . ucwords ($ property ))) {
319
+ $ method_name = 'set ' . ucwords ($ property );
321
320
$ this ->$ method_name ($ value );
322
321
}
323
322
}
@@ -409,8 +408,8 @@ public function getXf($style)
409
408
410
409
$ header = pack ("vv " , $ record , $ length );
411
410
$ data = pack ("vvvvvvvv " , $ ifnt , $ ifmt , $ style , $ align ,
412
- $ icv , $ fill ,
413
- $ border1 , $ border2 );
411
+ $ icv , $ fill ,
412
+ $ border1 , $ border2 );
414
413
} elseif ($ this ->_BIFF_version == 0x0600 ) {
415
414
$ align = $ this ->_text_h_align ; // Alignment
416
415
$ align |= $ this ->_text_wrap << 3 ;
@@ -497,12 +496,12 @@ public function getFont()
497
496
$ header = pack ("vv " , $ record , $ length );
498
497
if ($ this ->_BIFF_version == 0x0500 ) {
499
498
$ data = pack ("vvvvvCCCCC " , $ dyHeight , $ grbit , $ icv , $ bls ,
500
- $ sss , $ uls , $ bFamily ,
501
- $ bCharSet , $ reserved , $ cch );
499
+ $ sss , $ uls , $ bFamily ,
500
+ $ bCharSet , $ reserved , $ cch );
502
501
} elseif ($ this ->_BIFF_version == 0x0600 ) {
503
502
$ data = pack ("vvvvvCCCCCC " , $ dyHeight , $ grbit , $ icv , $ bls ,
504
- $ sss , $ uls , $ bFamily ,
505
- $ bCharSet , $ reserved , $ cch , $ encoding );
503
+ $ sss , $ uls , $ bFamily ,
504
+ $ bCharSet , $ reserved , $ cch , $ encoding );
506
505
}
507
506
return ($ header . $ data . $ this ->_font_name );
508
507
}
@@ -549,26 +548,26 @@ public function getXfIndex()
549
548
*/
550
549
protected function _getColor ($ name_color = '' )
551
550
{
552
- $ colors = array (
553
- 'aqua ' => 0x07 ,
554
- 'cyan ' => 0x07 ,
555
- 'black ' => 0x00 ,
556
- 'blue ' => 0x04 ,
557
- 'brown ' => 0x10 ,
558
- 'magenta ' => 0x06 ,
559
- 'fuchsia ' => 0x06 ,
560
- 'gray ' => 0x17 ,
561
- 'grey ' => 0x17 ,
562
- 'green ' => 0x11 ,
563
- 'lime ' => 0x03 ,
564
- 'navy ' => 0x12 ,
565
- 'orange ' => 0x35 ,
566
- 'purple ' => 0x14 ,
567
- 'red ' => 0x02 ,
568
- 'silver ' => 0x16 ,
569
- 'white ' => 0x01 ,
570
- 'yellow ' => 0x05 ,
571
- ) ;
551
+ $ colors = [
552
+ 'aqua ' => 0x07 ,
553
+ 'cyan ' => 0x07 ,
554
+ 'black ' => 0x00 ,
555
+ 'blue ' => 0x04 ,
556
+ 'brown ' => 0x10 ,
557
+ 'magenta ' => 0x06 ,
558
+ 'fuchsia ' => 0x06 ,
559
+ 'gray ' => 0x17 ,
560
+ 'grey ' => 0x17 ,
561
+ 'green ' => 0x11 ,
562
+ 'lime ' => 0x03 ,
563
+ 'navy ' => 0x12 ,
564
+ 'orange ' => 0x35 ,
565
+ 'purple ' => 0x14 ,
566
+ 'red ' => 0x02 ,
567
+ 'silver ' => 0x16 ,
568
+ 'white ' => 0x01 ,
569
+ 'yellow ' => 0x05 ,
570
+ ] ;
572
571
573
572
// Return the default color, 0x7FFF, if undef,
574
573
if ($ name_color === '' ) {
@@ -998,35 +997,34 @@ public function setTextWrap()
998
997
*/
999
998
public function setTextRotation ($ angle )
1000
999
{
1001
- switch ($ angle )
1002
- {
1000
+ switch ($ angle ) {
1003
1001
case 0 :
1004
1002
$ this ->_rotation = 0 ;
1005
1003
break ;
1006
1004
case 90 :
1007
1005
if ($ this ->_BIFF_version == 0x0500 ) {
1008
- $ this ->_rotation = 3 ;
1006
+ $ this ->_rotation = 3 ;
1009
1007
} elseif ($ this ->_BIFF_version == 0x0600 ) {
1010
1008
$ this ->_rotation = 180 ;
1011
1009
}
1012
1010
break ;
1013
1011
case 270 :
1014
1012
if ($ this ->_BIFF_version == 0x0500 ) {
1015
- $ this ->_rotation = 2 ;
1013
+ $ this ->_rotation = 2 ;
1016
1014
} elseif ($ this ->_BIFF_version == 0x0600 ) {
1017
1015
$ this ->_rotation = 90 ;
1018
1016
}
1019
1017
break ;
1020
1018
case -1 :
1021
1019
if ($ this ->_BIFF_version == 0x0500 ) {
1022
- $ this ->_rotation = 1 ;
1020
+ $ this ->_rotation = 1 ;
1023
1021
} elseif ($ this ->_BIFF_version == 0x0600 ) {
1024
1022
$ this ->_rotation = 255 ;
1025
1023
}
1026
1024
break ;
1027
1025
default :
1028
- return $ this ->raiseError ("Invalid value for angle. " .
1029
- " Possible values are: 0, 90, 270 and -1 " .
1026
+ return $ this ->raiseError ("Invalid value for angle. " .
1027
+ " Possible values are: 0, 90, 270 and -1 " .
1030
1028
"for stacking top-to-bottom. " );
1031
1029
$ this ->_rotation = 0 ;
1032
1030
break ;
@@ -1087,15 +1085,15 @@ public function setScript($script)
1087
1085
$ this ->_font_script = $ script ;
1088
1086
}
1089
1087
1090
- /**
1091
- * Locks a cell.
1092
- *
1093
- * @access public
1094
- */
1095
- public function setLocked ()
1096
- {
1097
- $ this ->_locked = 1 ;
1098
- }
1088
+ /**
1089
+ * Locks a cell.
1090
+ *
1091
+ * @access public
1092
+ */
1093
+ public function setLocked ()
1094
+ {
1095
+ $ this ->_locked = 1 ;
1096
+ }
1099
1097
1100
1098
/**
1101
1099
* Unlocks a cell. Useful for unprotecting particular cells of a protected sheet.
0 commit comments