mirror of
https://github.com/retailcrm/PHPExcel.git
synced 2024-11-22 21:36:05 +03:00
Validation PSR-2 : Tabs to spaces
This commit is contained in:
parent
a86cbaa230
commit
61b5fa0beb
@ -76,11 +76,11 @@ class PHPExcel_DocumentSecurity
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is some sort of dcument security enabled?
|
* Is some sort of document security enabled?
|
||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function isSecurityEnabled()
|
public function isSecurityEnabled()
|
||||||
{
|
{
|
||||||
return $this->_lockRevision ||
|
return $this->_lockRevision ||
|
||||||
$this->_lockStructure ||
|
$this->_lockStructure ||
|
||||||
@ -92,7 +92,7 @@ class PHPExcel_DocumentSecurity
|
|||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function getLockRevision()
|
public function getLockRevision()
|
||||||
{
|
{
|
||||||
return $this->_lockRevision;
|
return $this->_lockRevision;
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ class PHPExcel_DocumentSecurity
|
|||||||
* @param boolean $pValue
|
* @param boolean $pValue
|
||||||
* @return PHPExcel_DocumentSecurity
|
* @return PHPExcel_DocumentSecurity
|
||||||
*/
|
*/
|
||||||
function setLockRevision($pValue = false)
|
public function setLockRevision($pValue = false)
|
||||||
{
|
{
|
||||||
$this->_lockRevision = $pValue;
|
$this->_lockRevision = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
@ -114,7 +114,7 @@ class PHPExcel_DocumentSecurity
|
|||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function getLockStructure()
|
public function getLockStructure()
|
||||||
{
|
{
|
||||||
return $this->_lockStructure;
|
return $this->_lockStructure;
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ class PHPExcel_DocumentSecurity
|
|||||||
* @param boolean $pValue
|
* @param boolean $pValue
|
||||||
* @return PHPExcel_DocumentSecurity
|
* @return PHPExcel_DocumentSecurity
|
||||||
*/
|
*/
|
||||||
function setLockStructure($pValue = false)
|
public function setLockStructure($pValue = false)
|
||||||
{
|
{
|
||||||
$this->_lockStructure = $pValue;
|
$this->_lockStructure = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
@ -136,7 +136,7 @@ class PHPExcel_DocumentSecurity
|
|||||||
*
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
function getLockWindows()
|
public function getLockWindows()
|
||||||
{
|
{
|
||||||
return $this->_lockWindows;
|
return $this->_lockWindows;
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ class PHPExcel_DocumentSecurity
|
|||||||
* @param boolean $pValue
|
* @param boolean $pValue
|
||||||
* @return PHPExcel_DocumentSecurity
|
* @return PHPExcel_DocumentSecurity
|
||||||
*/
|
*/
|
||||||
function setLockWindows($pValue = false)
|
public function setLockWindows($pValue = false)
|
||||||
{
|
{
|
||||||
$this->_lockWindows = $pValue;
|
$this->_lockWindows = $pValue;
|
||||||
return $this;
|
return $this;
|
||||||
@ -158,7 +158,7 @@ class PHPExcel_DocumentSecurity
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getRevisionsPassword()
|
public function getRevisionsPassword()
|
||||||
{
|
{
|
||||||
return $this->_revisionsPassword;
|
return $this->_revisionsPassword;
|
||||||
}
|
}
|
||||||
@ -170,7 +170,7 @@ class PHPExcel_DocumentSecurity
|
|||||||
* @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
|
* @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
|
||||||
* @return PHPExcel_DocumentSecurity
|
* @return PHPExcel_DocumentSecurity
|
||||||
*/
|
*/
|
||||||
function setRevisionsPassword($pValue = '', $pAlreadyHashed = false)
|
public function setRevisionsPassword($pValue = '', $pAlreadyHashed = false)
|
||||||
{
|
{
|
||||||
if (!$pAlreadyHashed) {
|
if (!$pAlreadyHashed) {
|
||||||
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
|
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
|
||||||
@ -184,7 +184,7 @@ class PHPExcel_DocumentSecurity
|
|||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getWorkbookPassword()
|
public function getWorkbookPassword()
|
||||||
{
|
{
|
||||||
return $this->_workbookPassword;
|
return $this->_workbookPassword;
|
||||||
}
|
}
|
||||||
@ -196,7 +196,7 @@ class PHPExcel_DocumentSecurity
|
|||||||
* @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
|
* @param boolean $pAlreadyHashed If the password has already been hashed, set this to true
|
||||||
* @return PHPExcel_DocumentSecurity
|
* @return PHPExcel_DocumentSecurity
|
||||||
*/
|
*/
|
||||||
function setWorkbookPassword($pValue = '', $pAlreadyHashed = false)
|
public function setWorkbookPassword($pValue = '', $pAlreadyHashed = false)
|
||||||
{
|
{
|
||||||
if (!$pAlreadyHashed) {
|
if (!$pAlreadyHashed) {
|
||||||
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
|
$pValue = PHPExcel_Shared_PasswordHasher::hashPassword($pValue);
|
||||||
|
@ -52,9 +52,9 @@ class PHPExcel_Shared_TimeZone
|
|||||||
*/
|
*/
|
||||||
public static function _validateTimeZone($timezone) {
|
public static function _validateTimeZone($timezone) {
|
||||||
if (in_array($timezone, DateTimeZone::listIdentifiers())) {
|
if (in_array($timezone, DateTimeZone::listIdentifiers())) {
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,9 +66,9 @@ class PHPExcel_Shared_TimeZone
|
|||||||
public static function setTimeZone($timezone) {
|
public static function setTimeZone($timezone) {
|
||||||
if (self::_validateTimezone($timezone)) {
|
if (self::_validateTimezone($timezone)) {
|
||||||
self::$_timezone = $timezone;
|
self::$_timezone = $timezone;
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
return FALSE;
|
return false;
|
||||||
} // function setTimezone()
|
} // function setTimezone()
|
||||||
|
|
||||||
|
|
||||||
@ -92,7 +92,7 @@ class PHPExcel_Shared_TimeZone
|
|||||||
private static function _getTimezoneTransitions($objTimezone, $timestamp) {
|
private static function _getTimezoneTransitions($objTimezone, $timestamp) {
|
||||||
$allTransitions = $objTimezone->getTransitions();
|
$allTransitions = $objTimezone->getTransitions();
|
||||||
$transitions = array();
|
$transitions = array();
|
||||||
foreach($allTransitions as $key => $transition) {
|
foreach ($allTransitions as $key => $transition) {
|
||||||
if ($transition['ts'] > $timestamp) {
|
if ($transition['ts'] > $timestamp) {
|
||||||
$transitions[] = ($key > 0) ? $allTransitions[$key - 1] : $transition;
|
$transitions[] = ($key > 0) ? $allTransitions[$key - 1] : $transition;
|
||||||
break;
|
break;
|
||||||
@ -115,7 +115,7 @@ class PHPExcel_Shared_TimeZone
|
|||||||
* @throws PHPExcel_Exception
|
* @throws PHPExcel_Exception
|
||||||
*/
|
*/
|
||||||
public static function getTimeZoneAdjustment($timezone, $timestamp) {
|
public static function getTimeZoneAdjustment($timezone, $timestamp) {
|
||||||
if ($timezone !== NULL) {
|
if ($timezone !== null) {
|
||||||
if (!self::_validateTimezone($timezone)) {
|
if (!self::_validateTimezone($timezone)) {
|
||||||
throw new PHPExcel_Exception("Invalid timezone " . $timezone);
|
throw new PHPExcel_Exception("Invalid timezone " . $timezone);
|
||||||
}
|
}
|
||||||
@ -136,5 +136,4 @@ class PHPExcel_Shared_TimeZone
|
|||||||
|
|
||||||
return (count($transitions) > 0) ? $transitions[0]['offset'] : 0;
|
return (count($transitions) > 0) ? $transitions[0]['offset'] : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -100,10 +100,7 @@ class PHPExcel_Shared_ZipArchive
|
|||||||
fwrite($handle, $contents);
|
fwrite($handle, $contents);
|
||||||
fclose($handle);
|
fclose($handle);
|
||||||
|
|
||||||
$res = $this->_zip->add($this->_tempDir.'/'.$filenameParts["basename"],
|
$res = $this->_zip->add($this->_tempDir.'/'.$filenameParts["basename"], PCLZIP_OPT_REMOVE_PATH, $this->_tempDir, PCLZIP_OPT_ADD_PATH, $filenameParts["dirname"]);
|
||||||
PCLZIP_OPT_REMOVE_PATH, $this->_tempDir,
|
|
||||||
PCLZIP_OPT_ADD_PATH, $filenameParts["dirname"]
|
|
||||||
);
|
|
||||||
if ($res == 0) {
|
if ($res == 0) {
|
||||||
throw new PHPExcel_Writer_Exception("Error zipping files : " . $this->_zip->errorInfo(true));
|
throw new PHPExcel_Writer_Exception("Error zipping files : " . $this->_zip->errorInfo(true));
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
"ext-xmlwriter": "*"
|
"ext-xmlwriter": "*"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"squizlabs/php_codesniffer": "1.*"
|
"squizlabs/php_codesniffer": "2.*"
|
||||||
},
|
},
|
||||||
"recommend": {
|
"recommend": {
|
||||||
"ext-zip": "*",
|
"ext-zip": "*",
|
||||||
|
Loading…
Reference in New Issue
Block a user