PSR2 Fixes

This commit is contained in:
Progi1984 2015-05-17 15:00:02 +02:00
parent 1d842ed218
commit 09352e3e80
52 changed files with 3250 additions and 3204 deletions

View File

@ -387,7 +387,8 @@ class PHPExcel_Reader_CSV extends PHPExcel_Reader_Abstract implements PHPExcel_R
*
* @return boolean
*/
public function getContiguous(){
public function getContiguous()
{
return $this->_contiguous;
}
}

View File

@ -998,16 +998,14 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
// Standard filters are always an OR join, so no join rule needs to be set
// Entries can be either filter elements
foreach ($filters->filter as $filterRule) {
$column->createRule()->setRule(
null,// Operator is undefined, but always treated as EQUAL
(string) $filterRule["val"]
)
->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER);
// Operator is undefined, but always treated as EQUAL
$column->createRule()->setRule(null, (string) $filterRule["val"])->setRuleType(PHPExcel_Worksheet_AutoFilter_Column_Rule::AUTOFILTER_RULETYPE_FILTER);
}
// Or Date Group elements
foreach ($filters->dateGroupItem as $dateGroupItem) {
$column->createRule()->setRule(
null,// Operator is undefined, but always treated as EQUAL
// Operator is undefined, but always treated as EQUAL
null,
array(
'year' => (string) $dateGroupItem["year"],
'month' => (string) $dateGroupItem["month"],
@ -1044,7 +1042,8 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE
// We should only ever have one dynamic filter
foreach ($filterColumn->dynamicFilter as $filterRule) {
$column->createRule()->setRule(
null,// Operator is undefined, but always treated as EQUAL
// Operator is undefined, but always treated as EQUAL
null,
(string) $filterRule["val"],
(string) $filterRule["type"]
)

View File

@ -81,21 +81,21 @@ class PHPExcel_Reader_Excel2007_Chart
foreach ($chartDetails as $chartDetailKey => $chartDetail) {
switch ($chartDetailKey) {
case "layout":
$plotAreaLayout = self::_chartLayoutDetails($chartDetail, $namespacesChartMeta,'plotArea');
$plotAreaLayout = self::_chartLayoutDetails($chartDetail, $namespacesChartMeta, 'plotArea');
break;
case "catAx":
if (isset($chartDetail->title)) {
$XaxisLabel = self::_chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta,'cat');
$XaxisLabel = self::_chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat');
}
break;
case "dateAx":
if (isset($chartDetail->title)) {
$XaxisLabel = self::_chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta,'cat');
$XaxisLabel = self::_chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat');
}
break;
case "valAx":
if (isset($chartDetail->title)) {
$YaxisLabel = self::_chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta,'cat');
$YaxisLabel = self::_chartTitle($chartDetail->title->children($namespacesChartMeta['c']), $namespacesChartMeta, 'cat');
}
break;
case "barChart":
@ -173,7 +173,7 @@ class PHPExcel_Reader_Excel2007_Chart
$dispBlanksAs = self::_getAttribute($chartDetails, 'val', 'string');
break;
case "title":
$title = self::_chartTitle($chartDetails, $namespacesChartMeta,'title');
$title = self::_chartTitle($chartDetails, $namespacesChartMeta, 'title');
break;
case "legend":
$legendPos = 'r';
@ -188,7 +188,7 @@ class PHPExcel_Reader_Excel2007_Chart
$legendOverlay = self::_getAttribute($chartDetail, 'val', 'boolean');
break;
case "layout":
$legendLayout = self::_chartLayoutDetails($chartDetail, $namespacesChartMeta,'legend');
$legendLayout = self::_chartLayoutDetails($chartDetail, $namespacesChartMeta, 'legend');
break;
}
}
@ -239,7 +239,7 @@ class PHPExcel_Reader_Excel2007_Chart
}
$layout = array();
foreach ($details as $detailKey => $detail) {
// echo $detailKey,' => ',self::_getAttribute($detail, 'val', 'string'),PHP_EOL;
// echo $detailKey, ' => ',self::_getAttribute($detail, 'val', 'string'),PHP_EOL;
$layout[$detailKey] = self::_getAttribute($detail, 'val', 'string');
}
return new PHPExcel_Chart_Layout($layout);
@ -300,7 +300,7 @@ class PHPExcel_Reader_Excel2007_Chart
{
if (isset($seriesDetail->strRef)) {
$seriesSource = (string) $seriesDetail->strRef->f;
$seriesData = self::_chartDataSeriesValues($seriesDetail->strRef->strCache->children($namespacesChartMeta['c']),'s');
$seriesData = self::_chartDataSeriesValues($seriesDetail->strRef->strCache->children($namespacesChartMeta['c']), 's');
return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
} elseif (isset($seriesDetail->numRef)) {
@ -310,13 +310,13 @@ class PHPExcel_Reader_Excel2007_Chart
return new PHPExcel_Chart_DataSeriesValues('Number', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
} elseif (isset($seriesDetail->multiLvlStrRef)) {
$seriesSource = (string) $seriesDetail->multiLvlStrRef->f;
$seriesData = self::_chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlStrRef->multiLvlStrCache->children($namespacesChartMeta['c']),'s');
$seriesData = self::_chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlStrRef->multiLvlStrCache->children($namespacesChartMeta['c']), 's');
$seriesData['pointCount'] = count($seriesData['dataValues']);
return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
} elseif (isset($seriesDetail->multiLvlNumRef)) {
$seriesSource = (string) $seriesDetail->multiLvlNumRef->f;
$seriesData = self::_chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlNumRef->multiLvlNumCache->children($namespacesChartMeta['c']),'s');
$seriesData = self::_chartDataSeriesValuesMultiLevel($seriesDetail->multiLvlNumRef->multiLvlNumCache->children($namespacesChartMeta['c']), 's');
$seriesData['pointCount'] = count($seriesData['dataValues']);
return new PHPExcel_Chart_DataSeriesValues('String', $seriesSource, $seriesData['formatCode'], $seriesData['pointCount'], $seriesData['dataValues'], $marker, $smoothLine);
@ -400,7 +400,7 @@ class PHPExcel_Reader_Excel2007_Chart
foreach ($titleDetailPart as $titleDetailElementKey => $titleDetailElement) {
if (isset($titleDetailElement->t)) {
$objText = $value->createTextRun( (string) $titleDetailElement->t );
$objText = $value->createTextRun((string) $titleDetailElement->t);
}
if (isset($titleDetailElement->rPr)) {
if (isset($titleDetailElement->rPr->rFont["val"])) {
@ -414,7 +414,7 @@ class PHPExcel_Reader_Excel2007_Chart
$fontColor = (self::_getAttribute($titleDetailElement->rPr, 'color', 'string'));
if (!is_null($fontColor)) {
$objText->getFont()->setColor( new PHPExcel_Style_Color( self::_readColor($fontColor) ) );
$objText->getFont()->setColor(new PHPExcel_Style_Color(self::_readColor($fontColor)));
}
$bold = self::_getAttribute($titleDetailElement->rPr, 'b', 'boolean');
@ -495,25 +495,25 @@ class PHPExcel_Reader_Excel2007_Chart
{
foreach ($plotAttributes as $plotAttributeKey => $plotAttributeValue) {
switch ($plotAttributeKey) {
case 'showLegendKey' :
case 'showLegendKey':
$plotArea->setShowLegendKey($plotAttributeValue);
break;
case 'showVal' :
case 'showVal':
$plotArea->setShowVal($plotAttributeValue);
break;
case 'showCatName' :
case 'showCatName':
$plotArea->setShowCatName($plotAttributeValue);
break;
case 'showSerName' :
case 'showSerName':
$plotArea->setShowSerName($plotAttributeValue);
break;
case 'showPercent' :
case 'showPercent':
$plotArea->setShowPercent($plotAttributeValue);
break;
case 'showBubbleSize' :
case 'showBubbleSize':
$plotArea->setShowBubbleSize($plotAttributeValue);
break;
case 'showLeaderLines' :
case 'showLeaderLines':
$plotArea->setShowLeaderLines($plotAttributeValue);
break;
}

View File

@ -559,7 +559,6 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// Parse the individual sheets
foreach ($this->_sheets as $sheet) {
if ($sheet['sheetType'] != 0x00) {
// 0x00: Worksheet
// 0x02: Chart
@ -811,7 +810,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in formula
// cells... during the load, all formulae should be correct, and we're simply bringing the worksheet
// name in line with the formula, not the reverse
$this->_phpSheet->setTitle($sheet['name'],false);
$this->_phpSheet->setTitle($sheet['name'], false);
$this->_phpSheet->setSheetState($sheet['sheetState']);
$this->_pos = $sheet['offset'];
@ -1133,7 +1132,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// echo '<b>Cell annotation ', $note,'</b><br />';
// var_dump($noteDetails);
// echo '<br />';
$cellAddress = str_replace('$','', $noteDetails['cellRef']);
$cellAddress = str_replace('$', '', $noteDetails['cellRef']);
$this->_phpSheet->getComment($cellAddress)->setAuthor($noteDetails['author'])->setText($this->_parseRichText($noteDetails['objTextData']['text']));
}
}
@ -1185,7 +1184,6 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$explodes = explode('!', $range);
if (count($explodes) == 2) {
if ($docSheet = $this->_phpExcel->getSheetByName($explodes[0])) {
$extractedRange = $explodes[1];
$extractedRange = str_replace('$', '', $extractedRange);
@ -1213,7 +1211,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
if (count($explodes) == 2) {
if (($docSheet = $this->_phpExcel->getSheetByName($explodes[0])) ||
($docSheet = $this->_phpExcel->getSheetByName(trim($explodes[0],"'")))) {
($docSheet = $this->_phpExcel->getSheetByName(trim($explodes[0], "'")))) {
$extractedRange = $explodes[1];
$extractedRange = str_replace('$', '', $extractedRange);
@ -1639,7 +1637,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
}
// echo 'Note Address=', $cellAddress,'<br />';
$cellAddress = str_replace('$','', $cellAddress);
$cellAddress = str_replace('$', '', $cellAddress);
$noteLength = self::_GetInt2d($recordData, 4);
$noteText = trim(substr($recordData, 6));
// echo 'Note Length=', $noteLength,'<br />';
@ -1965,12 +1963,16 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// bit: 0; mask 0x0001; bold (redundant in BIFF5-BIFF8)
// bit: 1; mask 0x0002; italic
$isItalic = (0x0002 & self::_GetInt2d($recordData, 2)) >> 1;
if ($isItalic) $objFont->setItalic(true);
if ($isItalic) {
$objFont->setItalic(true);
}
// bit: 2; mask 0x0004; underlined (redundant in BIFF5-BIFF8)
// bit: 3; mask 0x0008; strike
$isStrike = (0x0008 & self::_GetInt2d($recordData, 2)) >> 3;
if ($isStrike) $objFont->setStrikethrough(true);
if ($isStrike) {
$objFont->setStrikethrough(true);
}
// offset: 4; size: 2; colour index
$colorIndex = self::_GetInt2d($recordData, 4);
@ -2891,7 +2893,6 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// loop through the Unicode strings (16-bit length)
for ($i = 0; $i < $nm; ++$i) {
// number of characters in the Unicode string
$numChars = self::_GetInt2d($recordData, $pos);
$pos += 2;
@ -3923,21 +3924,18 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
} elseif ((ord($recordData{6}) == 1)
&& (ord($recordData{12}) == 255)
&& (ord($recordData{13}) == 255)) {
// Boolean formula. Result is in +2; 0=false, 1=true
$dataType = PHPExcel_Cell_DataType::TYPE_BOOL;
$value = (bool) ord($recordData{8});
} elseif ((ord($recordData{6}) == 2)
&& (ord($recordData{12}) == 255)
&& (ord($recordData{13}) == 255)) {
// Error formula. Error code is in +2
$dataType = PHPExcel_Cell_DataType::TYPE_ERROR;
$value = self::_mapErrorCode(ord($recordData{8}));
} elseif ((ord($recordData{6}) == 3)
&& (ord($recordData{12}) == 255)
&& (ord($recordData{13}) == 255)) {
// Formula result is a null string
$dataType = PHPExcel_Cell_DataType::TYPE_NULL;
$value = '';
@ -4352,7 +4350,8 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
/**
* Read PLV Record(Created by Excel2007 or upper)
*/
private function _readPageLayoutView() {
private function _readPageLayoutView()
{
$length = self::_GetInt2d($this->_data, $this->_pos + 2);
$recordData = $this->_readRecordData($this->_data, $this->_pos + 4, $length);
@ -4528,7 +4527,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
if ($this->_version == self::XLS_BIFF8 && !$this->_readDataOnly) {
$cellRangeAddressList = $this->_readBIFF8CellRangeAddressList($recordData);
foreach ($cellRangeAddressList['cellRangeAddresses'] as $cellRangeAddress) {
if ((strpos($cellRangeAddress,':') !== false) &&
if ((strpos($cellRangeAddress, ':') !== false) &&
($this->_includeCellRangeFiltered($cellRangeAddress))) {
$this->_phpSheet->mergeCells($cellRangeAddress);
}
@ -4620,8 +4619,9 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
// offset: var; size: $us; character array of the URL, no Unicode string header, always 16-bit characters, zero-terminated
$url = self::_encodeUTF16(substr($recordData, $offset, $us - 2), false);
$nullOffset = strpos($url, 0x00);
if ($nullOffset)
$url = substr($url,0, $nullOffset);
if ($nullOffset) {
$url = substr($url, 0, $nullOffset);
}
$url .= $hasText ? '#' : '';
$offset += $us;
break;
@ -7468,13 +7468,13 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$mantissa = (0x100000 | ($rknumhigh & 0x000fffff));
$mantissalow1 = ($rknumlow & 0x80000000) >> 31;
$mantissalow2 = ($rknumlow & 0x7fffffff);
$value = $mantissa / pow(2 , (20 - $exp));
$value = $mantissa / pow(2, (20 - $exp));
if ($mantissalow1 != 0) {
$value += 1 / pow (2 , (21 - $exp));
$value += 1 / pow (2, (21 - $exp));
}
$value += $mantissalow2 / pow (2 , (52 - $exp));
$value += $mantissalow2 / pow (2, (52 - $exp));
if ($sign) {
$value *= -1;
}
@ -7496,7 +7496,7 @@ class PHPExcel_Reader_Excel5 extends PHPExcel_Reader_Abstract implements PHPExce
$sign = ($rknum & 0x80000000) >> 31;
$exp = ($rknum & 0x7ff00000) >> 20;
$mantissa = (0x100000 | ($rknum & 0x000ffffc));
$value = $mantissa / pow(2 , (20- ($exp - 1023)));
$value = $mantissa / pow(2, (20- ($exp - 1023)));
if ($sign) {
$value = -1 * $value;
}

View File

@ -115,7 +115,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$xml = new XMLReader();
$xml->xml($this->securityScanFile('compress.zlib://'.realpath($pFilename)), null, PHPExcel_Settings::getLibXmlLoaderOptions());
$xml->setParserProperty(2,true);
$xml->setParserProperty(2, true);
$worksheetNames = array();
while ($xml->read()) {
@ -467,7 +467,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
}
if ((!$this->_readDataOnly) && (isset($sheet->Objects))) {
foreach ($sheet->Objects->children('gnm',TRUE) as $key => $comment) {
foreach ($sheet->Objects->children('gnm', true) as $key => $comment) {
$commentAttributes = $comment->attributes();
// Only comment objects are handled at the moment
if ($commentAttributes->Text) {
@ -481,7 +481,6 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
$styleAttributes = $styleRegion->attributes();
if (($styleAttributes['startRow'] <= $maxRow) &&
($styleAttributes['startCol'] <= $maxCol)) {
$startColumn = PHPExcel_Cell::stringFromColumnIndex((int) $styleAttributes['startCol']);
$startRow = $styleAttributes['startRow'] + 1;
@ -748,7 +747,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
// Handle Merged Cells in this worksheet
if (isset($sheet->MergedRegions)) {
foreach ($sheet->MergedRegions->Merge as $mergeCells) {
if (strpos($mergeCells,':') !== false) {
if (strpos($mergeCells, ':') !== false) {
$objPHPExcel->getActiveSheet()->mergeCells($mergeCells);
}
}
@ -767,7 +766,7 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
}
$range = explode('!', $range);
$range[0] = trim($range[0],"'");;
$range[0] = trim($range[0], "'");
if ($worksheet = $objPHPExcel->getSheetByName($range[0])) {
$extractedRange = str_replace('$', '', $range[1]);
$objPHPExcel->addNamedRange(new PHPExcel_NamedRange($name, $worksheet, $extractedRange));
@ -844,7 +843,8 @@ class PHPExcel_Reader_Gnumeric extends PHPExcel_Reader_Abstract implements PHPEx
return $value;
}
private static function _parseGnumericColour($gnmColour) {
private static function _parseGnumericColour($gnmColour)
{
list($gnmR, $gnmG, $gnmB) = explode(':', $gnmColour);
$gnmR = substr(str_pad($gnmR, 4, '0', STR_PAD_RIGHT), 0, 2);
$gnmG = substr(str_pad($gnmG, 4, '0', STR_PAD_RIGHT), 0, 2);

View File

@ -54,7 +54,8 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
/**
* Create a new PHPExcel_Reader_OOCalc
*/
public function __construct() {
public function __construct()
{
$this->_readFilter = new PHPExcel_Reader_DefaultReadFilter();
}
@ -304,7 +305,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
return $this->loadIntoExisting($pFilename, $objPHPExcel);
}
private static function identifyFixedStyleValue($styleList,&$styleAttributeValue)
private static function identifyFixedStyleValue($styleList, &$styleAttributeValue)
{
$styleAttributeValue = strtolower($styleAttributeValue);
foreach ($styleList as $style) {
@ -358,22 +359,22 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
foreach ($officePropertyDC as $propertyName => $propertyValue) {
$propertyValue = (string) $propertyValue;
switch ($propertyName) {
case 'title' :
case 'title':
$docProps->setTitle($propertyValue);
break;
case 'subject' :
case 'subject':
$docProps->setSubject($propertyValue);
break;
case 'creator' :
case 'creator':
$docProps->setCreator($propertyValue);
$docProps->setLastModifiedBy($propertyValue);
break;
case 'date' :
case 'date':
$creationDate = strtotime($propertyValue);
$docProps->setCreated($creationDate);
$docProps->setModified($creationDate);
break;
case 'description' :
case 'description':
$docProps->setDescription($propertyValue);
break;
}
@ -386,36 +387,36 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
$propertyValueAttributes = $propertyValue->attributes($namespacesMeta['meta']);
$propertyValue = (string) $propertyValue;
switch ($propertyName) {
case 'initial-creator' :
case 'initial-creator':
$docProps->setCreator($propertyValue);
break;
case 'keyword' :
case 'keyword':
$docProps->setKeywords($propertyValue);
break;
case 'creation-date' :
case 'creation-date':
$creationDate = strtotime($propertyValue);
$docProps->setCreated($creationDate);
break;
case 'user-defined' :
case 'user-defined':
$propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_STRING;
foreach ($propertyValueAttributes as $key => $value) {
if ($key == 'name') {
$propertyValueName = (string) $value;
} elseif ($key == 'value-type') {
switch ($value) {
case 'date' :
case 'date':
$propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue, 'date');
$propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_DATE;
break;
case 'boolean' :
case 'boolean':
$propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue, 'bool');
$propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_BOOLEAN;
break;
case 'float' :
case 'float':
$propertyValue = PHPExcel_DocumentProperties::convertProperty($propertyValue, 'r4');
$propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_FLOAT;
break;
default :
default:
$propertyValueType = PHPExcel_DocumentProperties::PROPERTY_TYPE_STRING;
}
}
@ -459,7 +460,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
// Use false for $updateFormulaCellReferences to prevent adjustment of worksheet references in
// formula cells... during the load, all formulae should be correct, and we're simply
// bringing the worksheet name in line with the formula, not the reverse
$objPHPExcel->getActiveSheet()->setTitle($worksheetName,false);
$objPHPExcel->getActiveSheet()->setTitle($worksheetName, false);
}
$rowID = 1;
@ -471,10 +472,9 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
$rowData = $cellData;
break;
}
case 'table-row' :
case 'table-row':
$rowDataTableAttributes = $rowData->attributes($namespacesContent['table']);
$rowRepeats = (isset($rowDataTableAttributes['number-rows-repeated'])) ?
$rowDataTableAttributes['number-rows-repeated'] : 1;
$rowRepeats = (isset($rowDataTableAttributes['number-rows-repeated'])) ? $rowDataTableAttributes['number-rows-repeated'] : 1;
$columnID = 'A';
foreach ($rowData as $key => $cellData) {
if ($this->getReadFilter() !== null) {
@ -484,9 +484,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
}
// echo '<b>'.$columnID.$rowID.'</b><br />';
$cellDataText = (isset($namespacesContent['text'])) ?
$cellData->children($namespacesContent['text']) :
'';
$cellDataText = (isset($namespacesContent['text'])) ? $cellData->children($namespacesContent['text']) : '';
$cellDataOffice = $cellData->children($namespacesContent['office']);
$cellDataOfficeAttributes = $cellData->attributes($namespacesContent['office']);
$cellDataTableAttributes = $cellData->attributes($namespacesContent['table']);
@ -522,9 +520,8 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
}
$text = implode("\n", $textArray);
// echo $text, '<br />';
$objPHPExcel->getActiveSheet()->getComment( $columnID.$rowID )
$objPHPExcel->getActiveSheet()->getComment($columnID.$rowID)->setText($this->_parseRichText($text));
// ->setAuthor( $author )
->setText($this->_parseRichText($text) );
}
if (isset($cellDataText->p)) {
@ -550,7 +547,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
// echo 'Value Type is '.$cellDataOfficeAttributes['value-type'].'<br />';
switch ($cellDataOfficeAttributes['value-type']) {
case 'string' :
case 'string':
$type = PHPExcel_Cell_DataType::TYPE_STRING;
$dataValue = $allCellDataText;
if (isset($dataValue->a)) {
@ -559,11 +556,11 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
$hyperlink = $cellXLinkAttributes['href'];
}
break;
case 'boolean' :
case 'boolean':
$type = PHPExcel_Cell_DataType::TYPE_BOOL;
$dataValue = ($allCellDataText == 'TRUE') ? true : false;
break;
case 'percentage' :
case 'percentage':
$type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
$dataValue = (float) $cellDataOfficeAttributes['value'];
if (floor($dataValue) == $dataValue) {
@ -571,7 +568,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
}
$formatting = PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00;
break;
case 'currency' :
case 'currency':
$type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
$dataValue = (float) $cellDataOfficeAttributes['value'];
if (floor($dataValue) == $dataValue) {
@ -579,17 +576,18 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
}
$formatting = PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_USD_SIMPLE;
break;
case 'float' :
case 'float':
$type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
$dataValue = (float) $cellDataOfficeAttributes['value'];
if (floor($dataValue) == $dataValue) {
if ($dataValue == (integer) $dataValue)
if ($dataValue == (integer) $dataValue) {
$dataValue = (integer) $dataValue;
else
} else {
$dataValue = (float) $dataValue;
}
}
break;
case 'date' :
case 'date':
$type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
$dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT);
$dateObj->setTimeZone($timezoneObj);
@ -601,9 +599,9 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
$formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_XLSX15;
}
break;
case 'time' :
case 'time':
$type = PHPExcel_Cell_DataType::TYPE_NUMERIC;
$dataValue = PHPExcel_Shared_Date::PHPToExcel(strtotime('01-01-1970 '.implode(':',sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS'))));
$dataValue = PHPExcel_Shared_Date::PHPToExcel(strtotime('01-01-1970 '.implode(':', sscanf($cellDataOfficeAttributes['time-value'], 'PT%dH%dM%dS'))));
$formatting = PHPExcel_Style_NumberFormat::FORMAT_DATE_TIME4;
break;
}
@ -619,7 +617,7 @@ class PHPExcel_Reader_OOCalc extends PHPExcel_Reader_Abstract implements PHPExce
if ($hasCalculatedValue) {
$type = PHPExcel_Cell_DataType::TYPE_FORMULA;
// echo 'Formula: ', $cellDataFormula, PHP_EOL;
$cellDataFormula = substr($cellDataFormula,strpos($cellDataFormula, ':=')+1);
$cellDataFormula = substr($cellDataFormula, strpos($cellDataFormula, ':=')+1);
$temp = explode('"', $cellDataFormula);
$tKey = false;
foreach ($temp as &$value) {

View File

@ -269,7 +269,7 @@ class PHPExcel_Reader_SYLK extends PHPExcel_Reader_Abstract implements PHPExcel_
$formatArray['font']['size'] = substr($rowDatum, 1);
break;
case 'S':
$styleSettings = substr($rowDatum,1);
$styleSettings = substr($rowDatum, 1);
for ($i=0; $i<strlen($styleSettings); ++$i) {
switch ($styleSettings{$i}) {
case 'I':

View File

@ -72,7 +72,7 @@ class EigenvalueDecomposition
*
* @access private
*/
private function tred2 ()
private function tred2()
{
// This is derived from the Algol procedures tred2 by
// Bowdler, Martin, Reinsch, and Wilkinson, Handbook for
@ -189,7 +189,7 @@ class EigenvalueDecomposition
$this->e[$this->n-1] = 0.0;
$f = 0.0;
$tst1 = 0.0;
$eps = pow(2.0,-52.0);
$eps = pow(2.0, -52.0);
for ($l = 0; $l < $this->n; ++$l) {
// Find small subdiagonal element
@ -741,7 +741,7 @@ class EigenvalueDecomposition
}
}
// Overflow control
$t = max(abs($this->H[$i][$n-1]),abs($this->H[$i][$n]));
$t = max(abs($this->H[$i][$n-1]), abs($this->H[$i][$n]));
if (($eps * $t) * $t > 1) {
for ($j = $i; $j <= $n; ++$j) {
$this->H[$j][$n-1] = $this->H[$j][$n-1] / $t;

View File

@ -95,8 +95,8 @@ class PHPExcel_Shared_JAMA_Matrix
$this->n = 0;
}
if (($this->m * $this->n) == count($args[0])) {
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$this->A[$i][$j] = $args[0][$i + $j * $this->m];
}
}
@ -176,11 +176,19 @@ class PHPExcel_Shared_JAMA_Matrix
//A($i0...; $j0...)
case 'integer,integer':
list($i0, $j0) = $args;
if ($i0 >= 0) { $m = $this->m - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
if ($j0 >= 0) { $n = $this->n - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
if ($i0 >= 0) {
$m = $this->m - $i0;
} else {
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
}
if ($j0 >= 0) {
$n = $this->n - $j0;
} else {
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
}
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
for($i = $i0; $i < $this->m; ++$i) {
for($j = $j0; $j < $this->n; ++$j) {
for ($i = $i0; $i < $this->m; ++$i) {
for ($j = $j0; $j < $this->n; ++$j) {
$R->set($i, $j, $this->A[$i][$j]);
}
}
@ -189,11 +197,15 @@ class PHPExcel_Shared_JAMA_Matrix
//A($i0...$iF; $j0...$jF)
case 'integer,integer,integer,integer':
list($i0, $iF, $j0, $jF) = $args;
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { $m = $iF - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
if (($jF > $j0) && ($this->n >= $jF) && ($j0 >= 0)) { $n = $jF - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
$m = $iF - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
}
if (($jF > $j0) && ($this->n >= $jF) && ($j0 >= 0)) {
$n = $jF - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
}
$R = new PHPExcel_Shared_JAMA_Matrix($m+1, $n+1);
for($i = $i0; $i <= $iF; ++$i) {
for($j = $j0; $j <= $jF; ++$j) {
for ($i = $i0; $i <= $iF; ++$i) {
for ($j = $j0; $j <= $jF; ++$j) {
$R->set($i - $i0, $j - $j0, $this->A[$i][$j]);
}
}
@ -202,11 +214,19 @@ class PHPExcel_Shared_JAMA_Matrix
//$R = array of row indices; $C = array of column indices
case 'array,array':
list($RL, $CL) = $args;
if (count($RL) > 0) { $m = count($RL); } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
if (count($CL) > 0) { $n = count($CL); } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
if (count($RL) > 0) {
$m = count($RL);
} else {
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
}
if (count($CL) > 0) {
$n = count($CL);
} else {
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
}
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
for($i = 0; $i < $m; ++$i) {
for($j = 0; $j < $n; ++$j) {
for ($i = 0; $i < $m; ++$i) {
for ($j = 0; $j < $n; ++$j) {
$R->set($i - $i0, $j - $j0, $this->A[$RL[$i]][$CL[$j]]);
}
}
@ -215,11 +235,19 @@ class PHPExcel_Shared_JAMA_Matrix
//$RL = array of row indices; $CL = array of column indices
case 'array,array':
list($RL, $CL) = $args;
if (count($RL) > 0) { $m = count($RL); } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
if (count($CL) > 0) { $n = count($CL); } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
if (count($RL) > 0) {
$m = count($RL);
} else {
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
}
if (count($CL) > 0) {
$n = count($CL);
} else {
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
}
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
for($i = 0; $i < $m; ++$i) {
for($j = 0; $j < $n; ++$j) {
for ($i = 0; $i < $m; ++$i) {
for ($j = 0; $j < $n; ++$j) {
$R->set($i, $j, $this->A[$RL[$i]][$CL[$j]]);
}
}
@ -228,11 +256,19 @@ class PHPExcel_Shared_JAMA_Matrix
//A($i0...$iF); $CL = array of column indices
case 'integer,integer,array':
list($i0, $iF, $CL) = $args;
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) { $m = $iF - $i0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
if (count($CL) > 0) { $n = count($CL); } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
if (($iF > $i0) && ($this->m >= $iF) && ($i0 >= 0)) {
$m = $iF - $i0;
} else {
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
}
if (count($CL) > 0) {
$n = count($CL);
} else {
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
}
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
for($i = $i0; $i < $iF; ++$i) {
for($j = 0; $j < $n; ++$j) {
for ($i = $i0; $i < $iF; ++$i) {
for ($j = 0; $j < $n; ++$j) {
$R->set($i - $i0, $j, $this->A[$RL[$i]][$j]);
}
}
@ -241,11 +277,19 @@ class PHPExcel_Shared_JAMA_Matrix
//$RL = array of row indices
case 'array,integer,integer':
list($RL, $j0, $jF) = $args;
if (count($RL) > 0) { $m = count($RL); } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
if (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) { $n = $jF - $j0; } else { throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException); }
if (count($RL) > 0) {
$m = count($RL);
} else {
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
}
if (($jF >= $j0) && ($this->n >= $jF) && ($j0 >= 0)) {
$n = $jF - $j0;
} else {
throw new PHPExcel_Calculation_Exception(self::ArgumentBoundsException);
}
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n+1);
for($i = 0; $i < $m; ++$i) {
for($j = $j0; $j <= $jF; ++$j) {
for ($i = 0; $i < $m; ++$i) {
for ($j = $j0; $j <= $jF; ++$j) {
$R->set($i, $j - $j0, $this->A[$RL[$i]][$j]);
}
}
@ -320,7 +364,7 @@ class PHPExcel_Shared_JAMA_Matrix
public function diagonal($m = null, $n = null, $c = 1)
{
$R = new PHPExcel_Shared_JAMA_Matrix($m, $n);
for($i = 0; $i < $m; ++$i) {
for ($i = 0; $i < $m; ++$i) {
$R->set($i, $i, $c);
}
return $R;
@ -377,8 +421,8 @@ class PHPExcel_Shared_JAMA_Matrix
public function transpose()
{
$R = new PHPExcel_Shared_JAMA_Matrix($this->n, $this->m);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$R->set($j, $i, $this->A[$i][$j]);
}
}
@ -395,7 +439,7 @@ class PHPExcel_Shared_JAMA_Matrix
{
$s = 0;
$n = min($this->m, $this->n);
for($i = 0; $i < $n; ++$i) {
for ($i = 0; $i < $n; ++$i) {
$s += $this->A[$i][$i];
}
return $s;
@ -440,8 +484,8 @@ class PHPExcel_Shared_JAMA_Matrix
break;
}
$this->checkMatrixDimensions($M);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$M->set($i, $j, $M->get($i, $j) + $this->A[$i][$j]);
}
}
@ -480,16 +524,16 @@ class PHPExcel_Shared_JAMA_Matrix
break;
}
$this->checkMatrixDimensions($M);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$validValues = true;
$value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j],'"');
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]);
}
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value,'"');
$value = trim($value, '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value);
}
if ($validValues) {
@ -534,8 +578,8 @@ class PHPExcel_Shared_JAMA_Matrix
break;
}
$this->checkMatrixDimensions($M);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$M->set($i, $j, $M->get($i, $j) - $this->A[$i][$j]);
}
}
@ -574,16 +618,16 @@ class PHPExcel_Shared_JAMA_Matrix
break;
}
$this->checkMatrixDimensions($M);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$validValues = true;
$value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j],'"');
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]);
}
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value,'"');
$value = trim($value, '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value);
}
if ($validValues) {
@ -629,8 +673,8 @@ class PHPExcel_Shared_JAMA_Matrix
break;
}
$this->checkMatrixDimensions($M);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$M->set($i, $j, $M->get($i, $j) * $this->A[$i][$j]);
}
}
@ -670,16 +714,16 @@ class PHPExcel_Shared_JAMA_Matrix
break;
}
$this->checkMatrixDimensions($M);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$validValues = true;
$value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j],'"');
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]);
}
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value,'"');
$value = trim($value, '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value);
}
if ($validValues) {
@ -725,16 +769,16 @@ class PHPExcel_Shared_JAMA_Matrix
break;
}
$this->checkMatrixDimensions($M);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$validValues = true;
$value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j],'"');
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]);
}
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value,'"');
$value = trim($value, '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value);
}
if ($validValues) {
@ -786,8 +830,8 @@ class PHPExcel_Shared_JAMA_Matrix
break;
}
$this->checkMatrixDimensions($M);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$this->A[$i][$j] = $this->A[$i][$j] / $M->get($i, $j);
}
}
@ -828,8 +872,8 @@ class PHPExcel_Shared_JAMA_Matrix
break;
}
$this->checkMatrixDimensions($M);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$M->set($i, $j, $M->get($i, $j) / $this->A[$i][$j]);
}
}
@ -870,8 +914,8 @@ class PHPExcel_Shared_JAMA_Matrix
break;
}
$this->checkMatrixDimensions($M);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$this->A[$i][$j] = $M->get($i, $j) / $this->A[$i][$j];
}
}
@ -904,14 +948,14 @@ class PHPExcel_Shared_JAMA_Matrix
}
if ($this->n == $B->m) {
$C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n);
for($j = 0; $j < $B->n; ++$j) {
for ($j = 0; $j < $B->n; ++$j) {
for ($k = 0; $k < $this->n; ++$k) {
$Bcolj[$k] = $B->A[$k][$j];
}
for($i = 0; $i < $this->m; ++$i) {
for ($i = 0; $i < $this->m; ++$i) {
$Arowi = $this->A[$i];
$s = 0;
for($k = 0; $k < $this->n; ++$k) {
for ($k = 0; $k < $this->n; ++$k) {
$s += $Arowi[$k] * $Bcolj[$k];
}
$C->A[$i][$j] = $s;
@ -926,10 +970,10 @@ class PHPExcel_Shared_JAMA_Matrix
$B = new PHPExcel_Shared_JAMA_Matrix($args[0]);
if ($this->n == $B->m) {
$C = new PHPExcel_Shared_JAMA_Matrix($this->m, $B->n);
for($i = 0; $i < $C->m; ++$i) {
for($j = 0; $j < $C->n; ++$j) {
for ($i = 0; $i < $C->m; ++$i) {
for ($j = 0; $j < $C->n; ++$j) {
$s = "0";
for($k = 0; $k < $C->n; ++$k) {
for ($k = 0; $k < $C->n; ++$k) {
$s += $this->A[$i][$k] * $B->A[$k][$j];
}
$C->A[$i][$j] = $s;
@ -943,8 +987,8 @@ class PHPExcel_Shared_JAMA_Matrix
break;
case 'integer':
$C = new PHPExcel_Shared_JAMA_Matrix($this->A);
for($i = 0; $i < $C->m; ++$i) {
for($j = 0; $j < $C->n; ++$j) {
for ($i = 0; $i < $C->m; ++$i) {
for ($j = 0; $j < $C->n; ++$j) {
$C->A[$i][$j] *= $args[0];
}
}
@ -952,8 +996,8 @@ class PHPExcel_Shared_JAMA_Matrix
break;
case 'double':
$C = new PHPExcel_Shared_JAMA_Matrix($this->m, $this->n);
for($i = 0; $i < $C->m; ++$i) {
for($j = 0; $j < $C->n; ++$j) {
for ($i = 0; $i < $C->m; ++$i) {
for ($j = 0; $j < $C->n; ++$j) {
$C->A[$i][$j] = $args[0] * $this->A[$i][$j];
}
}
@ -961,8 +1005,8 @@ class PHPExcel_Shared_JAMA_Matrix
break;
case 'float':
$C = new PHPExcel_Shared_JAMA_Matrix($this->A);
for($i = 0; $i < $C->m; ++$i) {
for($j = 0; $j < $C->n; ++$j) {
for ($i = 0; $i < $C->m; ++$i) {
for ($j = 0; $j < $C->n; ++$j) {
$C->A[$i][$j] *= $args[0];
}
}
@ -1006,16 +1050,16 @@ class PHPExcel_Shared_JAMA_Matrix
break;
}
$this->checkMatrixDimensions($M);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$validValues = true;
$value = $M->get($i, $j);
if ((is_string($this->A[$i][$j])) && (strlen($this->A[$i][$j]) > 0) && (!is_numeric($this->A[$i][$j]))) {
$this->A[$i][$j] = trim($this->A[$i][$j],'"');
$this->A[$i][$j] = trim($this->A[$i][$j], '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($this->A[$i][$j]);
}
if ((is_string($value)) && (strlen($value) > 0) && (!is_numeric($value))) {
$value = trim($value,'"');
$value = trim($value, '"');
$validValues &= PHPExcel_Shared_String::convertToNumberIfFraction($value);
}
if ($validValues) {
@ -1059,9 +1103,9 @@ class PHPExcel_Shared_JAMA_Matrix
break;
}
$this->checkMatrixDimensions($M);
for($i = 0; $i < $this->m; ++$i) {
for($j = 0; $j < $this->n; ++$j) {
$this->A[$i][$j] = trim($this->A[$i][$j],'"').trim($M->get($i, $j),'"');
for ($i = 0; $i < $this->m; ++$i) {
for ($j = 0; $j < $this->n; ++$j) {
$this->A[$i][$j] = trim($this->A[$i][$j], '"').trim($M->get($i, $j), '"');
}
}
return $this;

View File

@ -233,4 +233,3 @@ class PHPExcel_Shared_JAMA_QRDecomposition
}
} // function solve()
}

View File

@ -77,7 +77,7 @@ class PHPExcel_Shared_OLE_PPS_Root extends PHPExcel_Shared_OLE_PPS
$this->_tmp_dir = PHPExcel_Shared_File::sys_get_temp_dir();
}
$this->_tmp_filename = tempnam($this->_tmp_dir, "OLE_PPS_Root");
$this->_FILEH_ = fopen($this->_tmp_filename,"w+b");
$this->_FILEH_ = fopen($this->_tmp_filename, "w+b");
if ($this->_FILEH_ == false) {
throw new PHPExcel_Writer_Exception("Can't create temporary file.");
}

View File

@ -3458,7 +3458,6 @@ class PclZip
}
if (($v_result = $this->privDirCheck($v_dir_to_check, (($p_entry['external']&0x00000010)==0x00000010))) != 1) {
// ----- Change the file status
$p_entry['status'] = "path_creation_fail";

View File

@ -25,7 +25,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerDATE()
@ -38,7 +38,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::DATE(2012,1,31);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1327968000, $result, NULL, 1E-8);
$this->assertEquals(1327968000, $result, null, 1E-8);
}
public function testDATEtoPHPObject()
@ -78,7 +78,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEVALUE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerDATEVALUE()
@ -91,7 +91,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::DATEVALUE('2012-1-31');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1327968000, $result, NULL, 1E-8);
$this->assertEquals(1327968000, $result, null, 1E-8);
}
public function testDATEVALUEtoPHPObject()
@ -115,7 +115,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEAR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerYEAR()
@ -131,7 +131,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MONTHOFYEAR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerMONTH()
@ -147,7 +147,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WEEKOFYEAR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerWEEKNUM()
@ -163,7 +163,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFWEEK'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerWEEKDAY()
@ -179,7 +179,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYOFMONTH'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerDAY()
@ -195,7 +195,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIME'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerTIME()
@ -208,7 +208,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::TIME(7,30,20);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(27020, $result, NULL, 1E-8);
$this->assertEquals(27020, $result, null, 1E-8);
}
public function testTIMEtoPHPObject()
@ -232,7 +232,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','TIMEVALUE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerTIMEVALUE()
@ -245,7 +245,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::TIMEVALUE('7:30:20');
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(23420, $result, NULL, 1E-8);
$this->assertEquals(23420, $result, null, 1E-8);
}
public function testTIMEVALUEtoPHPObject()
@ -269,7 +269,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','HOUROFDAY'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerHOUR()
@ -285,7 +285,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','MINUTEOFHOUR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerMINUTE()
@ -301,7 +301,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','SECONDOFMINUTE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerSECOND()
@ -317,7 +317,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','NETWORKDAYS'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerNETWORKDAYS()
@ -333,7 +333,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','WORKDAY'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerWORKDAY()
@ -349,7 +349,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EDATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerEDATE()
@ -362,7 +362,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::EDATE('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1324857600, $result, NULL, 1E-8);
$this->assertEquals(1324857600, $result, null, 1E-8);
}
public function testEDATEtoPHPObject()
@ -386,7 +386,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','EOMONTH'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerEOMONTH()
@ -399,7 +399,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_PHP_NUMERIC);
$result = PHPExcel_Calculation_DateTime::EOMONTH('2012-1-26',-1);
PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
$this->assertEquals(1325289600, $result, NULL, 1E-8);
$this->assertEquals(1325289600, $result, null, 1E-8);
}
public function testEOMONTHtoPHPObject()
@ -423,7 +423,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DATEDIF'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerDATEDIF()
@ -439,7 +439,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','DAYS360'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerDAYS360()
@ -455,7 +455,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_DateTime','YEARFRAC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerYEARFRAC()

View File

@ -29,7 +29,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELI'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerBESSELI()
@ -45,7 +45,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELJ'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerBESSELJ()
@ -61,7 +61,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELK'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerBESSELK()
@ -77,7 +77,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','BESSELY'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerBESSELY()
@ -109,7 +109,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMAGINARY'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIMAGINARY()
@ -125,7 +125,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMREAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIMREAL()
@ -141,7 +141,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMABS'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIMABS()
@ -157,7 +157,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMARGUMENT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIMARGUMENT()
@ -407,7 +407,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','ERF'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerERF()
@ -423,7 +423,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','ERFC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerERFC()
@ -487,7 +487,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOBIN'),$args);
$this->assertEquals($expectedResult, $result, NULL);
$this->assertEquals($expectedResult, $result, null);
}
public function providerDEC2BIN()
@ -503,7 +503,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOHEX'),$args);
$this->assertEquals($expectedResult, $result, NULL);
$this->assertEquals($expectedResult, $result, null);
}
public function providerDEC2HEX()
@ -519,7 +519,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DECTOOCT'),$args);
$this->assertEquals($expectedResult, $result, NULL);
$this->assertEquals($expectedResult, $result, null);
}
public function providerDEC2OCT()
@ -535,7 +535,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTOBIN'),$args);
$this->assertEquals($expectedResult, $result, NULL);
$this->assertEquals($expectedResult, $result, null);
}
public function providerHEX2BIN()
@ -551,7 +551,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTODEC'),$args);
$this->assertEquals($expectedResult, $result, NULL);
$this->assertEquals($expectedResult, $result, null);
}
public function providerHEX2DEC()
@ -567,7 +567,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','HEXTOOCT'),$args);
$this->assertEquals($expectedResult, $result, NULL);
$this->assertEquals($expectedResult, $result, null);
}
public function providerHEX2OCT()
@ -583,7 +583,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTOBIN'),$args);
$this->assertEquals($expectedResult, $result, NULL);
$this->assertEquals($expectedResult, $result, null);
}
public function providerOCT2BIN()
@ -599,7 +599,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTODEC'),$args);
$this->assertEquals($expectedResult, $result, NULL);
$this->assertEquals($expectedResult, $result, null);
}
public function providerOCT2DEC()
@ -615,7 +615,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','OCTTOHEX'),$args);
$this->assertEquals($expectedResult, $result, NULL);
$this->assertEquals($expectedResult, $result, null);
}
public function providerOCT2HEX()
@ -631,7 +631,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','DELTA'),$args);
$this->assertEquals($expectedResult, $result, NULL);
$this->assertEquals($expectedResult, $result, null);
}
public function providerDELTA()
@ -647,7 +647,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','GESTEP'),$args);
$this->assertEquals($expectedResult, $result, NULL);
$this->assertEquals($expectedResult, $result, null);
}
public function providerGESTEP()
@ -687,7 +687,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','CONVERTUOM'),$args);
$this->assertEquals($expectedResult, $result, NULL);
$this->assertEquals($expectedResult, $result, null);
}
public function providerCONVERTUOM()

View File

@ -25,7 +25,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ACCRINT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerACCRINT()
@ -41,7 +41,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ACCRINTM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerACCRINTM()
@ -57,7 +57,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','AMORDEGRC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerAMORDEGRC()
@ -73,7 +73,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','AMORLINC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerAMORLINC()
@ -89,7 +89,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYBS'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerCOUPDAYBS()
@ -105,7 +105,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYS'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerCOUPDAYS()
@ -121,7 +121,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPDAYSNC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerCOUPDAYSNC()
@ -137,7 +137,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPNCD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerCOUPNCD()
@ -153,7 +153,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPNUM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerCOUPNUM()
@ -169,7 +169,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','COUPPCD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerCOUPPCD()
@ -185,7 +185,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','CUMIPMT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerCUMIPMT()
@ -201,7 +201,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','CUMPRINC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerCUMPRINC()
@ -217,7 +217,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DB'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerDB()
@ -233,7 +233,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DDB'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerDDB()
@ -249,7 +249,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DISC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerDISC()
@ -265,7 +265,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DOLLARDE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerDOLLARDE()
@ -281,7 +281,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','DOLLARFR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerDOLLARFR()
@ -297,7 +297,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','EFFECT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerEFFECT()
@ -313,7 +313,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','FV'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerFV()
@ -329,7 +329,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','FVSCHEDULE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerFVSCHEDULE()
@ -345,7 +345,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','INTRATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerINTRATE()
@ -361,7 +361,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','IPMT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIPMT()
@ -377,7 +377,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','IRR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIRR()
@ -393,7 +393,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','ISPMT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerISPMT()
@ -409,7 +409,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','MIRR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerMIRR()
@ -425,7 +425,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NOMINAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerNOMINAL()
@ -441,7 +441,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NPER'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerNPER()
@ -457,7 +457,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','NPV'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerNPV()
@ -473,7 +473,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','PRICE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerPRICE()
@ -489,7 +489,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','RATE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerRATE()
@ -505,7 +505,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Financial','XIRR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerXIRR()

View File

@ -55,7 +55,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
public function testNULL()
{
$result = PHPExcel_Calculation_Functions::NULL();
$result = PHPExcel_Calculation_Functions::null();
$this->assertEquals('#NULL!', $result);
}
@ -73,7 +73,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_BLANK'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIS_BLANK()
@ -89,7 +89,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIS_ERR()
@ -105,7 +105,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ERROR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIS_ERROR()
@ -121,7 +121,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','ERROR_TYPE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerERROR_TYPE()
@ -137,7 +137,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_LOGICAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIS_LOGICAL()
@ -153,7 +153,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NA'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIS_NA()
@ -169,7 +169,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NUMBER'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIS_NUMBER()
@ -185,7 +185,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_TEXT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIS_TEXT()
@ -201,7 +201,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_NONTEXT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIS_NONTEXT()
@ -217,7 +217,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_EVEN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIS_EVEN()
@ -233,7 +233,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','IS_ODD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerIS_ODD()
@ -249,7 +249,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','TYPE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerTYPE()
@ -265,7 +265,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Functions','N'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerN()

View File

@ -20,13 +20,13 @@ class LogicalTest extends PHPUnit_Framework_TestCase
public function testTRUE()
{
$result = PHPExcel_Calculation_Logical::TRUE();
$this->assertEquals(TRUE, $result);
$this->assertEquals(true, $result);
}
public function testFALSE()
{
$result = PHPExcel_Calculation_Logical::FALSE();
$this->assertEquals(FALSE, $result);
$this->assertEquals(false, $result);
}
/**

View File

@ -25,7 +25,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ATAN2'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerATAN2()
@ -41,7 +41,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','CEILING'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerCEILING()
@ -57,7 +57,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','COMBIN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerCOMBIN()
@ -73,7 +73,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','EVEN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerEVEN()
@ -89,7 +89,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ODD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerODD()
@ -105,7 +105,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerFACT()
@ -121,7 +121,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FACTDOUBLE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerFACTDOUBLE()
@ -137,7 +137,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','FLOOR'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerFLOOR()
@ -153,7 +153,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','GCD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerGCD()
@ -169,7 +169,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LCM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerLCM()
@ -201,7 +201,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SIGN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerSIGN()
@ -217,7 +217,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','POWER'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerPOWER()
@ -233,7 +233,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','LOG_BASE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerLOG()
@ -249,7 +249,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MOD'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerMOD()
@ -265,7 +265,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MDETERM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerMDETERM()
@ -281,7 +281,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MINVERSE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerMINVERSE()
@ -297,7 +297,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MMULT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerMMULT()
@ -313,7 +313,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MULTINOMIAL'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerMULTINOMIAL()
@ -331,7 +331,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_VALUE);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','MROUND'),$args);
PHPExcel_Calculation::setArrayReturnType(PHPExcel_Calculation::RETURN_ARRAY_AS_ARRAY);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerMROUND()
@ -347,7 +347,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','PRODUCT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerPRODUCT()
@ -363,7 +363,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','QUOTIENT'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerQUOTIENT()
@ -379,7 +379,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDUP'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerROUNDUP()
@ -395,7 +395,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','ROUNDDOWN'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerROUNDDOWN()
@ -411,7 +411,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SERIESSUM'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerSERIESSUM()
@ -427,7 +427,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SUMSQ'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerSUMSQ()
@ -443,7 +443,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','TRUNC'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerTRUNC()
@ -475,7 +475,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig','SQRTPI'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerSQRTPI()
@ -491,7 +491,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_MathTrig', 'SUMIF'), $args);
$this->assertEquals($expectedResult, $result, NULL, 1E-12);
$this->assertEquals($expectedResult, $result, null, 1E-12);
}
public function providerSUMIF()

View File

@ -354,7 +354,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_TextData','VALUE'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-8);
$this->assertEquals($expectedResult, $result, null, 1E-8);
}
public function providerVALUE()

View File

@ -64,7 +64,7 @@ class AdvancedValueBinderTest extends PHPUnit_Framework_TestCase
PHPExcel_Shared_String::setDecimalSeparator($decimalSeparator);
PHPExcel_Shared_String::setThousandsSeparator($thousandsSeparator);
$cell = new PHPExcel_Cell(NULL, PHPExcel_Cell_DataType::TYPE_STRING, $sheet);
$cell = new PHPExcel_Cell(null, PHPExcel_Cell_DataType::TYPE_STRING, $sheet);
$binder = new PHPExcel_Cell_AdvancedValueBinder();
$binder->bindValue($cell, $value);

View File

@ -40,7 +40,7 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase
{
$tooltipValue = 'PHPExcel Web Site';
$testInstance = new PHPExcel_Cell_Hyperlink(NULL, $tooltipValue);
$testInstance = new PHPExcel_Cell_Hyperlink(null, $tooltipValue);
$result = $testInstance->getTooltip();
$this->assertEquals($tooltipValue,$result);
@ -51,7 +51,7 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase
$initialTooltipValue = 'PHPExcel Web Site';
$newTooltipValue = 'PHPExcel Repository on Github';
$testInstance = new PHPExcel_Cell_Hyperlink(NULL, $initialTooltipValue);
$testInstance = new PHPExcel_Cell_Hyperlink(null, $initialTooltipValue);
$result = $testInstance->setTooltip($newTooltipValue);
$this->assertTrue($result instanceof PHPExcel_Cell_Hyperlink);

View File

@ -186,7 +186,7 @@ class CellTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Cell','splitRange'),$args);
foreach($result as $key => $split) {
foreach ($result as $key => $split) {
if (!is_array($expectedResult[$key])) {
$this->assertEquals($expectedResult[$key], $split[0]);
} else {

View File

@ -22,7 +22,7 @@ class DataSeriesValuesTest extends PHPUnit_Framework_TestCase
$testInstance = new PHPExcel_Chart_DataSeriesValues;
foreach($dataTypeValues as $dataTypeValue) {
foreach ($dataTypeValues as $dataTypeValue) {
$result = $testInstance->setDataType($dataTypeValue);
$this->assertTrue($result instanceof PHPExcel_Chart_DataSeriesValues);
}

View File

@ -25,7 +25,7 @@ class LegendTest extends PHPUnit_Framework_TestCase
$testInstance = new PHPExcel_Chart_Legend;
foreach($positionValues as $positionValue) {
foreach ($positionValues as $positionValue) {
$result = $testInstance->setPosition($positionValue);
$this->assertTrue($result);
}
@ -66,7 +66,7 @@ class LegendTest extends PHPUnit_Framework_TestCase
$testInstance = new PHPExcel_Chart_Legend;
foreach($positionValues as $positionValue) {
foreach ($positionValues as $positionValue) {
$result = $testInstance->setPositionXL($positionValue);
$this->assertTrue($result);
}
@ -97,13 +97,13 @@ class LegendTest extends PHPUnit_Framework_TestCase
public function testSetOverlay()
{
$overlayValues = array(
TRUE,
FALSE,
true,
false,
);
$testInstance = new PHPExcel_Chart_Legend;
foreach($overlayValues as $overlayValue) {
foreach ($overlayValues as $overlayValue) {
$result = $testInstance->setOverlay($overlayValue);
$this->assertTrue($result);
}
@ -122,7 +122,7 @@ class LegendTest extends PHPUnit_Framework_TestCase
public function testGetOverlay()
{
$OverlayValue = TRUE;
$OverlayValue = true;
$testInstance = new PHPExcel_Chart_Legend;
$setValue = $testInstance->setOverlay($OverlayValue);

View File

@ -27,7 +27,7 @@ class XEEValidatorTest extends PHPUnit_Framework_TestCase
public function providerInvalidXML()
{
$tests = [];
foreach(glob('rawTestData/Reader/XEETestInvalid*.xml') as $file) {
foreach (glob('rawTestData/Reader/XEETestInvalid*.xml') as $file) {
$tests[] = [realpath($file), true];
}
return $tests;
@ -46,7 +46,7 @@ class XEEValidatorTest extends PHPUnit_Framework_TestCase
public function providerValidXML()
{
$tests = [];
foreach(glob('rawTestData/Reader/XEETestValid*.xml') as $file) {
foreach (glob('rawTestData/Reader/XEETestValid*.xml') as $file) {
$tests[] = [realpath($file), file_get_contents($file)];
}
return $tests;

View File

@ -28,7 +28,7 @@ class ReferenceHelperTest extends PHPUnit_Framework_TestCase
);
shuffle($columnBase);
usort($columnBase, array('PHPExcel_ReferenceHelper','columnSort'));
foreach($columnBase as $key => $value) {
foreach ($columnBase as $key => $value) {
$this->assertEquals($columnExpectedResult[$key], $value);
}
}
@ -50,7 +50,7 @@ class ReferenceHelperTest extends PHPUnit_Framework_TestCase
shuffle($columnBase);
$columnExpectedResult = array_reverse($columnExpectedResult);
usort($columnBase, array('PHPExcel_ReferenceHelper','columnReverseSort'));
foreach($columnBase as $key => $value) {
foreach ($columnBase as $key => $value) {
$this->assertEquals($columnExpectedResult[$key], $value);
}
}

View File

@ -21,7 +21,7 @@ class DateTest extends PHPUnit_Framework_TestCase
PHPExcel_Shared_Date::CALENDAR_WINDOWS_1900,
);
foreach($calendarValues as $calendarValue) {
foreach ($calendarValues as $calendarValue) {
$result = call_user_func(array('PHPExcel_Shared_Date','setExcelCalendar'),$calendarValue);
$this->assertTrue($result);
}
@ -71,7 +71,7 @@ class DateTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Date','PHPToExcel'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-5);
$this->assertEquals($expectedResult, $result, null, 1E-5);
}
public function providerDateTimePHPToExcel1900()
@ -92,7 +92,7 @@ class DateTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Date','FormattedPHPToExcel'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-5);
$this->assertEquals($expectedResult, $result, null, 1E-5);
}
public function providerDateTimeFormattedPHPToExcel1900()
@ -137,7 +137,7 @@ class DateTest extends PHPUnit_Framework_TestCase
$args = func_get_args();
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_Date','PHPToExcel'),$args);
$this->assertEquals($expectedResult, $result, NULL, 1E-5);
$this->assertEquals($expectedResult, $result, null, 1E-5);
}
public function providerDateTimePHPToExcel1904()

View File

@ -25,11 +25,11 @@ class FileTest extends PHPUnit_Framework_TestCase
public function testSetUseUploadTempDirectory()
{
$useUploadTempDirectoryValues = array(
TRUE,
FALSE,
true,
false,
);
foreach($useUploadTempDirectoryValues as $useUploadTempDirectoryValue) {
foreach ($useUploadTempDirectoryValues as $useUploadTempDirectoryValue) {
call_user_func(array('PHPExcel_Shared_File','setUseUploadTempDirectory'),$useUploadTempDirectoryValue);
$result = call_user_func(array('PHPExcel_Shared_File','getUseUploadTempDirectory'));

View File

@ -29,7 +29,7 @@ class FontTest extends PHPUnit_Framework_TestCase
PHPExcel_Shared_Font::AUTOSIZE_METHOD_APPROX,
);
foreach($autosizeMethodValues as $autosizeMethodValue) {
foreach ($autosizeMethodValues as $autosizeMethodValue) {
$result = call_user_func(array('PHPExcel_Shared_Font','setAutoSizeMethod'),$autosizeMethodValue);
$this->assertTrue($result);
}

View File

@ -22,7 +22,7 @@ class TimeZoneTest extends PHPUnit_Framework_TestCase
'Atlantic/St_Helena',
);
foreach($timezoneValues as $timezoneValue) {
foreach ($timezoneValues as $timezoneValue) {
$result = call_user_func(array('PHPExcel_Shared_TimeZone','setTimezone'),$timezoneValue);
$this->assertTrue($result);
}

View File

@ -141,7 +141,7 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase
'maxVal' => 200
);
foreach($attributeSet as $attributeName => $attributeValue) {
foreach ($attributeSet as $attributeName => $attributeValue) {
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterColumnObject->setAttribute($attributeName,$attributeValue);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
@ -156,7 +156,7 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase
$this->_testAutoFilterColumnObject->setAttributes($attributeSet);
foreach($attributeSet as $attributeName => $attributeValue) {
foreach ($attributeSet as $attributeName => $attributeValue) {
$result = $this->_testAutoFilterColumnObject->getAttribute($attributeName);
$this->assertEquals($attributeValue, $result);
}

View File

@ -68,7 +68,7 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
'K1:N20' => 'K1:N20'
);
foreach($ranges as $actualRange => $fullRange) {
foreach ($ranges as $actualRange => $fullRange) {
// Setters return the instance to implement the fluent interface
$result = $this->_testAutoFilterObject->setRange($fullRange);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
@ -119,7 +119,7 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
// If we request a specific column by its column ID, we should get an
// integer returned representing the column offset within the range
foreach($columnIndexes as $columnIndex => $columnOffset) {
foreach ($columnIndexes as $columnIndex => $columnOffset) {
$result = $this->_testAutoFilterObject->getColumnOffset($columnIndex);
$this->assertEquals($columnOffset, $result);
}
@ -206,7 +206,7 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
{
$columnIndexes = array('L','M');
foreach($columnIndexes as $columnIndex) {
foreach ($columnIndexes as $columnIndex) {
$this->_testAutoFilterObject->setColumn($columnIndex);
}
@ -215,7 +215,7 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
// objects for each column we set indexed by the column ID
$this->assertInternalType('array', $result);
$this->assertEquals(count($columnIndexes), count($result));
foreach($columnIndexes as $columnIndex) {
foreach ($columnIndexes as $columnIndex) {
$this->assertArrayHasKey($columnIndex,$result);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result[$columnIndex]);
}
@ -225,13 +225,13 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
{
$columnIndexes = array('L','M');
foreach($columnIndexes as $columnIndex) {
foreach ($columnIndexes as $columnIndex) {
$this->_testAutoFilterObject->setColumn($columnIndex);
}
// If we request a specific column by its column ID, we should
// get a PHPExcel_Worksheet_AutoFilter_Column object returned
foreach($columnIndexes as $columnIndex) {
foreach ($columnIndexes as $columnIndex) {
$result = $this->_testAutoFilterObject->getColumn($columnIndex);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
}
@ -246,7 +246,7 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
// If we request a specific column by its offset, we should
// get a PHPExcel_Worksheet_AutoFilter_Column object returned
foreach($columnIndexes as $columnIndex => $columnID) {
foreach ($columnIndexes as $columnIndex => $columnID) {
$result = $this->_testAutoFilterObject->getColumnByOffset($columnIndex);
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
$this->assertEquals($result->getColumnIndex(),$columnID);
@ -277,7 +277,7 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
$expectedResult = '';
$columnIndexes = array('L','M','N');
foreach($columnIndexes as $columnIndex) {
foreach ($columnIndexes as $columnIndex) {
$this->_testAutoFilterObject->setColumn($columnIndex);
}
@ -301,12 +301,12 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
// These columns should be retained
$columnIndexes1 = array('I','J');
foreach($columnIndexes1 as $columnIndex) {
foreach ($columnIndexes1 as $columnIndex) {
$this->_testAutoFilterObject->setColumn($columnIndex);
}
// These columns should be discarded
$columnIndexes2 = array('K','L','M');
foreach($columnIndexes2 as $columnIndex) {
foreach ($columnIndexes2 as $columnIndex) {
$this->_testAutoFilterObject->setColumn($columnIndex);
}
@ -329,7 +329,7 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
{
$columnIndexes = array('L','M');
foreach($columnIndexes as $columnIndex) {
foreach ($columnIndexes as $columnIndex) {
$this->_testAutoFilterObject->setColumn($columnIndex);
}

View File

@ -35,7 +35,7 @@ class ColumnCellIteratorTest extends PHPUnit_Framework_TestCase
$ColumnCellIndexResult = 1;
$this->assertEquals($ColumnCellIndexResult, $iterator->key());
foreach($iterator as $key => $ColumnCell) {
foreach ($iterator as $key => $ColumnCell) {
$this->assertEquals($ColumnCellIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Cell', $ColumnCell);
}
@ -47,7 +47,7 @@ class ColumnCellIteratorTest extends PHPUnit_Framework_TestCase
$ColumnCellIndexResult = 2;
$this->assertEquals($ColumnCellIndexResult, $iterator->key());
foreach($iterator as $key => $ColumnCell) {
foreach ($iterator as $key => $ColumnCell) {
$this->assertEquals($ColumnCellIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Cell', $ColumnCell);
}

View File

@ -35,7 +35,7 @@ class ColumnIteratorTest extends PHPUnit_Framework_TestCase
$columnIndexResult = 'A';
$this->assertEquals($columnIndexResult, $iterator->key());
foreach($iterator as $key => $column) {
foreach ($iterator as $key => $column) {
$this->assertEquals($columnIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Worksheet_Column', $column);
}
@ -47,7 +47,7 @@ class ColumnIteratorTest extends PHPUnit_Framework_TestCase
$columnIndexResult = 'B';
$this->assertEquals($columnIndexResult, $iterator->key());
foreach($iterator as $key => $column) {
foreach ($iterator as $key => $column) {
$this->assertEquals($columnIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Worksheet_Column', $column);
}

View File

@ -35,7 +35,7 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase
$RowCellIndexResult = 'A';
$this->assertEquals($RowCellIndexResult, $iterator->key());
foreach($iterator as $key => $RowCell) {
foreach ($iterator as $key => $RowCell) {
$this->assertEquals($RowCellIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Cell', $RowCell);
}
@ -47,7 +47,7 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase
$RowCellIndexResult = 'B';
$this->assertEquals($RowCellIndexResult, $iterator->key());
foreach($iterator as $key => $RowCell) {
foreach ($iterator as $key => $RowCell) {
$this->assertEquals($RowCellIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Cell', $RowCell);
}

View File

@ -35,7 +35,7 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase
$rowIndexResult = 1;
$this->assertEquals($rowIndexResult, $iterator->key());
foreach($iterator as $key => $row) {
foreach ($iterator as $key => $row) {
$this->assertEquals($rowIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Worksheet_Row', $row);
}
@ -47,7 +47,7 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase
$rowIndexResult = 2;
$this->assertEquals($rowIndexResult, $iterator->key());
foreach($iterator as $key => $row) {
foreach ($iterator as $key => $row) {
$this->assertEquals($rowIndexResult++, $key);
$this->assertInstanceOf('PHPExcel_Worksheet_Row', $row);
}

View File

@ -54,11 +54,11 @@ class testDataFileIterator implements Iterator
} while (($testDataRow > '') && ($testDataRow{0} === '#'));
// Discard any comments at the end of the line
list($testData) = explode('//',$testDataRow);
list($testData) = explode('//', $testDataRow);
// Split data into an array of individual values and a result
$dataSet = $this->_getcsv($testData, ',', "'");
foreach($dataSet as &$dataValue) {
foreach ($dataSet as &$dataValue) {
$dataValue = $this->_parseDataValue($dataValue);
}
unset($dataValue);
@ -85,23 +85,24 @@ class testDataFileIterator implements Iterator
return $data;
}
private function _parseDataValue($dataValue) {
private function _parseDataValue($dataValue)
{
// discard any white space
$dataValue = trim($dataValue);
// test for the required datatype and convert accordingly
if (!is_numeric($dataValue)) {
if($dataValue == '') {
$dataValue = NULL;
$dataValue = null;
} elseif($dataValue == '""') {
$dataValue = '';
} elseif(($dataValue[0] == '"') && ($dataValue[strlen($dataValue)-1] == '"')) {
$dataValue = substr($dataValue,1,-1);
} elseif(($dataValue[0] == '{') && ($dataValue[strlen($dataValue)-1] == '}')) {
$dataValue = explode(';',substr($dataValue,1,-1));
foreach($dataValue as &$dataRow) {
if (strpos($dataRow,'|') !== FALSE) {
foreach ($dataValue as &$dataRow) {
if (strpos($dataRow,'|') !== false) {
$dataRow = explode('|',$dataRow);
foreach($dataRow as &$dataCell) {
foreach ($dataRow as &$dataCell) {
$dataCell = $this->_parseDataValue($dataCell);
}
unset($dataCell);
@ -112,13 +113,19 @@ class testDataFileIterator implements Iterator
unset($dataRow);
} else {
switch (strtoupper($dataValue)) {
case 'NULL' : $dataValue = NULL; break;
case 'TRUE' : $dataValue = TRUE; break;
case 'FALSE' : $dataValue = FALSE; break;
case 'NULL':
$dataValue = null;
break;
case 'TRUE':
$dataValue = true;
break;
case 'FALSE':
$dataValue = false;
break;
}
}
} else {
if (strpos($dataValue,'.') !== FALSE) {
if (strpos($dataValue,'.') !== false) {
$dataValue = (float) $dataValue;
} else {
$dataValue = (int) $dataValue;
@ -127,5 +134,4 @@ class testDataFileIterator implements Iterator
return $dataValue;
}
}