diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index fffc5d3..5a70bf9 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -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() diff --git a/Spreadsheet/Excel/Writer.php b/Spreadsheet/Excel/Writer.php index 411eb8b..f8ed9ab 100644 --- a/Spreadsheet/Excel/Writer.php +++ b/Spreadsheet/Excel/Writer.php @@ -1,4 +1,5 @@ * @@ -102,4 +103,4 @@ public function rowcolToCell($row, $col) return $chr1 . $chr2 . $row; } -} \ No newline at end of file +} diff --git a/Spreadsheet/Excel/Writer/BIFFwriter.php b/Spreadsheet/Excel/Writer/BIFFwriter.php index 9d59894..511fcb4 100644 --- a/Spreadsheet/Excel/Writer/BIFFwriter.php +++ b/Spreadsheet/Excel/Writer/BIFFwriter.php @@ -1,4 +1,5 @@ * @@ -265,4 +266,4 @@ public function setTempDir($dir) } return false; } -} \ No newline at end of file +} diff --git a/Spreadsheet/Excel/Writer/Format.php b/Spreadsheet/Excel/Writer/Format.php index 7e5baf5..cd8af1f 100644 --- a/Spreadsheet/Excel/Writer/Format.php +++ b/Spreadsheet/Excel/Writer/Format.php @@ -1,4 +1,5 @@ * @@ -322,7 +323,6 @@ public function __construct($BIFF_version, $index = 0, $properties = array()) } } - /** * Generate an Excel BIFF XF record (style or cell). * @@ -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, @@ -763,7 +763,6 @@ public function setBold($weight = 1) $this->_bold = $weight; } - /************************************ * FUNCTIONS FOR SETTING CELLS BORDERS */ @@ -812,7 +811,6 @@ public function setRight($style) $this->_right = $style; } - /** * Set cells borders to the same style * @@ -827,7 +825,6 @@ public function setBorder($style) $this->setRight($style); } - /******************************************* * FUNCTIONS FOR SETTING CELLS BORDERS COLORS */ @@ -895,7 +892,6 @@ public function setRightColor($color) $this->_right_color = $value; } - /** * Sets the cell's foreground color * @@ -1122,4 +1118,4 @@ public function setFontFamily($font_family) { $this->_font_name = $font_family; } -} \ No newline at end of file +} diff --git a/Spreadsheet/Excel/Writer/Parser.php b/Spreadsheet/Excel/Writer/Parser.php index d7b1833..6d40601 100644 --- a/Spreadsheet/Excel/Writer/Parser.php +++ b/Spreadsheet/Excel/Writer/Parser.php @@ -1,4 +1,5 @@ 0x7A, 'ptgArea3dA' => 0x7B, 'ptgRefErr3dA' => 0x7C, - 'ptgAreaErr3d' => 0x7D + 'ptgAreaErr3d' => 0x7D, ); // Thanks to Michael Meeks and Gnumeric for the initial arg values. @@ -316,231 +317,231 @@ protected function _initializeHashes() // $this->_functions = array( // public function ptg args class vol - 'COUNT' => array( 0, -1, 0, 0 ), - 'IF' => array( 1, -1, 1, 0 ), - 'ISNA' => array( 2, 1, 1, 0 ), - 'ISERROR' => array( 3, 1, 1, 0 ), - 'SUM' => array( 4, -1, 0, 0 ), - 'AVERAGE' => array( 5, -1, 0, 0 ), - 'MIN' => array( 6, -1, 0, 0 ), - 'MAX' => array( 7, -1, 0, 0 ), - 'ROW' => array( 8, -1, 0, 0 ), - 'COLUMN' => array( 9, -1, 0, 0 ), - 'NA' => array( 10, 0, 0, 0 ), - 'NPV' => array( 11, -1, 1, 0 ), - 'STDEV' => array( 12, -1, 0, 0 ), - 'DOLLAR' => array( 13, -1, 1, 0 ), - 'FIXED' => array( 14, -1, 1, 0 ), - 'SIN' => array( 15, 1, 1, 0 ), - 'COS' => array( 16, 1, 1, 0 ), - 'TAN' => array( 17, 1, 1, 0 ), - 'ATAN' => array( 18, 1, 1, 0 ), - 'PI' => array( 19, 0, 1, 0 ), - 'SQRT' => array( 20, 1, 1, 0 ), - 'EXP' => array( 21, 1, 1, 0 ), - 'LN' => array( 22, 1, 1, 0 ), - 'LOG10' => array( 23, 1, 1, 0 ), - 'ABS' => array( 24, 1, 1, 0 ), - 'INT' => array( 25, 1, 1, 0 ), - 'SIGN' => array( 26, 1, 1, 0 ), - 'ROUND' => array( 27, 2, 1, 0 ), - 'LOOKUP' => array( 28, -1, 0, 0 ), - 'INDEX' => array( 29, -1, 0, 1 ), - 'REPT' => array( 30, 2, 1, 0 ), - 'MID' => array( 31, 3, 1, 0 ), - 'LEN' => array( 32, 1, 1, 0 ), - 'VALUE' => array( 33, 1, 1, 0 ), - 'TRUE' => array( 34, 0, 1, 0 ), - 'FALSE' => array( 35, 0, 1, 0 ), - 'AND' => array( 36, -1, 0, 0 ), - 'OR' => array( 37, -1, 0, 0 ), - 'NOT' => array( 38, 1, 1, 0 ), - 'MOD' => array( 39, 2, 1, 0 ), - 'DCOUNT' => array( 40, 3, 0, 0 ), - 'DSUM' => array( 41, 3, 0, 0 ), - 'DAVERAGE' => array( 42, 3, 0, 0 ), - 'DMIN' => array( 43, 3, 0, 0 ), - 'DMAX' => array( 44, 3, 0, 0 ), - 'DSTDEV' => array( 45, 3, 0, 0 ), - 'VAR' => array( 46, -1, 0, 0 ), - 'DVAR' => array( 47, 3, 0, 0 ), - 'TEXT' => array( 48, 2, 1, 0 ), - 'LINEST' => array( 49, -1, 0, 0 ), - 'TREND' => array( 50, -1, 0, 0 ), - 'LOGEST' => array( 51, -1, 0, 0 ), - 'GROWTH' => array( 52, -1, 0, 0 ), - 'PV' => array( 56, -1, 1, 0 ), - 'FV' => array( 57, -1, 1, 0 ), - 'NPER' => array( 58, -1, 1, 0 ), - 'PMT' => array( 59, -1, 1, 0 ), - 'RATE' => array( 60, -1, 1, 0 ), - 'MIRR' => array( 61, 3, 0, 0 ), - 'IRR' => array( 62, -1, 0, 0 ), - 'RAND' => array( 63, 0, 1, 1 ), - 'MATCH' => array( 64, -1, 0, 0 ), - 'DATE' => array( 65, 3, 1, 0 ), - 'TIME' => array( 66, 3, 1, 0 ), - 'DAY' => array( 67, 1, 1, 0 ), - 'MONTH' => array( 68, 1, 1, 0 ), - 'YEAR' => array( 69, 1, 1, 0 ), - 'WEEKDAY' => array( 70, -1, 1, 0 ), - 'HOUR' => array( 71, 1, 1, 0 ), - 'MINUTE' => array( 72, 1, 1, 0 ), - 'SECOND' => array( 73, 1, 1, 0 ), - 'NOW' => array( 74, 0, 1, 1 ), - 'AREAS' => array( 75, 1, 0, 1 ), - 'ROWS' => array( 76, 1, 0, 1 ), - 'COLUMNS' => array( 77, 1, 0, 1 ), - 'OFFSET' => array( 78, -1, 0, 1 ), - 'SEARCH' => array( 82, -1, 1, 0 ), - 'TRANSPOSE' => array( 83, 1, 1, 0 ), - 'TYPE' => array( 86, 1, 1, 0 ), - 'ATAN2' => array( 97, 2, 1, 0 ), - 'ASIN' => array( 98, 1, 1, 0 ), - 'ACOS' => array( 99, 1, 1, 0 ), - 'CHOOSE' => array( 100, -1, 1, 0 ), - 'HLOOKUP' => array( 101, -1, 0, 0 ), - 'VLOOKUP' => array( 102, -1, 0, 0 ), - 'ISREF' => array( 105, 1, 0, 0 ), - 'LOG' => array( 109, -1, 1, 0 ), - 'CHAR' => array( 111, 1, 1, 0 ), - 'LOWER' => array( 112, 1, 1, 0 ), - 'UPPER' => array( 113, 1, 1, 0 ), - 'PROPER' => array( 114, 1, 1, 0 ), - 'LEFT' => array( 115, -1, 1, 0 ), - 'RIGHT' => array( 116, -1, 1, 0 ), - 'EXACT' => array( 117, 2, 1, 0 ), - 'TRIM' => array( 118, 1, 1, 0 ), - 'REPLACE' => array( 119, 4, 1, 0 ), - 'SUBSTITUTE' => array( 120, -1, 1, 0 ), - 'CODE' => array( 121, 1, 1, 0 ), - 'FIND' => array( 124, -1, 1, 0 ), - 'CELL' => array( 125, -1, 0, 1 ), - 'ISERR' => array( 126, 1, 1, 0 ), - 'ISTEXT' => array( 127, 1, 1, 0 ), - 'ISNUMBER' => array( 128, 1, 1, 0 ), - 'ISBLANK' => array( 129, 1, 1, 0 ), - 'T' => array( 130, 1, 0, 0 ), - 'N' => array( 131, 1, 0, 0 ), - 'DATEVALUE' => array( 140, 1, 1, 0 ), - 'TIMEVALUE' => array( 141, 1, 1, 0 ), - 'SLN' => array( 142, 3, 1, 0 ), - 'SYD' => array( 143, 4, 1, 0 ), - 'DDB' => array( 144, -1, 1, 0 ), - 'INDIRECT' => array( 148, -1, 1, 1 ), - 'CALL' => array( 150, -1, 1, 0 ), - 'CLEAN' => array( 162, 1, 1, 0 ), - 'MDETERM' => array( 163, 1, 2, 0 ), - 'MINVERSE' => array( 164, 1, 2, 0 ), - 'MMULT' => array( 165, 2, 2, 0 ), - 'IPMT' => array( 167, -1, 1, 0 ), - 'PPMT' => array( 168, -1, 1, 0 ), - 'COUNTA' => array( 169, -1, 0, 0 ), - 'PRODUCT' => array( 183, -1, 0, 0 ), - 'FACT' => array( 184, 1, 1, 0 ), - 'DPRODUCT' => array( 189, 3, 0, 0 ), - 'ISNONTEXT' => array( 190, 1, 1, 0 ), - 'STDEVP' => array( 193, -1, 0, 0 ), - 'VARP' => array( 194, -1, 0, 0 ), - 'DSTDEVP' => array( 195, 3, 0, 0 ), - 'DVARP' => array( 196, 3, 0, 0 ), - 'TRUNC' => array( 197, -1, 1, 0 ), - 'ISLOGICAL' => array( 198, 1, 1, 0 ), - 'DCOUNTA' => array( 199, 3, 0, 0 ), - 'ROUNDUP' => array( 212, 2, 1, 0 ), - 'ROUNDDOWN' => array( 213, 2, 1, 0 ), - 'RANK' => array( 216, -1, 0, 0 ), - 'ADDRESS' => array( 219, -1, 1, 0 ), - 'DAYS360' => array( 220, -1, 1, 0 ), - 'TODAY' => array( 221, 0, 1, 1 ), - 'VDB' => array( 222, -1, 1, 0 ), - 'MEDIAN' => array( 227, -1, 0, 0 ), - 'SUMPRODUCT' => array( 228, -1, 2, 0 ), - 'SINH' => array( 229, 1, 1, 0 ), - 'COSH' => array( 230, 1, 1, 0 ), - 'TANH' => array( 231, 1, 1, 0 ), - 'ASINH' => array( 232, 1, 1, 0 ), - 'ACOSH' => array( 233, 1, 1, 0 ), - 'ATANH' => array( 234, 1, 1, 0 ), - 'DGET' => array( 235, 3, 0, 0 ), - 'INFO' => array( 244, 1, 1, 1 ), - 'DB' => array( 247, -1, 1, 0 ), - 'FREQUENCY' => array( 252, 2, 0, 0 ), - 'ERROR.TYPE' => array( 261, 1, 1, 0 ), - 'REGISTER.ID' => array( 267, -1, 1, 0 ), - 'AVEDEV' => array( 269, -1, 0, 0 ), - 'BETADIST' => array( 270, -1, 1, 0 ), - 'GAMMALN' => array( 271, 1, 1, 0 ), - 'BETAINV' => array( 272, -1, 1, 0 ), - 'BINOMDIST' => array( 273, 4, 1, 0 ), - 'CHIDIST' => array( 274, 2, 1, 0 ), - 'CHIINV' => array( 275, 2, 1, 0 ), - 'COMBIN' => array( 276, 2, 1, 0 ), - 'CONFIDENCE' => array( 277, 3, 1, 0 ), - 'CRITBINOM' => array( 278, 3, 1, 0 ), - 'EVEN' => array( 279, 1, 1, 0 ), - 'EXPONDIST' => array( 280, 3, 1, 0 ), - 'FDIST' => array( 281, 3, 1, 0 ), - 'FINV' => array( 282, 3, 1, 0 ), - 'FISHER' => array( 283, 1, 1, 0 ), - 'FISHERINV' => array( 284, 1, 1, 0 ), - 'FLOOR' => array( 285, 2, 1, 0 ), - 'GAMMADIST' => array( 286, 4, 1, 0 ), - 'GAMMAINV' => array( 287, 3, 1, 0 ), - 'CEILING' => array( 288, 2, 1, 0 ), - 'HYPGEOMDIST' => array( 289, 4, 1, 0 ), - 'LOGNORMDIST' => array( 290, 3, 1, 0 ), - 'LOGINV' => array( 291, 3, 1, 0 ), - 'NEGBINOMDIST' => array( 292, 3, 1, 0 ), - 'NORMDIST' => array( 293, 4, 1, 0 ), - 'NORMSDIST' => array( 294, 1, 1, 0 ), - 'NORMINV' => array( 295, 3, 1, 0 ), - 'NORMSINV' => array( 296, 1, 1, 0 ), - 'STANDARDIZE' => array( 297, 3, 1, 0 ), - 'ODD' => array( 298, 1, 1, 0 ), - 'PERMUT' => array( 299, 2, 1, 0 ), - 'POISSON' => array( 300, 3, 1, 0 ), - 'TDIST' => array( 301, 3, 1, 0 ), - 'WEIBULL' => array( 302, 4, 1, 0 ), - 'SUMXMY2' => array( 303, 2, 2, 0 ), - 'SUMX2MY2' => array( 304, 2, 2, 0 ), - 'SUMX2PY2' => array( 305, 2, 2, 0 ), - 'CHITEST' => array( 306, 2, 2, 0 ), - 'CORREL' => array( 307, 2, 2, 0 ), - 'COVAR' => array( 308, 2, 2, 0 ), - 'FORECAST' => array( 309, 3, 2, 0 ), - 'FTEST' => array( 310, 2, 2, 0 ), - 'INTERCEPT' => array( 311, 2, 2, 0 ), - 'PEARSON' => array( 312, 2, 2, 0 ), - 'RSQ' => array( 313, 2, 2, 0 ), - 'STEYX' => array( 314, 2, 2, 0 ), - 'SLOPE' => array( 315, 2, 2, 0 ), - 'TTEST' => array( 316, 4, 2, 0 ), - 'PROB' => array( 317, -1, 2, 0 ), - 'DEVSQ' => array( 318, -1, 0, 0 ), - 'GEOMEAN' => array( 319, -1, 0, 0 ), - 'HARMEAN' => array( 320, -1, 0, 0 ), - 'SUMSQ' => array( 321, -1, 0, 0 ), - 'KURT' => array( 322, -1, 0, 0 ), - 'SKEW' => array( 323, -1, 0, 0 ), - 'ZTEST' => array( 324, -1, 0, 0 ), - 'LARGE' => array( 325, 2, 0, 0 ), - 'SMALL' => array( 326, 2, 0, 0 ), - 'QUARTILE' => array( 327, 2, 0, 0 ), - 'PERCENTILE' => array( 328, 2, 0, 0 ), - 'PERCENTRANK' => array( 329, -1, 0, 0 ), - 'MODE' => array( 330, -1, 2, 0 ), - 'TRIMMEAN' => array( 331, 2, 0, 0 ), - 'TINV' => array( 332, 2, 1, 0 ), - 'CONCATENATE' => array( 336, -1, 1, 0 ), - 'POWER' => array( 337, 2, 1, 0 ), - 'RADIANS' => array( 342, 1, 1, 0 ), - 'DEGREES' => array( 343, 1, 1, 0 ), - 'SUBTOTAL' => array( 344, -1, 0, 0 ), - 'SUMIF' => array( 345, -1, 0, 0 ), - 'COUNTIF' => array( 346, 2, 0, 0 ), - 'COUNTBLANK' => array( 347, 1, 0, 0 ), - 'ROMAN' => array( 354, -1, 1, 0 ) + 'COUNT' => array(0, -1, 0, 0), + 'IF' => array(1, -1, 1, 0), + 'ISNA' => array(2, 1, 1, 0), + 'ISERROR' => array(3, 1, 1, 0), + 'SUM' => array(4, -1, 0, 0), + 'AVERAGE' => array(5, -1, 0, 0), + 'MIN' => array(6, -1, 0, 0), + 'MAX' => array(7, -1, 0, 0), + 'ROW' => array(8, -1, 0, 0), + 'COLUMN' => array(9, -1, 0, 0), + 'NA' => array(10, 0, 0, 0), + 'NPV' => array(11, -1, 1, 0), + 'STDEV' => array(12, -1, 0, 0), + 'DOLLAR' => array(13, -1, 1, 0), + 'FIXED' => array(14, -1, 1, 0), + 'SIN' => array(15, 1, 1, 0), + 'COS' => array(16, 1, 1, 0), + 'TAN' => array(17, 1, 1, 0), + 'ATAN' => array(18, 1, 1, 0), + 'PI' => array(19, 0, 1, 0), + 'SQRT' => array(20, 1, 1, 0), + 'EXP' => array(21, 1, 1, 0), + 'LN' => array(22, 1, 1, 0), + 'LOG10' => array(23, 1, 1, 0), + 'ABS' => array(24, 1, 1, 0), + 'INT' => array(25, 1, 1, 0), + 'SIGN' => array(26, 1, 1, 0), + 'ROUND' => array(27, 2, 1, 0), + 'LOOKUP' => array(28, -1, 0, 0), + 'INDEX' => array(29, -1, 0, 1), + 'REPT' => array(30, 2, 1, 0), + 'MID' => array(31, 3, 1, 0), + 'LEN' => array(32, 1, 1, 0), + 'VALUE' => array(33, 1, 1, 0), + 'TRUE' => array(34, 0, 1, 0), + 'FALSE' => array(35, 0, 1, 0), + 'AND' => array(36, -1, 0, 0), + 'OR' => array(37, -1, 0, 0), + 'NOT' => array(38, 1, 1, 0), + 'MOD' => array(39, 2, 1, 0), + 'DCOUNT' => array(40, 3, 0, 0), + 'DSUM' => array(41, 3, 0, 0), + 'DAVERAGE' => array(42, 3, 0, 0), + 'DMIN' => array(43, 3, 0, 0), + 'DMAX' => array(44, 3, 0, 0), + 'DSTDEV' => array(45, 3, 0, 0), + 'VAR' => array(46, -1, 0, 0), + 'DVAR' => array(47, 3, 0, 0), + 'TEXT' => array(48, 2, 1, 0), + 'LINEST' => array(49, -1, 0, 0), + 'TREND' => array(50, -1, 0, 0), + 'LOGEST' => array(51, -1, 0, 0), + 'GROWTH' => array(52, -1, 0, 0), + 'PV' => array(56, -1, 1, 0), + 'FV' => array(57, -1, 1, 0), + 'NPER' => array(58, -1, 1, 0), + 'PMT' => array(59, -1, 1, 0), + 'RATE' => array(60, -1, 1, 0), + 'MIRR' => array(61, 3, 0, 0), + 'IRR' => array(62, -1, 0, 0), + 'RAND' => array(63, 0, 1, 1), + 'MATCH' => array(64, -1, 0, 0), + 'DATE' => array(65, 3, 1, 0), + 'TIME' => array(66, 3, 1, 0), + 'DAY' => array(67, 1, 1, 0), + 'MONTH' => array(68, 1, 1, 0), + 'YEAR' => array(69, 1, 1, 0), + 'WEEKDAY' => array(70, -1, 1, 0), + 'HOUR' => array(71, 1, 1, 0), + 'MINUTE' => array(72, 1, 1, 0), + 'SECOND' => array(73, 1, 1, 0), + 'NOW' => array(74, 0, 1, 1), + 'AREAS' => array(75, 1, 0, 1), + 'ROWS' => array(76, 1, 0, 1), + 'COLUMNS' => array(77, 1, 0, 1), + 'OFFSET' => array(78, -1, 0, 1), + 'SEARCH' => array(82, -1, 1, 0), + 'TRANSPOSE' => array(83, 1, 1, 0), + 'TYPE' => array(86, 1, 1, 0), + 'ATAN2' => array(97, 2, 1, 0), + 'ASIN' => array(98, 1, 1, 0), + 'ACOS' => array(99, 1, 1, 0), + 'CHOOSE' => array(100, -1, 1, 0), + 'HLOOKUP' => array(101, -1, 0, 0), + 'VLOOKUP' => array(102, -1, 0, 0), + 'ISREF' => array(105, 1, 0, 0), + 'LOG' => array(109, -1, 1, 0), + 'CHAR' => array(111, 1, 1, 0), + 'LOWER' => array(112, 1, 1, 0), + 'UPPER' => array(113, 1, 1, 0), + 'PROPER' => array(114, 1, 1, 0), + 'LEFT' => array(115, -1, 1, 0), + 'RIGHT' => array(116, -1, 1, 0), + 'EXACT' => array(117, 2, 1, 0), + 'TRIM' => array(118, 1, 1, 0), + 'REPLACE' => array(119, 4, 1, 0), + 'SUBSTITUTE' => array(120, -1, 1, 0), + 'CODE' => array(121, 1, 1, 0), + 'FIND' => array(124, -1, 1, 0), + 'CELL' => array(125, -1, 0, 1), + 'ISERR' => array(126, 1, 1, 0), + 'ISTEXT' => array(127, 1, 1, 0), + 'ISNUMBER' => array(128, 1, 1, 0), + 'ISBLANK' => array(129, 1, 1, 0), + 'T' => array(130, 1, 0, 0), + 'N' => array(131, 1, 0, 0), + 'DATEVALUE' => array(140, 1, 1, 0), + 'TIMEVALUE' => array(141, 1, 1, 0), + 'SLN' => array(142, 3, 1, 0), + 'SYD' => array(143, 4, 1, 0), + 'DDB' => array(144, -1, 1, 0), + 'INDIRECT' => array(148, -1, 1, 1), + 'CALL' => array(150, -1, 1, 0), + 'CLEAN' => array(162, 1, 1, 0), + 'MDETERM' => array(163, 1, 2, 0), + 'MINVERSE' => array(164, 1, 2, 0), + 'MMULT' => array(165, 2, 2, 0), + 'IPMT' => array(167, -1, 1, 0), + 'PPMT' => array(168, -1, 1, 0), + 'COUNTA' => array(169, -1, 0, 0), + 'PRODUCT' => array(183, -1, 0, 0), + 'FACT' => array(184, 1, 1, 0), + 'DPRODUCT' => array(189, 3, 0, 0), + 'ISNONTEXT' => array(190, 1, 1, 0), + 'STDEVP' => array(193, -1, 0, 0), + 'VARP' => array(194, -1, 0, 0), + 'DSTDEVP' => array(195, 3, 0, 0), + 'DVARP' => array(196, 3, 0, 0), + 'TRUNC' => array(197, -1, 1, 0), + 'ISLOGICAL' => array(198, 1, 1, 0), + 'DCOUNTA' => array(199, 3, 0, 0), + 'ROUNDUP' => array(212, 2, 1, 0), + 'ROUNDDOWN' => array(213, 2, 1, 0), + 'RANK' => array(216, -1, 0, 0), + 'ADDRESS' => array(219, -1, 1, 0), + 'DAYS360' => array(220, -1, 1, 0), + 'TODAY' => array(221, 0, 1, 1), + 'VDB' => array(222, -1, 1, 0), + 'MEDIAN' => array(227, -1, 0, 0), + 'SUMPRODUCT' => array(228, -1, 2, 0), + 'SINH' => array(229, 1, 1, 0), + 'COSH' => array(230, 1, 1, 0), + 'TANH' => array(231, 1, 1, 0), + 'ASINH' => array(232, 1, 1, 0), + 'ACOSH' => array(233, 1, 1, 0), + 'ATANH' => array(234, 1, 1, 0), + 'DGET' => array(235, 3, 0, 0), + 'INFO' => array(244, 1, 1, 1), + 'DB' => array(247, -1, 1, 0), + 'FREQUENCY' => array(252, 2, 0, 0), + 'ERROR.TYPE' => array(261, 1, 1, 0), + 'REGISTER.ID' => array(267, -1, 1, 0), + 'AVEDEV' => array(269, -1, 0, 0), + 'BETADIST' => array(270, -1, 1, 0), + 'GAMMALN' => array(271, 1, 1, 0), + 'BETAINV' => array(272, -1, 1, 0), + 'BINOMDIST' => array(273, 4, 1, 0), + 'CHIDIST' => array(274, 2, 1, 0), + 'CHIINV' => array(275, 2, 1, 0), + 'COMBIN' => array(276, 2, 1, 0), + 'CONFIDENCE' => array(277, 3, 1, 0), + 'CRITBINOM' => array(278, 3, 1, 0), + 'EVEN' => array(279, 1, 1, 0), + 'EXPONDIST' => array(280, 3, 1, 0), + 'FDIST' => array(281, 3, 1, 0), + 'FINV' => array(282, 3, 1, 0), + 'FISHER' => array(283, 1, 1, 0), + 'FISHERINV' => array(284, 1, 1, 0), + 'FLOOR' => array(285, 2, 1, 0), + 'GAMMADIST' => array(286, 4, 1, 0), + 'GAMMAINV' => array(287, 3, 1, 0), + 'CEILING' => array(288, 2, 1, 0), + 'HYPGEOMDIST' => array(289, 4, 1, 0), + 'LOGNORMDIST' => array(290, 3, 1, 0), + 'LOGINV' => array(291, 3, 1, 0), + 'NEGBINOMDIST' => array(292, 3, 1, 0), + 'NORMDIST' => array(293, 4, 1, 0), + 'NORMSDIST' => array(294, 1, 1, 0), + 'NORMINV' => array(295, 3, 1, 0), + 'NORMSINV' => array(296, 1, 1, 0), + 'STANDARDIZE' => array(297, 3, 1, 0), + 'ODD' => array(298, 1, 1, 0), + 'PERMUT' => array(299, 2, 1, 0), + 'POISSON' => array(300, 3, 1, 0), + 'TDIST' => array(301, 3, 1, 0), + 'WEIBULL' => array(302, 4, 1, 0), + 'SUMXMY2' => array(303, 2, 2, 0), + 'SUMX2MY2' => array(304, 2, 2, 0), + 'SUMX2PY2' => array(305, 2, 2, 0), + 'CHITEST' => array(306, 2, 2, 0), + 'CORREL' => array(307, 2, 2, 0), + 'COVAR' => array(308, 2, 2, 0), + 'FORECAST' => array(309, 3, 2, 0), + 'FTEST' => array(310, 2, 2, 0), + 'INTERCEPT' => array(311, 2, 2, 0), + 'PEARSON' => array(312, 2, 2, 0), + 'RSQ' => array(313, 2, 2, 0), + 'STEYX' => array(314, 2, 2, 0), + 'SLOPE' => array(315, 2, 2, 0), + 'TTEST' => array(316, 4, 2, 0), + 'PROB' => array(317, -1, 2, 0), + 'DEVSQ' => array(318, -1, 0, 0), + 'GEOMEAN' => array(319, -1, 0, 0), + 'HARMEAN' => array(320, -1, 0, 0), + 'SUMSQ' => array(321, -1, 0, 0), + 'KURT' => array(322, -1, 0, 0), + 'SKEW' => array(323, -1, 0, 0), + 'ZTEST' => array(324, -1, 0, 0), + 'LARGE' => array(325, 2, 0, 0), + 'SMALL' => array(326, 2, 0, 0), + 'QUARTILE' => array(327, 2, 0, 0), + 'PERCENTILE' => array(328, 2, 0, 0), + 'PERCENTRANK' => array(329, -1, 0, 0), + 'MODE' => array(330, -1, 2, 0), + 'TRIMMEAN' => array(331, 2, 0, 0), + 'TINV' => array(332, 2, 1, 0), + 'CONCATENATE' => array(336, -1, 1, 0), + 'POWER' => array(337, 2, 1, 0), + 'RADIANS' => array(342, 1, 1, 0), + 'DEGREES' => array(343, 1, 1, 0), + 'SUBTOTAL' => array(344, -1, 0, 0), + 'SUMIF' => array(345, -1, 0, 0), + 'COUNTIF' => array(346, 2, 0, 0), + 'COUNTBLANK' => array(347, 1, 0, 0), + 'ROMAN' => array(354, -1, 1, 0), ); } @@ -1712,4 +1713,4 @@ public function toReversePolish($tree = array()) $polish .= $converted_tree; return $polish; } -} \ No newline at end of file +} diff --git a/Spreadsheet/Excel/Writer/Validator.php b/Spreadsheet/Excel/Writer/Validator.php index e2bd4cf..36123e1 100644 --- a/Spreadsheet/Excel/Writer/Validator.php +++ b/Spreadsheet/Excel/Writer/Validator.php @@ -1,4 +1,5 @@ * @@ -225,4 +226,4 @@ public function setCol($col, $row1, $row2, $incell = true) $this->_incell = $incell; //$this->_formula1 = ...; } -}*/ \ No newline at end of file +}*/ diff --git a/Spreadsheet/Excel/Writer/Workbook.php b/Spreadsheet/Excel/Writer/Workbook.php index 54e50f1..fbc5e11 100644 --- a/Spreadsheet/Excel/Writer/Workbook.php +++ b/Spreadsheet/Excel/Writer/Workbook.php @@ -1,4 +1,5 @@ * @@ -903,9 +904,6 @@ protected function _storeNames() } } - - - /****************************************************************************** * * BIFF RECORDS @@ -1048,7 +1046,6 @@ protected function _storeStyle() $this->_append($header . $data); } - /** * Writes Excel FORMAT record for non "built-in" numerical formats. * @@ -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. @@ -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 @@ -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. @@ -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 @@ -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 @@ -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; @@ -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 @@ -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) { @@ -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); @@ -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. @@ -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); @@ -1648,6 +1630,4 @@ protected function _storeSharedStringsTable() } } - } - diff --git a/Spreadsheet/Excel/Writer/Worksheet.php b/Spreadsheet/Excel/Writer/Worksheet.php index 840d715..760c898 100644 --- a/Spreadsheet/Excel/Writer/Worksheet.php +++ b/Spreadsheet/Excel/Writer/Worksheet.php @@ -1,4 +1,5 @@ * @@ -503,7 +504,7 @@ public function __construct($BIFF_version, $name, $this->_dim_colmin = $colmax + 1; $this->_dim_colmax = 0; $this->_colinfo = array(); - $this->_selection = array(0,0,0,0); + $this->_selection = array(0, 0, 0, 0); $this->_panes = array(); $this->_active_pane = 3; $this->_frozen = 0; @@ -921,7 +922,7 @@ public function setColumn($firstcol, $lastcol, $width, $format = null, $hidden = */ public function setSelection($first_row,$first_column,$last_row,$last_column) { - $this->_selection = array($first_row,$first_column,$last_row,$last_column); + $this->_selection = array($first_row, $first_column, $last_row, $last_column); } /** @@ -989,7 +990,6 @@ public function setPaper($size = 0) $this->_paper_size = $size; } - /** * Set the page header caption and optional margin. * @@ -1179,7 +1179,6 @@ public function printArea($first_row, $first_col, $last_row, $last_col) $this->print_colmax = $last_col; } - /** * Set the option to hide gridlines on the printed page. * @@ -1255,7 +1254,6 @@ public function setVPagebreaks($breaks) } } - /** * Set the worksheet zoom factor. * @@ -1404,14 +1402,12 @@ protected function _XF($format) } } - /****************************************************************************** ******************************************************************************* * * Internal methods */ - /** * Store Worksheet data in memory using the parent's class append() or to a * temporary file, the default. @@ -1569,7 +1565,6 @@ public function setRTL($rtl = true) * BIFF RECORDS */ - /** * Write a double to the specified row and column (zero indexed). * An integer can be written as a double. Excel will display an @@ -1926,7 +1921,6 @@ public function writeFormula($row, $col, $formula, $format = null) $grbit = 0x03; // Option flags $unknown = 0x0000; // Must be zero - // Check that row and col are valid and store max and min values if ($this->_checkRowCol($row, $col) == false) { return -2; @@ -2027,7 +2021,6 @@ protected function _writeUrlRange($row1, $col1, $row2, $col2, $url, $string = '' return ($this->_writeUrlWeb($row1, $col1, $row2, $col2, $url, $string, $format)); } - /** * Used to write http, ftp and mailto hyperlinks. * The link type ($options) is 0x03 is the same as absolute dir ref without @@ -2236,8 +2229,6 @@ protected function _writeUrlExternal($row1, $col1, $row2, $col2, $url, $str, $fo $link_type |= 0x08; } - - // Pack the link type $link_type = pack("V", $link_type); @@ -2288,7 +2279,6 @@ protected function _writeUrlExternal($row1, $col1, $row2, $col2, $url, $str, $fo return ($str_error); } - /** * This method is used to set the height and format for a row. * @@ -2325,7 +2315,6 @@ public function setRow($row, $height, $format = null, $hidden = false, $level = $level = max(0, min($level, 7)); // level should be between 0 and 7 $this->_outline_row_level = max($level, $this->_outline_row_level); - // Set the options flags. fUnsynced is used to show that the font and row // heights are not compatible. This is usually the case for WriteExcel. // The collapsed flag 0x10 doesn't seem to be used to indicate that a row @@ -2393,7 +2382,6 @@ protected function _storeWindow2() $rwTop = 0x0000; // Top row visible in window $colLeft = 0x0000; // Leftmost column visible in window - // The options flags that comprise $grbit $fDspFmla = 0; // 0 - bit $fDspGrid = $this->_screen_gridlines; // 1 @@ -2571,8 +2559,9 @@ protected function _storeMergedCells() $length = 2 + count($ranges) * 8; $header = pack('vv', $record, $length); $data = pack('v', count($ranges)); - foreach ($ranges as $range) + foreach ($ranges as $range) { $data .= pack('vvvv', $range[0], $range[2], $range[1], $range[3]); + } $string = $header.$data; $this->_append($string, true); } @@ -2688,7 +2677,6 @@ protected function _storePanes($panes) $x = 113.879*$x + 390; } - // Determine which pane should be active. There is also the undocumented // option to override this should it be necessary: may be removed later. // @@ -3082,7 +3070,6 @@ protected function _storeGuts() $this->_prepend($header.$data); } - /** * Write the WSBOOL BIFF record, mainly for fit-to-page. Used in conjunction * with the SETUP record. @@ -3168,7 +3155,6 @@ protected function _storeHbreak() $this->_prepend($header.$data); } - /** * Write the VERTICALPAGEBREAKS BIFF record. * @@ -3260,7 +3246,6 @@ protected function _storePassword() $this->_prepend($header . $data); } - /** * Insert a 24bit bitmap image in a worksheet. * @@ -3499,7 +3484,6 @@ protected function _storeObjPicture($colL,$dxL,$rwT,$dyT,$colR,$dxR,$rwB,$dyB) $grbit2 = 0x0001; // Option flags $Reserved5 = 0x0000; // Reserved - $header = pack("vv", $record, $length); $data = pack("V", $cObj); $data .= pack("v", $OT);