@@ -267,7 +267,7 @@ class Spreadsheet_Excel_Writer_Format extends PEAR
267267 * @param integer $index the XF index for the format.
268268 * @param array $properties array with properties to be set on initialization.
269269 */
270- public function __construct ($ BIFF_version , $ index = 0 , $ properties = array () )
270+ public function __construct ($ BIFF_version , $ index = 0 , $ properties = [] )
271271 {
272272 $ this ->_xf_index = $ index ;
273273 $ this ->_BIFF_version = $ BIFF_version ;
@@ -314,10 +314,9 @@ public function __construct($BIFF_version, $index = 0, $properties = array())
314314 $ this ->_diag_color = 0x40 ;
315315
316316 // 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 );
321320 $ this ->$ method_name ($ value );
322321 }
323322 }
@@ -409,8 +408,8 @@ public function getXf($style)
409408
410409 $ header = pack ("vv " , $ record , $ length );
411410 $ data = pack ("vvvvvvvv " , $ ifnt , $ ifmt , $ style , $ align ,
412- $ icv , $ fill ,
413- $ border1 , $ border2 );
411+ $ icv , $ fill ,
412+ $ border1 , $ border2 );
414413 } elseif ($ this ->_BIFF_version == 0x0600 ) {
415414 $ align = $ this ->_text_h_align ; // Alignment
416415 $ align |= $ this ->_text_wrap << 3 ;
@@ -497,12 +496,12 @@ public function getFont()
497496 $ header = pack ("vv " , $ record , $ length );
498497 if ($ this ->_BIFF_version == 0x0500 ) {
499498 $ data = pack ("vvvvvCCCCC " , $ dyHeight , $ grbit , $ icv , $ bls ,
500- $ sss , $ uls , $ bFamily ,
501- $ bCharSet , $ reserved , $ cch );
499+ $ sss , $ uls , $ bFamily ,
500+ $ bCharSet , $ reserved , $ cch );
502501 } elseif ($ this ->_BIFF_version == 0x0600 ) {
503502 $ 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 );
506505 }
507506 return ($ header . $ data . $ this ->_font_name );
508507 }
@@ -549,26 +548,26 @@ public function getXfIndex()
549548 */
550549 protected function _getColor ($ name_color = '' )
551550 {
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+ ] ;
572571
573572 // Return the default color, 0x7FFF, if undef,
574573 if ($ name_color === '' ) {
@@ -998,35 +997,34 @@ public function setTextWrap()
998997 */
999998 public function setTextRotation ($ angle )
1000999 {
1001- switch ($ angle )
1002- {
1000+ switch ($ angle ) {
10031001 case 0 :
10041002 $ this ->_rotation = 0 ;
10051003 break ;
10061004 case 90 :
10071005 if ($ this ->_BIFF_version == 0x0500 ) {
1008- $ this ->_rotation = 3 ;
1006+ $ this ->_rotation = 3 ;
10091007 } elseif ($ this ->_BIFF_version == 0x0600 ) {
10101008 $ this ->_rotation = 180 ;
10111009 }
10121010 break ;
10131011 case 270 :
10141012 if ($ this ->_BIFF_version == 0x0500 ) {
1015- $ this ->_rotation = 2 ;
1013+ $ this ->_rotation = 2 ;
10161014 } elseif ($ this ->_BIFF_version == 0x0600 ) {
10171015 $ this ->_rotation = 90 ;
10181016 }
10191017 break ;
10201018 case -1 :
10211019 if ($ this ->_BIFF_version == 0x0500 ) {
1022- $ this ->_rotation = 1 ;
1020+ $ this ->_rotation = 1 ;
10231021 } elseif ($ this ->_BIFF_version == 0x0600 ) {
10241022 $ this ->_rotation = 255 ;
10251023 }
10261024 break ;
10271025 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 " .
10301028 "for stacking top-to-bottom. " );
10311029 $ this ->_rotation = 0 ;
10321030 break ;
@@ -1087,15 +1085,15 @@ public function setScript($script)
10871085 $ this ->_font_script = $ script ;
10881086 }
10891087
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+ }
10991097
11001098 /**
11011099 * Unlocks a cell. Useful for unprotecting particular cells of a protected sheet.
0 commit comments