#401 : Support for namespaces

This commit is contained in:
Progi1984 2016-03-22 22:20:22 +01:00
parent 218a062e0b
commit c5b352169c
30 changed files with 112 additions and 107 deletions

View File

@ -77,7 +77,7 @@ foreach($years as $year) {
foreach($countries as $country) { foreach($countries as $country) {
$endDays = date('t',mktime(0,0,0,$period,1,$year)); $endDays = date('t',mktime(0,0,0,$period,1,$year));
for($i = 1; $i <= $endDays; ++$i) { for($i = 1; $i <= $endDays; ++$i) {
$eDate = \PHPExcel\Shared\Date::FormattedPHPToExcel( $eDate = \PHPExcel\Shared\Date::formattedPHPToExcel(
$year, $year,
$period, $period,
$i $i

View File

@ -76,7 +76,7 @@ foreach($years as $year) {
foreach($countries as $country) { foreach($countries as $country) {
$endDays = date('t',mktime(0,0,0,$period,1,$year)); $endDays = date('t',mktime(0,0,0,$period,1,$year));
for($i = 1; $i <= $endDays; ++$i) { for($i = 1; $i <= $endDays; ++$i) {
$eDate = \PHPExcel\Shared\Date::FormattedPHPToExcel( $eDate = \PHPExcel\Shared\Date::formattedPHPToExcel(
$year, $year,
$period, $period,
$i $i

View File

@ -77,7 +77,7 @@ foreach($years as $year) {
foreach($countries as $country) { foreach($countries as $country) {
$endDays = date('t',mktime(0,0,0,$period,1,$year)); $endDays = date('t',mktime(0,0,0,$period,1,$year));
for($i = 1; $i <= $endDays; ++$i) { for($i = 1; $i <= $endDays; ++$i) {
$eDate = \PHPExcel\Shared\Date::FormattedPHPToExcel( $eDate = \PHPExcel\Shared\Date::formattedPHPToExcel(
$year, $year,
$period, $period,
$i $i

View File

@ -186,7 +186,7 @@ class DiscISAM extends CacheBase implements ICache
{ {
$this->cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== null)) $this->cacheDirectory = ((isset($arguments['dir'])) && ($arguments['dir'] !== null))
? $arguments['dir'] ? $arguments['dir']
: \PHPExcel\Shared\File::sys_get_temp_dir(); : \PHPExcel\Shared\File::sysGetTempDir();
parent::__construct($parent); parent::__construct($parent);
if (is_null($this->fileHandle)) { if (is_null($this->fileHandle)) {

View File

@ -123,7 +123,7 @@ class DateTime
private static function adjustDateByMonths($dateValue = 0, $adjustmentMonths = 0) private static function adjustDateByMonths($dateValue = 0, $adjustmentMonths = 0)
{ {
// Execute function // Execute function
$PHPDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($dateValue); $PHPDateObject = \PHPExcel\Shared\Date::excelToPHPObject($dateValue);
$oMonth = (int) $PHPDateObject->format('m'); $oMonth = (int) $PHPDateObject->format('m');
$oYear = (int) $PHPDateObject->format('Y'); $oYear = (int) $PHPDateObject->format('Y');
@ -218,10 +218,10 @@ class DateTime
$retValue = (float) $excelDateTime; $retValue = (float) $excelDateTime;
break; break;
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
$retValue = (integer) \PHPExcel\Shared\Date::ExcelToPHP($excelDateTime); $retValue = (integer) \PHPExcel\Shared\Date::excelToPHP($excelDateTime);
break; break;
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
$retValue = \PHPExcel\Shared\Date::ExcelToPHPObject($excelDateTime); $retValue = \PHPExcel\Shared\Date::excelToPHPObject($excelDateTime);
break; break;
} }
date_default_timezone_set($saveTimeZone); date_default_timezone_set($saveTimeZone);
@ -336,14 +336,14 @@ class DateTime
} }
// Execute function // Execute function
$excelDateValue = \PHPExcel\Shared\Date::FormattedPHPToExcel($year, $month, $day); $excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel($year, $month, $day);
switch (Functions::getReturnDateType()) { switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue; return (float) $excelDateValue;
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::ExcelToPHP($excelDateValue); return (integer) \PHPExcel\Shared\Date::excelToPHP($excelDateValue);
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return \PHPExcel\Shared\Date::ExcelToPHPObject($excelDateValue); return \PHPExcel\Shared\Date::excelToPHPObject($excelDateValue);
} }
} }
@ -433,9 +433,9 @@ class DateTime
if ($calendar != \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900) { if ($calendar != \PHPExcel\Shared\Date::CALENDAR_WINDOWS_1900) {
$date = 1; $date = 1;
} }
return (float) \PHPExcel\Shared\Date::FormattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second); return (float) \PHPExcel\Shared\Date::formattedPHPToExcel($calendar, 1, $date, $hour, $minute, $second);
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::ExcelToPHP(\PHPExcel\Shared\Date::FormattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600 return (integer) \PHPExcel\Shared\Date::excelToPHP(\PHPExcel\Shared\Date::formattedPHPToExcel(1970, 1, 1, $hour, $minute, $second)); // -2147468400; // -2147472000 + 3600
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
$dayAdjust = 0; $dayAdjust = 0;
if ($hour < 0) { if ($hour < 0) {
@ -559,7 +559,7 @@ class DateTime
$PHPDateArray['day'] = strftime('%d'); $PHPDateArray['day'] = strftime('%d');
} }
$excelDateValue = floor( $excelDateValue = floor(
\PHPExcel\Shared\Date::FormattedPHPToExcel( \PHPExcel\Shared\Date::formattedPHPToExcel(
$PHPDateArray['year'], $PHPDateArray['year'],
$PHPDateArray['month'], $PHPDateArray['month'],
$PHPDateArray['day'], $PHPDateArray['day'],
@ -573,7 +573,7 @@ class DateTime
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue; return (float) $excelDateValue;
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::ExcelToPHP($excelDateValue); return (integer) \PHPExcel\Shared\Date::excelToPHP($excelDateValue);
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return new \DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00'); return new \DateTime($PHPDateArray['year'].'-'.$PHPDateArray['month'].'-'.$PHPDateArray['day'].' 00:00:00');
} }
@ -612,7 +612,7 @@ class DateTime
$PHPDateArray = date_parse($timeValue); $PHPDateArray = date_parse($timeValue);
if (($PHPDateArray !== false) && ($PHPDateArray['error_count'] == 0)) { if (($PHPDateArray !== false) && ($PHPDateArray['error_count'] == 0)) {
if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) { if (Functions::getCompatibilityMode() == Functions::COMPATIBILITY_OPENOFFICE) {
$excelDateValue = \PHPExcel\Shared\Date::FormattedPHPToExcel( $excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel(
$PHPDateArray['year'], $PHPDateArray['year'],
$PHPDateArray['month'], $PHPDateArray['month'],
$PHPDateArray['day'], $PHPDateArray['day'],
@ -621,14 +621,14 @@ class DateTime
$PHPDateArray['second'] $PHPDateArray['second']
); );
} else { } else {
$excelDateValue = \PHPExcel\Shared\Date::FormattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1; $excelDateValue = \PHPExcel\Shared\Date::formattedPHPToExcel(1900, 1, 1, $PHPDateArray['hour'], $PHPDateArray['minute'], $PHPDateArray['second']) - 1;
} }
switch (Functions::getReturnDateType()) { switch (Functions::getReturnDateType()) {
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) $excelDateValue; return (float) $excelDateValue;
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) $phpDateValue = \PHPExcel\Shared\Date::ExcelToPHP($excelDateValue+25569) - 3600; return (integer) $phpDateValue = \PHPExcel\Shared\Date::excelToPHP($excelDateValue+25569) - 3600;
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return new \DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']); return new \DateTime('1900-01-01 '.$PHPDateArray['hour'].':'.$PHPDateArray['minute'].':'.$PHPDateArray['second']);
} }
@ -668,12 +668,12 @@ class DateTime
// Execute function // Execute function
$difference = $endDate - $startDate; $difference = $endDate - $startDate;
$PHPStartDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($startDate); $PHPStartDateObject = \PHPExcel\Shared\Date::excelToPHPObject($startDate);
$startDays = $PHPStartDateObject->format('j'); $startDays = $PHPStartDateObject->format('j');
$startMonths = $PHPStartDateObject->format('n'); $startMonths = $PHPStartDateObject->format('n');
$startYears = $PHPStartDateObject->format('Y'); $startYears = $PHPStartDateObject->format('Y');
$PHPEndDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($endDate); $PHPEndDateObject = \PHPExcel\Shared\Date::excelToPHPObject($endDate);
$endDays = $PHPEndDateObject->format('j'); $endDays = $PHPEndDateObject->format('j');
$endMonths = $PHPEndDateObject->format('n'); $endMonths = $PHPEndDateObject->format('n');
$endYears = $PHPEndDateObject->format('Y'); $endYears = $PHPEndDateObject->format('Y');
@ -787,12 +787,12 @@ class DateTime
} }
// Execute function // Execute function
$PHPStartDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($startDate); $PHPStartDateObject = \PHPExcel\Shared\Date::excelToPHPObject($startDate);
$startDay = $PHPStartDateObject->format('j'); $startDay = $PHPStartDateObject->format('j');
$startMonth = $PHPStartDateObject->format('n'); $startMonth = $PHPStartDateObject->format('n');
$startYear = $PHPStartDateObject->format('Y'); $startYear = $PHPStartDateObject->format('Y');
$PHPEndDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($endDate); $PHPEndDateObject = \PHPExcel\Shared\Date::excelToPHPObject($endDate);
$endDay = $PHPEndDateObject->format('j'); $endDay = $PHPEndDateObject->format('j');
$endMonth = $PHPEndDateObject->format('n'); $endMonth = $PHPEndDateObject->format('n');
$endYear = $PHPEndDateObject->format('Y'); $endYear = $PHPEndDateObject->format('Y');
@ -1094,9 +1094,9 @@ class DateTime
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) $endDate; return (float) $endDate;
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::ExcelToPHP($endDate); return (integer) \PHPExcel\Shared\Date::excelToPHP($endDate);
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return \PHPExcel\Shared\Date::ExcelToPHPObject($endDate); return \PHPExcel\Shared\Date::excelToPHPObject($endDate);
} }
} }
@ -1129,7 +1129,7 @@ class DateTime
} }
// Execute function // Execute function
$PHPDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($dateValue); $PHPDateObject = \PHPExcel\Shared\Date::excelToPHPObject($dateValue);
return (int) $PHPDateObject->format('j'); return (int) $PHPDateObject->format('j');
} }
@ -1173,7 +1173,7 @@ class DateTime
} }
// Execute function // Execute function
$PHPDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($dateValue); $PHPDateObject = \PHPExcel\Shared\Date::excelToPHPObject($dateValue);
$DoW = $PHPDateObject->format('w'); $DoW = $PHPDateObject->format('w');
$firstDay = 1; $firstDay = 1;
@ -1249,7 +1249,7 @@ class DateTime
} }
// Execute function // Execute function
$PHPDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($dateValue); $PHPDateObject = \PHPExcel\Shared\Date::excelToPHPObject($dateValue);
$dayOfYear = $PHPDateObject->format('z'); $dayOfYear = $PHPDateObject->format('z');
$dow = $PHPDateObject->format('w'); $dow = $PHPDateObject->format('w');
$PHPDateObject->modify('-' . $dayOfYear . ' days'); $PHPDateObject->modify('-' . $dayOfYear . ' days');
@ -1288,7 +1288,7 @@ class DateTime
} }
// Execute function // Execute function
$PHPDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($dateValue); $PHPDateObject = \PHPExcel\Shared\Date::excelToPHPObject($dateValue);
return (int) $PHPDateObject->format('n'); return (int) $PHPDateObject->format('n');
} }
@ -1320,7 +1320,7 @@ class DateTime
} }
// Execute function // Execute function
$PHPDateObject = \PHPExcel\Shared\Date::ExcelToPHPObject($dateValue); $PHPDateObject = \PHPExcel\Shared\Date::excelToPHPObject($dateValue);
return (int) $PHPDateObject->format('Y'); return (int) $PHPDateObject->format('Y');
} }
@ -1361,7 +1361,7 @@ class DateTime
} elseif ($timeValue < 0.0) { } elseif ($timeValue < 0.0) {
return Functions::NaN(); return Functions::NaN();
} }
$timeValue = \PHPExcel\Shared\Date::ExcelToPHP($timeValue); $timeValue = \PHPExcel\Shared\Date::excelToPHP($timeValue);
return (int) gmdate('G', $timeValue); return (int) gmdate('G', $timeValue);
} }
@ -1402,7 +1402,7 @@ class DateTime
} elseif ($timeValue < 0.0) { } elseif ($timeValue < 0.0) {
return Functions::NaN(); return Functions::NaN();
} }
$timeValue = \PHPExcel\Shared\Date::ExcelToPHP($timeValue); $timeValue = \PHPExcel\Shared\Date::excelToPHP($timeValue);
return (int) gmdate('i', $timeValue); return (int) gmdate('i', $timeValue);
} }
@ -1443,7 +1443,7 @@ class DateTime
} elseif ($timeValue < 0.0) { } elseif ($timeValue < 0.0) {
return Functions::NaN(); return Functions::NaN();
} }
$timeValue = \PHPExcel\Shared\Date::ExcelToPHP($timeValue); $timeValue = \PHPExcel\Shared\Date::excelToPHP($timeValue);
return (int) gmdate('s', $timeValue); return (int) gmdate('s', $timeValue);
} }
@ -1489,7 +1489,7 @@ class DateTime
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject); return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject);
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::ExcelToPHP(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject)); return (integer) \PHPExcel\Shared\Date::excelToPHP(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject));
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return $PHPDateObject; return $PHPDateObject;
} }
@ -1538,7 +1538,7 @@ class DateTime
case Functions::RETURNDATE_EXCEL: case Functions::RETURNDATE_EXCEL:
return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject); return (float) \PHPExcel\Shared\Date::PHPToExcel($PHPDateObject);
case Functions::RETURNDATE_PHP_NUMERIC: case Functions::RETURNDATE_PHP_NUMERIC:
return (integer) \PHPExcel\Shared\Date::ExcelToPHP(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject)); return (integer) \PHPExcel\Shared\Date::excelToPHP(\PHPExcel\Shared\Date::PHPToExcel($PHPDateObject));
case Functions::RETURNDATE_PHP_OBJECT: case Functions::RETURNDATE_PHP_OBJECT:
return $PHPDateObject; return $PHPDateObject;
} }

View File

@ -67,7 +67,7 @@ class Financial
{ {
$months = 12 / $frequency; $months = 12 / $frequency;
$result = \PHPExcel\Shared\Date::ExcelToPHPObject($maturity); $result = \PHPExcel\Shared\Date::excelToPHPObject($maturity);
$eom = self::isLastDayOfMonth($result); $eom = self::isLastDayOfMonth($result);
while ($settlement < \PHPExcel\Shared\Date::PHPToExcel($result)) { while ($settlement < \PHPExcel\Shared\Date::PHPToExcel($result)) {

View File

@ -30,12 +30,12 @@ namespace PHPExcel\Chart;
class Legend class Legend
{ {
/** Legend positions */ /** Legend positions */
const xlLegendPositionBottom = -4107; // Below the chart. const XL_LEGEND_POSITION_BOTTOM = -4107; // Below the chart.
const xlLegendPositionCorner = 2; // In the upper right-hand corner of the chart border. const XL_LEGEND_POSITION_CORNER = 2; // In the upper right-hand corner of the chart border.
const xlLegendPositionCustom = -4161; // A custom position. const XL_LEGEND_POSITION_CUSTOM = -4161; // A custom position.
const xlLegendPositionLeft = -4131; // Left of the chart. const XL_LEGEND_POSITION_LEFT = -4131; // Left of the chart.
const xlLegendPositionRight = -4152; // Right of the chart. const XL_LEGEND_POSITION_RIGHT = -4152; // Right of the chart.
const xlLegendPositionTop = -4160; // Above the chart. const XL_LEGEND_POSITION_TOP = -4160; // Above the chart.
const POSITION_RIGHT = 'r'; const POSITION_RIGHT = 'r';
const POSITION_LEFT = 'l'; const POSITION_LEFT = 'l';
@ -44,12 +44,12 @@ class Legend
const POSITION_TOPRIGHT = 'tr'; const POSITION_TOPRIGHT = 'tr';
private static $positionXLref = array( private static $positionXLref = array(
self::xlLegendPositionBottom => self::POSITION_BOTTOM, self::XL_LEGEND_POSITION_BOTTOM => self::POSITION_BOTTOM,
self::xlLegendPositionCorner => self::POSITION_TOPRIGHT, self::XL_LEGEND_POSITION_CORNER => self::POSITION_TOPRIGHT,
self::xlLegendPositionCustom => '??', self::XL_LEGEND_POSITION_CUSTOM => '??',
self::xlLegendPositionLeft => self::POSITION_LEFT, self::XL_LEGEND_POSITION_LEFT => self::POSITION_LEFT,
self::xlLegendPositionRight => self::POSITION_RIGHT, self::XL_LEGEND_POSITION_RIGHT => self::POSITION_RIGHT,
self::xlLegendPositionTop => self::POSITION_TOP self::XL_LEGEND_POSITION_TOP => self::POSITION_TOP
); );
/** /**
@ -124,7 +124,7 @@ class Legend
* *
* @param number $positionXL * @param number $positionXL
*/ */
public function setPositionXL($positionXL = self::xlLegendPositionRight) public function setPositionXL($positionXL = self::XL_LEGEND_POSITION_RIGHT)
{ {
if (!array_key_exists($positionXL, self::$positionXLref)) { if (!array_key_exists($positionXL, self::$positionXLref)) {
return false; return false;

View File

@ -1358,7 +1358,7 @@ class Excel5 extends BaseReader implements IReader
switch ($id) { switch ($id) {
case 0x01: // Code Page case 0x01: // Code Page
$codePage = \PHPExcel\Shared\CodePage::NumberToName($value); $codePage = \PHPExcel\Shared\CodePage::numberToName($value);
break; break;
case 0x02: // Title case 0x02: // Title
$this->phpExcel->getProperties()->setTitle($value); $this->phpExcel->getProperties()->setTitle($value);
@ -1504,7 +1504,7 @@ class Excel5 extends BaseReader implements IReader
switch ($id) { switch ($id) {
case 0x01: // Code Page case 0x01: // Code Page
$codePage = \PHPExcel\Shared\CodePage::NumberToName($value); $codePage = \PHPExcel\Shared\CodePage::numberToName($value);
break; break;
case 0x02: // Category case 0x02: // Category
$this->phpExcel->getProperties()->setCategory($value); $this->phpExcel->getProperties()->setCategory($value);
@ -1884,7 +1884,7 @@ class Excel5 extends BaseReader implements IReader
// offset: 0; size: 2; code page identifier // offset: 0; size: 2; code page identifier
$codepage = self::getInt2d($recordData, 0); $codepage = self::getInt2d($recordData, 0);
$this->codepage = \PHPExcel\Shared\CodePage::NumberToName($codepage); $this->codepage = \PHPExcel\Shared\CodePage::numberToName($codepage);
} }

View File

@ -598,7 +598,7 @@ class OOCalc extends BaseReader implements IReader
$dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT); $dateObj = new DateTime($cellDataOfficeAttributes['date-value'], $GMT);
$dateObj->setTimeZone($timezoneObj); $dateObj->setTimeZone($timezoneObj);
list($year, $month, $day, $hour, $minute, $second) = explode(' ', $dateObj->format('Y m d H i s')); list($year, $month, $day, $hour, $minute, $second) = explode(' ', $dateObj->format('Y m d H i s'));
$dataValue = \PHPExcel\Shared\Date::FormattedPHPToExcel($year, $month, $day, $hour, $minute, $second); $dataValue = \PHPExcel\Shared\Date::formattedPHPToExcel($year, $month, $day, $hour, $minute, $second);
if ($dataValue != floor($dataValue)) { if ($dataValue != floor($dataValue)) {
$formatting = \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15.' '.\PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4; $formatting = \PHPExcel\Style\NumberFormat::FORMAT_DATE_XLSX15.' '.\PHPExcel\Style\NumberFormat::FORMAT_DATE_TIME4;
} else { } else {

View File

@ -37,7 +37,7 @@ class CodePage
* @return string Code Page Name * @return string Code Page Name
* @throws \PHPExcel\Exception * @throws \PHPExcel\Exception
*/ */
public static function NumberToName($codePage = 1252) public static function numberToName($codePage = 1252)
{ {
switch ($codePage) { switch ($codePage) {
case 367: case 367:

View File

@ -114,7 +114,7 @@ class Date
* @param string $timezone The timezone for finding the adjustment from UST * @param string $timezone The timezone for finding the adjustment from UST
* @return integer PHP serialized date/time * @return integer PHP serialized date/time
*/ */
public static function ExcelToPHP($dateValue = 0, $adjustToTimezone = false, $timezone = null) public static function excelToPHP($dateValue = 0, $adjustToTimezone = false, $timezone = null)
{ {
if (self::$excelBaseDate == self::CALENDAR_WINDOWS_1900) { if (self::$excelBaseDate == self::CALENDAR_WINDOWS_1900) {
$myexcelBaseDate = 25569; $myexcelBaseDate = 25569;
@ -154,9 +154,9 @@ class Date
* @param integer $dateValue Excel date/time value * @param integer $dateValue Excel date/time value
* @return \DateTime PHP date/time object * @return \DateTime PHP date/time object
*/ */
public static function ExcelToPHPObject($dateValue = 0) public static function excelToPHPObject($dateValue = 0)
{ {
$dateTime = self::ExcelToPHP($dateValue); $dateTime = self::excelToPHP($dateValue);
$days = floor($dateTime / 86400); $days = floor($dateTime / 86400);
$time = round((($dateTime / 86400) - $days) * 86400); $time = round((($dateTime / 86400) - $days) * 86400);
$hours = round($time / 3600); $hours = round($time / 3600);
@ -186,9 +186,9 @@ class Date
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');
$retValue = false; $retValue = false;
if ((is_object($dateValue)) && ($dateValue instanceof \DateTime)) { if ((is_object($dateValue)) && ($dateValue instanceof \DateTime)) {
$retValue = self::FormattedPHPToExcel($dateValue->format('Y'), $dateValue->format('m'), $dateValue->format('d'), $dateValue->format('H'), $dateValue->format('i'), $dateValue->format('s')); $retValue = self::formattedPHPToExcel($dateValue->format('Y'), $dateValue->format('m'), $dateValue->format('d'), $dateValue->format('H'), $dateValue->format('i'), $dateValue->format('s'));
} elseif (is_numeric($dateValue)) { } elseif (is_numeric($dateValue)) {
$retValue = self::FormattedPHPToExcel(date('Y', $dateValue), date('m', $dateValue), date('d', $dateValue), date('H', $dateValue), date('i', $dateValue), date('s', $dateValue)); $retValue = self::formattedPHPToExcel(date('Y', $dateValue), date('m', $dateValue), date('d', $dateValue), date('H', $dateValue), date('i', $dateValue), date('s', $dateValue));
} elseif (is_string($dateValue)) { } elseif (is_string($dateValue)) {
$retValue = self::stringToExcel($dateValue); $retValue = self::stringToExcel($dateValue);
} }
@ -199,7 +199,7 @@ class Date
/** /**
* FormattedPHPToExcel * formattedPHPToExcel
* *
* @param integer $year * @param integer $year
* @param integer $month * @param integer $month
@ -209,7 +209,7 @@ class Date
* @param integer $seconds * @param integer $seconds
* @return integer Excel date/time value * @return integer Excel date/time value
*/ */
public static function FormattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0) public static function formattedPHPToExcel($year, $month, $day, $hours = 0, $minutes = 0, $seconds = 0)
{ {
if (self::$excelBaseDate == self::CALENDAR_WINDOWS_1900) { if (self::$excelBaseDate == self::CALENDAR_WINDOWS_1900) {
// //

View File

@ -66,7 +66,7 @@ class File
* @param string $pFilename Filename * @param string $pFilename Filename
* @return bool * @return bool
*/ */
public static function file_exists($pFilename) public static function fileExists($pFilename)
{ {
// Sick construction, but it seems that // Sick construction, but it seems that
// file_exists returns strange values when // file_exists returns strange values when
@ -130,7 +130,7 @@ class File
* *
* @return string * @return string
*/ */
public static function sys_get_temp_dir() public static function sysGetTempDir()
{ {
if (self::$useUploadTempDirectory) { if (self::$useUploadTempDirectory) {
// use upload-directory when defined to allow running on environments having very restricted // use upload-directory when defined to allow running on environments having very restricted

View File

@ -443,7 +443,7 @@ class OLE
* @param string $ascii The ASCII string to transform * @param string $ascii The ASCII string to transform
* @return string The string in Unicode * @return string The string in Unicode
*/ */
public static function Asc2Ucs($ascii) public static function ascToUcs($ascii)
{ {
$rawname = ''; $rawname = '';
for ($i = 0; $i < strlen($ascii); ++$i) { for ($i = 0; $i < strlen($ascii); ++$i) {
@ -461,7 +461,7 @@ class OLE
* @param integer $date A timestamp * @param integer $date A timestamp
* @return string The string for the OLE container * @return string The string for the OLE container
*/ */
public static function LocalDate2OLE($date = null) public static function localDateToOLE($date = null)
{ {
if (!isset($date)) { if (!isset($date)) {
return "\x00\x00\x00\x00\x00\x00\x00\x00"; return "\x00\x00\x00\x00\x00\x00\x00\x00";

View File

@ -150,7 +150,7 @@ class PPS
* @access public * @access public
* @return integer The amount of data (in bytes) * @return integer The amount of data (in bytes)
*/ */
public function _DataLen() public function getDataLen()
{ {
if (!isset($this->_data)) { if (!isset($this->_data)) {
return 0; return 0;
@ -185,8 +185,8 @@ class PPS
. "\xc0\x00\x00\x00" // 92 . "\xc0\x00\x00\x00" // 92
. "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root . "\x00\x00\x00\x46" // 96 // Seems to be ok only for Root
. "\x00\x00\x00\x00" // 100 . "\x00\x00\x00\x00" // 100
. \PHPExcel\Shared\OLE::LocalDate2OLE($this->Time1st) // 108 . \PHPExcel\Shared\OLE::localDateToOLE($this->Time1st) // 108
. \PHPExcel\Shared\OLE::LocalDate2OLE($this->Time2nd) // 116 . \PHPExcel\Shared\OLE::localDateToOLE($this->Time2nd) // 116
. pack("V", isset($this->startBlock) ? $this->startBlock : 0) // 120 . pack("V", isset($this->startBlock) ? $this->startBlock : 0) // 120
. pack("V", $this->Size) // 124 . pack("V", $this->Size) // 124
. pack("V", 0); // 128 . pack("V", 0); // 128

View File

@ -37,7 +37,7 @@ class File extends \PHPExcel\Shared\OLE\PPS
* *
* @access public * @access public
* @param string $name The name of the file (in Unicode) * @param string $name The name of the file (in Unicode)
* @see OLE::Asc2Ucs() * @see OLE::ascToUcs()
*/ */
public function __construct($name) public function __construct($name)
{ {

View File

@ -45,9 +45,9 @@ class Root extends \PHPExcel\Shared\OLE\PPS
*/ */
public function __construct($time_1st, $time_2nd, $raChild) public function __construct($time_1st, $time_2nd, $raChild)
{ {
$this->_tempDir = \PHPExcel\Shared\File::sys_get_temp_dir(); $this->_tempDir = \PHPExcel\Shared\File::sysGetTempDir();
parent::__construct(null, \PHPExcel\Shared\OLE::Asc2Ucs('Root Entry'), \PHPExcel\Shared\OLE::OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild); parent::__construct(null, \PHPExcel\Shared\OLE::ascToUcs('Root Entry'), \PHPExcel\Shared\OLE::OLE_PPS_TYPE_ROOT, null, null, null, $time_1st, $time_2nd, null, $raChild);
} }
/** /**
@ -78,7 +78,7 @@ class Root extends \PHPExcel\Shared\OLE\PPS
$this->_FILEH_ = $filename; $this->_FILEH_ = $filename;
} elseif ($filename == '-' || $filename == '') { } elseif ($filename == '-' || $filename == '') {
if ($this->tempDirectory === null) { if ($this->tempDirectory === null) {
$this->tempDirectory = \PHPExcel\Shared\File::sys_get_temp_dir(); $this->tempDirectory = \PHPExcel\Shared\File::sysGetTempDir();
} }
$this->_tmp_filename = tempnam($this->tempDirectory, "OLE_PPS_Root"); $this->_tmp_filename = tempnam($this->tempDirectory, "OLE_PPS_Root");
$this->_FILEH_ = fopen($this->_tmp_filename, "w+b"); $this->_FILEH_ = fopen($this->_tmp_filename, "w+b");
@ -132,7 +132,7 @@ class Root extends \PHPExcel\Shared\OLE\PPS
$iCount = count($raList); $iCount = count($raList);
for ($i = 0; $i < $iCount; ++$i) { for ($i = 0; $i < $iCount; ++$i) {
if ($raList[$i]->Type == \PHPExcel\Shared\OLE::OLE_PPS_TYPE_FILE) { if ($raList[$i]->Type == \PHPExcel\Shared\OLE::OLE_PPS_TYPE_FILE) {
$raList[$i]->Size = $raList[$i]->_DataLen(); $raList[$i]->Size = $raList[$i]->getDataLen();
if ($raList[$i]->Size < \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) { if ($raList[$i]->Size < \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) {
$iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE) $iSBcnt += floor($raList[$i]->Size / $this->_SMALL_BLOCK_SIZE)
+ (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0); + (($raList[$i]->Size % $this->_SMALL_BLOCK_SIZE)? 1: 0);
@ -264,7 +264,7 @@ class Root extends \PHPExcel\Shared\OLE\PPS
$iCount = count($raList); $iCount = count($raList);
for ($i = 0; $i < $iCount; ++$i) { for ($i = 0; $i < $iCount; ++$i) {
if ($raList[$i]->Type != \PHPExcel\Shared\OLE::OLE_PPS_TYPE_DIR) { if ($raList[$i]->Type != \PHPExcel\Shared\OLE::OLE_PPS_TYPE_DIR) {
$raList[$i]->Size = $raList[$i]->_DataLen(); $raList[$i]->Size = $raList[$i]->getDataLen();
if (($raList[$i]->Size >= \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == \PHPExcel\Shared\OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) { if (($raList[$i]->Size >= \PHPExcel\Shared\OLE::OLE_DATA_SIZE_SMALL) || (($raList[$i]->Type == \PHPExcel\Shared\OLE::OLE_PPS_TYPE_ROOT) && isset($raList[$i]->_data))) {
// Write Data // Write Data
//if (isset($raList[$i]->_PPS_FILE)) { //if (isset($raList[$i]->_PPS_FILE)) {

View File

@ -1,4 +1,7 @@
<?php <?php
namespace PHPExcel\Shared\PCLZip;
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
// PhpConcept Library - Zip Module 2.8.2 // PhpConcept Library - Zip Module 2.8.2
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
@ -22,7 +25,7 @@
// The use of this software is at the risk of the user. // The use of this software is at the risk of the user.
// //
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
// $Id: pclzip.lib.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $ // $Id: PclZip.php,v 1.60 2009/09/30 21:01:04 vblavet Exp $
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
// ----- Constants // ----- Constants
@ -212,7 +215,7 @@ class PclZip
// Note that no real action is taken, if the archive does not exist it is not // Note that no real action is taken, if the archive does not exist it is not
// created. Use create() for that. // created. Use create() for that.
// -------------------------------------------------------------------------------- // --------------------------------------------------------------------------------
public function PclZip($p_zipname) public function __construct($p_zipname)
{ {
// ----- Tests the zlib // ----- Tests the zlib
@ -1481,6 +1484,7 @@ class PclZip
// ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG // ereg() is deprecated starting with PHP 5.3. Move PCLZIP_OPT_BY_EREG
// to PCLZIP_OPT_BY_PREG // to PCLZIP_OPT_BY_PREG
$p_options_list[$i] = PCLZIP_OPT_BY_PREG; $p_options_list[$i] = PCLZIP_OPT_BY_PREG;
// no break;
case PCLZIP_OPT_BY_PREG: case PCLZIP_OPT_BY_PREG:
//case PCLZIP_OPT_CRYPT : //case PCLZIP_OPT_CRYPT :
// ----- Check the number of parameters // ----- Check the number of parameters

View File

@ -62,7 +62,7 @@ class XMLWriter extends \XMLWriter
} else { } else {
// Create temporary filename // Create temporary filename
if ($pTemporaryStorageFolder === null) { if ($pTemporaryStorageFolder === null) {
$pTemporaryStorageFolder = File::sys_get_temp_dir(); $pTemporaryStorageFolder = File::sysGetTempDir();
} }
$this->tempFileName = @tempnam($pTemporaryStorageFolder, 'xml'); $this->tempFileName = @tempnam($pTemporaryStorageFolder, 'xml');

View File

@ -3,9 +3,10 @@
namespace PHPExcel\Shared; namespace PHPExcel\Shared;
if (!defined('PCLZIP_TEMPORARY_DIR')) { if (!defined('PCLZIP_TEMPORARY_DIR')) {
define('PCLZIP_TEMPORARY_DIR', File::sys_get_temp_dir() . DIRECTORY_SEPARATOR); define('PCLZIP_TEMPORARY_DIR', File::sysGetTempDir() . DIRECTORY_SEPARATOR);
} }
require_once PHPEXCEL_ROOT . 'PHPExcel/Shared/PCLZip/pclzip.lib.php';
use PHPExcel\Shared\PCLZip\PclZip;
/** /**
* PHPExcel_Shared_ZipArchive * PHPExcel_Shared_ZipArchive
@ -63,7 +64,7 @@ class ZipArchive
*/ */
public function open($fileName) public function open($fileName)
{ {
$this->tempDir = File::sys_get_temp_dir(); $this->tempDir = File::sysGetTempDir();
$this->zip = new PclZip($fileName); $this->zip = new PclZip($fileName);
return true; return true;

View File

@ -487,7 +487,7 @@ class NumberFormat extends Supervisor implements \PHPExcel\IComparable
// escape any quoted characters so that DateTime format() will render them correctly // escape any quoted characters so that DateTime format() will render them correctly
$format = preg_replace_callback('/"(.*)"/U', ['self', 'escapeQuotesCallback'], $format); $format = preg_replace_callback('/"(.*)"/U', ['self', 'escapeQuotesCallback'], $format);
$dateObj = \PHPExcel\Shared\Date::ExcelToPHPObject($value); $dateObj = \PHPExcel\Shared\Date::excelToPHPObject($value);
$value = $dateObj->format($format); $value = $dateObj->format($format);
} }

View File

@ -327,7 +327,7 @@ class AutoFilter
} }
if (is_numeric($cellValue)) { if (is_numeric($cellValue)) {
$dateValue = \PHPExcel\Shared\Date::ExcelToPHP($cellValue); $dateValue = \PHPExcel\Shared\Date::excelToPHP($cellValue);
if ($cellValue < 1) { if ($cellValue < 1) {
// Just the time part // Just the time part
$dtVal = date('His', $dateValue); $dtVal = date('His', $dateValue);
@ -444,7 +444,7 @@ class AutoFilter
} }
if (is_numeric($cellValue)) { if (is_numeric($cellValue)) {
$dateValue = date('m', \PHPExcel\Shared\Date::ExcelToPHP($cellValue)); $dateValue = date('m', \PHPExcel\Shared\Date::excelToPHP($cellValue));
if (in_array($dateValue, $monthSet)) { if (in_array($dateValue, $monthSet)) {
return true; return true;
} }

View File

@ -179,7 +179,7 @@ class Excel2007 extends BaseWriter implements IWriter
// If $pFilename is php://output or php://stdout, make it a temporary file... // If $pFilename is php://output or php://stdout, make it a temporary file...
$originalFilename = $pFilename; $originalFilename = $pFilename;
if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') { if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
$pFilename = @tempnam(PHPExcel_Shared_File::sys_get_temp_dir(), 'phpxltmp'); $pFilename = @tempnam(PHPExcel_Shared_File::sysGetTempDir(), 'phpxltmp');
if ($pFilename == '') { if ($pFilename == '') {
$pFilename = $originalFilename; $pFilename = $originalFilename;
} }

View File

@ -189,7 +189,7 @@ class ContentTypes extends WriterPart
*/ */
private function getImageMimeType($pFile = '') private function getImageMimeType($pFile = '')
{ {
if (\PHPExcel\Shared\File::file_exists($pFile)) { if (\PHPExcel\Shared\File::fileExists($pFile)) {
$image = getimagesize($pFile); $image = getimagesize($pFile);
return image_type_to_mime_type($image[2]); return image_type_to_mime_type($image[2]);
} else { } else {

View File

@ -168,7 +168,7 @@ class Excel5 extends BaseWriter implements IWriter
// initialize OLE file // initialize OLE file
$workbookStreamName = 'Workbook'; $workbookStreamName = 'Workbook';
$OLE = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::Asc2Ucs($workbookStreamName)); $OLE = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::ascToUcs($workbookStreamName));
// Write the worksheet streams before the global workbook stream, // Write the worksheet streams before the global workbook stream,
// because the byte sizes of these are needed in the global workbook stream // because the byte sizes of these are needed in the global workbook stream
@ -189,14 +189,14 @@ class Excel5 extends BaseWriter implements IWriter
$this->documentSummaryInformation = $this->writeDocumentSummaryInformation(); $this->documentSummaryInformation = $this->writeDocumentSummaryInformation();
// initialize OLE Document Summary Information // initialize OLE Document Summary Information
if (isset($this->documentSummaryInformation) && !empty($this->documentSummaryInformation)) { if (isset($this->documentSummaryInformation) && !empty($this->documentSummaryInformation)) {
$OLE_DocumentSummaryInformation = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::Asc2Ucs(chr(5) . 'DocumentSummaryInformation')); $OLE_DocumentSummaryInformation = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::ascToUcs(chr(5) . 'DocumentSummaryInformation'));
$OLE_DocumentSummaryInformation->append($this->documentSummaryInformation); $OLE_DocumentSummaryInformation->append($this->documentSummaryInformation);
} }
$this->summaryInformation = $this->writeSummaryInformation(); $this->summaryInformation = $this->writeSummaryInformation();
// initialize OLE Summary Information // initialize OLE Summary Information
if (isset($this->summaryInformation) && !empty($this->summaryInformation)) { if (isset($this->summaryInformation) && !empty($this->summaryInformation)) {
$OLE_SummaryInformation = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::Asc2Ucs(chr(5) . 'SummaryInformation')); $OLE_SummaryInformation = new \PHPExcel\Shared\OLE\PPS\File(\PHPExcel\Shared\OLE::ascToUcs(chr(5) . 'SummaryInformation'));
$OLE_SummaryInformation->append($this->summaryInformation); $OLE_SummaryInformation->append($this->summaryInformation);
} }
@ -828,7 +828,7 @@ class Excel5 extends BaseWriter implements IWriter
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C), $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0C),
'offset' => array('pack' => 'V'), 'offset' => array('pack' => 'V'),
'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
'data' => array('data' => \PHPExcel\Shared\OLE::LocalDate2OLE($dataProp))); 'data' => array('data' => \PHPExcel\Shared\OLE::localDateToOLE($dataProp)));
$dataSection_NumProps++; $dataSection_NumProps++;
} }
// Modified Date/Time // Modified Date/Time
@ -837,7 +837,7 @@ class Excel5 extends BaseWriter implements IWriter
$dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D), $dataSection[] = array('summary'=> array('pack' => 'V', 'data' => 0x0D),
'offset' => array('pack' => 'V'), 'offset' => array('pack' => 'V'),
'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601) 'type' => array('pack' => 'V', 'data' => 0x40), // Filetime (64-bit value representing the number of 100-nanosecond intervals since January 1, 1601)
'data' => array('data' => \PHPExcel\Shared\OLE::LocalDate2OLE($dataProp))); 'data' => array('data' => \PHPExcel\Shared\OLE::localDateToOLE($dataProp)));
$dataSection_NumProps++; $dataSection_NumProps++;
} }
// Security // Security

View File

@ -702,7 +702,7 @@ class HTML extends BaseWriter implements IWriter
if ($chart instanceof PHPExcel_Chart) { if ($chart instanceof PHPExcel_Chart) {
$chartCoordinates = $chart->getTopLeftPosition(); $chartCoordinates = $chart->getTopLeftPosition();
if ($chartCoordinates['cell'] == $coordinates) { if ($chartCoordinates['cell'] == $coordinates) {
$chartFileName = PHPExcel_Shared_File::sys_get_temp_dir().'/'.uniqid().'.png'; $chartFileName = PHPExcel_Shared_File::sysGetTempDir().'/'.uniqid().'.png';
if (!$chart->render($chartFileName)) { if (!$chart->render($chartFileName)) {
return; return;
} }

View File

@ -100,7 +100,7 @@ class OpenDocument extends BaseWriter implements IWriter
// If $pFilename is php://output or php://stdout, make it a temporary file... // If $pFilename is php://output or php://stdout, make it a temporary file...
$originalFilename = $pFilename; $originalFilename = $pFilename;
if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') { if (strtolower($pFilename) == 'php://output' || strtolower($pFilename) == 'php://stdout') {
$pFilename = @tempnam(PHPExcel_Shared_File::sys_get_temp_dir(), 'phpxltmp'); $pFilename = @tempnam(PHPExcel_Shared_File::sysGetTempDir(), 'phpxltmp');
if ($pFilename == '') { if ($pFilename == '') {
$pFilename = $originalFilename; $pFilename = $originalFilename;
} }

View File

@ -214,7 +214,7 @@ abstract class Core extends \PHPExcel\Writer\HTML
{ {
parent::__construct($phpExcel); parent::__construct($phpExcel);
$this->setUseInlineCss(true); $this->setUseInlineCss(true);
$this->tempDir = PHPExcel_Shared_File::sys_get_temp_dir(); $this->tempDir = PHPExcel_Shared_File::sysGetTempDir();
} }
/** /**

View File

@ -47,12 +47,12 @@ class LegendTest extends \PHPUnit_Framework_TestCase
public function testSetPositionXL() public function testSetPositionXL()
{ {
$positionValues = array( $positionValues = array(
\PHPExcel\Chart\Legend::xlLegendPositionBottom, \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_BOTTOM,
\PHPExcel\Chart\Legend::xlLegendPositionCorner, \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_CORNER,
\PHPExcel\Chart\Legend::xlLegendPositionCustom, \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_CUSTOM,
\PHPExcel\Chart\Legend::xlLegendPositionLeft, \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_LEFT,
\PHPExcel\Chart\Legend::xlLegendPositionRight, \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_RIGHT,
\PHPExcel\Chart\Legend::xlLegendPositionTop, \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_TOP,
); );
$testInstance = new \PHPExcel\Chart\Legend; $testInstance = new \PHPExcel\Chart\Legend;
@ -71,12 +71,12 @@ class LegendTest extends \PHPUnit_Framework_TestCase
$this->assertFalse($result); $this->assertFalse($result);
// Ensure that value is unchanged // Ensure that value is unchanged
$result = $testInstance->getPositionXL(); $result = $testInstance->getPositionXL();
$this->assertEquals(\PHPExcel\Chart\Legend::xlLegendPositionRight, $result); $this->assertEquals(\PHPExcel\Chart\Legend::XL_LEGEND_POSITION_RIGHT, $result);
} }
public function testGetPositionXL() public function testGetPositionXL()
{ {
$PositionValue = \PHPExcel\Chart\Legend::xlLegendPositionCorner; $PositionValue = \PHPExcel\Chart\Legend::XL_LEGEND_POSITION_CORNER;
$testInstance = new \PHPExcel\Chart\Legend; $testInstance = new \PHPExcel\Chart\Legend;
$setValue = $testInstance->setPositionXL($PositionValue); $setValue = $testInstance->setPositionXL($PositionValue);

View File

@ -13,7 +13,7 @@ class CodePageTest extends \PHPUnit_Framework_TestCase
{ {
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Shared_CodePage','NumberToName'), $args); $result = call_user_func_array(array('PHPExcel_Shared_CodePage','numberToName'), $args);
$this->assertEquals($expectedResult, $result); $this->assertEquals($expectedResult, $result);
} }
@ -26,7 +26,7 @@ class CodePageTest extends \PHPUnit_Framework_TestCase
{ {
$invalidCodePage = 12345; $invalidCodePage = 12345;
try { try {
$result = call_user_func(array('PHPExcel_Shared_CodePage','NumberToName'), $invalidCodePage); $result = call_user_func(array('PHPExcel_Shared_CodePage','numberToName'), $invalidCodePage);
} catch (Exception $e) { } catch (Exception $e) {
$this->assertEquals($e->getMessage(), 'Unknown codepage: 12345'); $this->assertEquals($e->getMessage(), 'Unknown codepage: 12345');
return; return;
@ -38,7 +38,7 @@ class CodePageTest extends \PHPUnit_Framework_TestCase
{ {
$unsupportedCodePage = 720; $unsupportedCodePage = 720;
try { try {
$result = call_user_func(array('PHPExcel_Shared_CodePage','NumberToName'), $unsupportedCodePage); $result = call_user_func(array('PHPExcel_Shared_CodePage','numberToName'), $unsupportedCodePage);
} catch (Exception $e) { } catch (Exception $e) {
$this->assertEquals($e->getMessage(), 'Code page 720 not supported.'); $this->assertEquals($e->getMessage(), 'Code page 720 not supported.');
return; return;

View File

@ -72,9 +72,9 @@ class DateTest extends \PHPUnit_Framework_TestCase
} }
/** /**
* @dataProvider providerDateTimeFormattedPHPToExcel1900 * @dataProvider providerDateTimeformattedPHPToExcel1900
*/ */
public function testDateTimeFormattedPHPToExcel1900() public function testDateTimeformattedPHPToExcel1900()
{ {
$result = call_user_func( $result = call_user_func(
array('\PHPExcel\Shared\Date','setExcelCalendar'), array('\PHPExcel\Shared\Date','setExcelCalendar'),
@ -83,13 +83,13 @@ class DateTest extends \PHPUnit_Framework_TestCase
$args = func_get_args(); $args = func_get_args();
$expectedResult = array_pop($args); $expectedResult = array_pop($args);
$result = call_user_func_array(array('\PHPExcel\Shared\Date','FormattedPHPToExcel'), $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() public function providerDateTimeformattedPHPToExcel1900()
{ {
return new \testDataFileIterator('rawTestData/Shared/DateTimeFormattedPHPToExcel1900.data'); return new \testDataFileIterator('rawTestData/Shared/DateTimeformattedPHPToExcel1900.data');
} }
/** /**