Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@
return (new PhpCsFixer\Config())
->setRules([
'@PER-CS' => true,
'native_function_invocation' => false,
'array_syntax' => false,
'concat_space' => false,
'blank_line_after_opening_tag' => false,
'visibility_required' => ['elements' => ['property', 'method']], // Exclude 'const' for PHP 5.6 compatibility
'trailing_comma_in_multiline' => false,
'trailing_comma_in_multiline' => ['elements' => ['arrays']],
'method_argument_space' => false,
'array_indentation' => false,
'braces_position' => false,
'statement_indentation' => false,
'binary_operator_spaces' => false,
'single_blank_line_at_eof' => false,
'control_structure_braces' => false,
'control_structure_continuation_position' => false,
])
->setFinder(
PhpCsFixer\Finder::create()
Expand Down
3 changes: 2 additions & 1 deletion Spreadsheet/Excel/Writer.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Module written/ported by Xavier Noguer <[email protected]>
*
Expand Down Expand Up @@ -102,4 +103,4 @@ public function rowcolToCell($row, $col)

return $chr1 . $chr2 . $row;
}
}
}
3 changes: 2 additions & 1 deletion Spreadsheet/Excel/Writer/BIFFwriter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Module written/ported by Xavier Noguer <[email protected]>
*
Expand Down Expand Up @@ -265,4 +266,4 @@ public function setTempDir($dir)
}
return false;
}
}
}
10 changes: 3 additions & 7 deletions Spreadsheet/Excel/Writer/Format.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Module written/ported by Xavier Noguer <[email protected]>
*
Expand Down Expand Up @@ -322,7 +323,6 @@ public function __construct($BIFF_version, $index = 0, $properties = array())
}
}


/**
* Generate an Excel BIFF XF record (style or cell).
*
Expand Down Expand Up @@ -567,7 +567,7 @@ protected function _getColor($name_color = '')
'red' => 0x02,
'silver' => 0x16,
'white' => 0x01,
'yellow' => 0x05
'yellow' => 0x05,
);

// Return the default color, 0x7FFF, if undef,
Expand Down Expand Up @@ -763,7 +763,6 @@ public function setBold($weight = 1)
$this->_bold = $weight;
}


/************************************
* FUNCTIONS FOR SETTING CELLS BORDERS
*/
Expand Down Expand Up @@ -812,7 +811,6 @@ public function setRight($style)
$this->_right = $style;
}


/**
* Set cells borders to the same style
*
Expand All @@ -827,7 +825,6 @@ public function setBorder($style)
$this->setRight($style);
}


/*******************************************
* FUNCTIONS FOR SETTING CELLS BORDERS COLORS
*/
Expand Down Expand Up @@ -895,7 +892,6 @@ public function setRightColor($color)
$this->_right_color = $value;
}


/**
* Sets the cell's foreground color
*
Expand Down Expand Up @@ -1122,4 +1118,4 @@ public function setFontFamily($font_family)
{
$this->_font_name = $font_family;
}
}
}
455 changes: 228 additions & 227 deletions Spreadsheet/Excel/Writer/Parser.php

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Spreadsheet/Excel/Writer/Validator.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Module written by Herman Kuiper <[email protected]>
*
Expand Down Expand Up @@ -225,4 +226,4 @@ public function setCol($col, $row1, $row2, $incell = true)
$this->_incell = $incell;
//$this->_formula1 = ...;
}
}*/
}*/
22 changes: 1 addition & 21 deletions Spreadsheet/Excel/Writer/Workbook.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* Module written/ported by Xavier Noguer <[email protected]>
*
Expand Down Expand Up @@ -903,9 +904,6 @@ protected function _storeNames()
}
}




/******************************************************************************
*
* BIFF RECORDS
Expand Down Expand Up @@ -1048,7 +1046,6 @@ protected function _storeStyle()
$this->_append($header . $data);
}


/**
* Writes Excel FORMAT record for non "built-in" numerical formats.
*
Expand Down Expand Up @@ -1106,7 +1103,6 @@ protected function _storeDatemode()
$this->_append($header . $data);
}


/**
* Write BIFF record EXTERNCOUNT to indicate the number of external sheet
* references in the workbook.
Expand All @@ -1130,7 +1126,6 @@ protected function _storeExterncount($cxals)
$this->_append($header . $data);
}


/**
* Writes the Excel BIFF EXTERNSHEET record. These references are used by
* formulas. NAME record is required to define the print area and the repeat
Expand All @@ -1154,7 +1149,6 @@ protected function _storeExternsheet($sheetname)
$this->_append($header . $data . $sheetname);
}


/**
* Store the NAME record in the short format that is used for storing the print
* area, repeat rows only and repeat columns only.
Expand Down Expand Up @@ -1218,7 +1212,6 @@ protected function _storeNameShort($index, $type, $rowmin, $rowmax, $colmin, $co
$this->_append($header . $data);
}


/**
* Store the NAME record in the long format that is used for storing the repeat
* rows and columns when both are specified. This shares a lot of code with
Expand Down Expand Up @@ -1395,7 +1388,6 @@ protected function _calculateSharedStringsSizes()
$header_length = 3; // Min string + header size -1
$space_remaining = $continue_limit - $written - $continue;


/* TODO: Unicode data should only be split on char (2 byte)
boundaries. Therefore, in some cases we need to reduce the
amount of available
Expand Down Expand Up @@ -1423,7 +1415,6 @@ protected function _calculateSharedStringsSizes()
}
}


if ($space_remaining > $header_length) {
// Write as much as possible of the string in the current block
$written += $space_remaining;
Expand Down Expand Up @@ -1468,7 +1459,6 @@ protected function _calculateSharedStringsSizes()
$this->_block_sizes[] = $written + $continue;
}


/* Calculate the total length of the SST and associated CONTINUEs (if any).
The SST record will have a length even if it contains no strings.
This length is required to set the offsets in the BOUNDSHEET records since
Expand Down Expand Up @@ -1525,16 +1515,11 @@ protected function _storeSharedStringsTable()
$length = 8;
}



// Write the SST block header information
$header = pack("vv", $record, $length);
$data = pack("VV", $this->_str_total, $this->_str_unique);
$this->_append($header . $data);




/* TODO: not good for performance */
foreach (array_keys($this->_str_table) as $string) {

Expand All @@ -1548,7 +1533,6 @@ protected function _storeSharedStringsTable()
//
$block_length += $string_length;


// We can write the string if it doesn't cross a CONTINUE boundary
if ($block_length < $continue_limit) {
$this->_append($string);
Expand All @@ -1568,7 +1552,6 @@ protected function _storeSharedStringsTable()
$header_length = 3; // Min string + header size -1
$space_remaining = $continue_limit - $written - $continue;


// Unicode data should only be split on char (2 byte) boundaries.
// Therefore, in some cases we need to reduce the amount of available
// space by 1 byte to ensure the correct alignment.
Expand All @@ -1595,7 +1578,6 @@ protected function _storeSharedStringsTable()
}
}


if ($space_remaining > $header_length) {
// Write as much as possible of the string in the current block
$tmp = substr($string, 0, $space_remaining);
Expand Down Expand Up @@ -1648,6 +1630,4 @@ protected function _storeSharedStringsTable()
}
}


}

Loading