Fix some PHPCS errors

This commit is contained in:
Progi1984 2016-03-22 10:08:48 +01:00
parent 03f053bf77
commit 114fc00763
26 changed files with 103 additions and 71 deletions

View File

@ -1212,27 +1212,28 @@ class MathTrig
return $returnValue;
}
/**
* SUMIFS
*
* Counts the number of cells that contain numbers within the list of arguments
*
* Excel Function:
* SUMIFS(value1[,value2[, ...]],condition)
*
* @access public
* @category Mathematical and Trigonometric Functions
* @param mixed $arg,... Data values
* @param string $condition The criteria that defines which cells will be summed.
* @return float
*/
public static function SUMIFS() {
$arrayList = func_get_args();
/**
* SUMIFS
*
* Counts the number of cells that contain numbers within the list of arguments
*
* Excel Function:
* SUMIFS(value1[,value2[, ...]],condition)
*
* @access public
* @category Mathematical and Trigonometric Functions
* @param mixed $arg,... Data values
* @param string $condition The criteria that defines which cells will be summed.
* @return float
*/
public static function SUMIFS()
{
$arrayList = func_get_args();
// Return value
$returnValue = 0;
// Return value
$returnValue = 0;
$sumArgs = Functions::flattenArray(array_shift($arrayList));
$sumArgs = Functions::flattenArray(array_shift($arrayList));
while (count($arrayList) > 0) {
$aArgsArray[] = Functions::flattenArray(array_shift($arrayList));
@ -1256,9 +1257,9 @@ class MathTrig
}
}
// Return
return $returnValue;
}
// Return
return $returnValue;
}
/**
* SUMPRODUCT

View File

@ -634,7 +634,7 @@ class HTML
protected function cleanWhitespace()
{
foreach($this->richTextObject->getRichTextElements() as $key => $element) {
foreach ($this->richTextObject->getRichTextElements() as $key => $element) {
$text = $element->getText();
// Trim any leading spaces on the first run
if ($key == 0) {

View File

@ -76,4 +76,4 @@ class BIFF5
}
return array('rgb' => '000000');
}
}
}

View File

@ -30,4 +30,4 @@ class BuiltIn
}
return array('rgb' => '000000');
}
}
}

View File

@ -27,4 +27,4 @@ class ErrorCode
}
return false;
}
}
}

View File

@ -2,25 +2,25 @@
namespace PHPExcel\Reader\Excel5\Style;
use \PHPExcel\Style\Border;
use \PHPExcel\Style\Border as StyleBorder;
class Border
{
protected static $map = array(
0x00 => Border::BORDER_NONE,
0x01 => Border::BORDER_THIN,
0x02 => Border::BORDER_MEDIUM,
0x03 => Border::BORDER_DASHED,
0x04 => Border::BORDER_DOTTED,
0x05 => Border::BORDER_THICK,
0x06 => Border::BORDER_DOUBLE,
0x07 => Border::BORDER_HAIR,
0x08 => Border::BORDER_MEDIUMDASHED,
0x09 => Border::BORDER_DASHDOT,
0x0A => Border::BORDER_MEDIUMDASHDOT,
0x0B => Border::BORDER_DASHDOTDOT,
0x0C => Border::BORDER_MEDIUMDASHDOTDOT,
0x0D => Border::BORDER_SLANTDASHDOT,
0x00 => StyleBorder::BORDER_NONE,
0x01 => StyleBorder::BORDER_THIN,
0x02 => StyleBorder::BORDER_MEDIUM,
0x03 => StyleBorder::BORDER_DASHED,
0x04 => StyleBorder::BORDER_DOTTED,
0x05 => StyleBorder::BORDER_THICK,
0x06 => StyleBorder::BORDER_DOUBLE,
0x07 => StyleBorder::BORDER_HAIR,
0x08 => StyleBorder::BORDER_MEDIUMDASHED,
0x09 => StyleBorder::BORDER_DASHDOT,
0x0A => StyleBorder::BORDER_MEDIUMDASHDOT,
0x0B => StyleBorder::BORDER_DASHDOTDOT,
0x0C => StyleBorder::BORDER_MEDIUMDASHDOTDOT,
0x0D => StyleBorder::BORDER_SLANTDASHDOT,
);
/**
@ -35,6 +35,6 @@ class Border
if (isset(self::$map[$index])) {
return self::$map[$index];
}
return Border::BORDER_NONE;
return StyleBorder::BORDER_NONE;
}
}
}

View File

@ -42,4 +42,4 @@ class FillPattern
}
return Fill::FILL_NONE;
}
}
}

View File

@ -118,10 +118,10 @@ class CodePage
return 'CP950'; // Macintosh Chinese Traditional
case 10003:
return 'CP1361'; // Macintosh Korean
case 10004:
return 'MACARABIC'; // Apple Arabic
case 10004:
return 'MACARABIC'; // Apple Arabic
case 10005:
return 'MACHEBREW'; // Apple Hebrew
return 'MACHEBREW'; // Apple Hebrew
case 10006:
return 'MACGREEK'; // Macintosh Greek
case 10007:
@ -129,11 +129,11 @@ class CodePage
case 10008:
return 'CP936'; // Macintosh - Simplified Chinese (GB 2312)
case 10010:
return 'MACROMANIA'; // Macintosh Romania
return 'MACROMANIA'; // Macintosh Romania
case 10017:
return 'MACUKRAINE'; // Macintosh Ukraine
return 'MACUKRAINE'; // Macintosh Ukraine
case 10021:
return 'MACTHAI'; // Macintosh Thai
return 'MACTHAI'; // Macintosh Thai
case 10029:
return 'MACCENTRALEUROPE'; // Macintosh Central Europe
case 10079:
@ -141,7 +141,7 @@ class CodePage
case 10081:
return 'MACTURKISH'; // Macintosh Turkish
case 10082:
return 'MACCROATIAN'; // Macintosh Croatian
return 'MACCROATIAN'; // Macintosh Croatian
case 21010:
return 'UTF-16LE'; // UTF-16 (BIFF8) This isn't correct, but some Excel writer libraries erroneously use Codepage 21010 for UTF-16LE
case 32768:

View File

@ -154,7 +154,8 @@ class ZipArchive
return $contents;
}
public function getFromIndex($index) {
public function getFromIndex($index)
{
$extracted = $this->zip->extractByIndex($index, PCLZIP_OPT_EXTRACT_AS_STRING);
$contents = '';
if ((is_array($extracted)) && ($extracted != 0)) {

View File

@ -238,7 +238,7 @@ class Spreadsheet
{
$returnData = null;
$what = strtolower($what);
switch ($what){
switch ($what) {
case 'all':
$returnData = $this->ribbonXMLData;
break;
@ -282,7 +282,7 @@ class Spreadsheet
{
$ReturnData = null;
$What = strtolower($What);
switch($What) {
switch ($What) {
case 'all':
return $this->ribbonBinObjects;
break;

View File

@ -447,11 +447,13 @@ class NumberFormat extends Supervisor implements \PHPExcel\IComparable
'h' => 'g'
);
private static function setLowercaseCallback($matches) {
private static function setLowercaseCallback($matches)
{
return mb_strtolower($matches[0]);
}
private static function escapeQuotesCallback($matches) {
private static function escapeQuotesCallback($matches)
{
return '\\' . implode('\\', str_split($matches[1]));
}
@ -468,7 +470,7 @@ class NumberFormat extends Supervisor implements \PHPExcel\IComparable
// Only process the non-quoted blocks for date format characters
$blocks = explode('"', $format);
foreach($blocks as $key => &$block) {
foreach ($blocks as $key => &$block) {
if ($key % 2 == 0) {
$block = strtr($block, self::$dateFormatReplacements);
if (!strpos($block, 'A')) {

View File

@ -146,7 +146,7 @@ class ContentTypes extends WriterPart
$mimeType = $this->getParentWriter()->getDrawingHashTable()->getByIndex($i)->getMimeType();
}
if (!isset( $aMediaContentTypes[$extension])) {
if (!isset($aMediaContentTypes[$extension])) {
$aMediaContentTypes[$extension] = $mimeType;
$this->writeDefaultContentType($objWriter, $extension, $mimeType);
@ -165,7 +165,7 @@ class ContentTypes extends WriterPart
for ($i = 0; $i < $sheetCount; ++$i) {
if (count($pPHPExcel->getSheet()->getHeaderFooter()->getImages()) > 0) {
foreach ($pPHPExcel->getSheet()->getHeaderFooter()->getImages() as $image) {
if (!isset( $aMediaContentTypes[strtolower($image->getExtension())])) {
if (!isset($aMediaContentTypes[strtolower($image->getExtension())])) {
$aMediaContentTypes[strtolower($image->getExtension())] = $this->getImageMimeType($image->getPath());
$this->writeDefaultContentType($objWriter, strtolower($image->getExtension()), $aMediaContentTypes[strtolower($image->getExtension())]);

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer\Excel2007;
/**
* PHPExcel
*

View File

@ -1,5 +1,6 @@
<?php
namespace PHPExcel\Writer\Excel2007;
/**
* PHPExcel
*

View File

@ -3233,7 +3233,8 @@ class Worksheet extends BIFFwriter
$dataBlockFont .= pack('C', 0x21);
$fontUnderline = 0;
break;
default: $dataBlockFont .= pack('C', 0x00);
default:
$dataBlockFont .= pack('C', 0x00);
$fontUnderline = 1;
break;
}

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer;
/**
* PHPExcel_Writer_HTML
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Writer_HTML extends PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
class HTML extends BaseWriter implements IWriter
{
/**
* PHPExcel object

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer;
/**
* PHPExcel_Writer_OpenDocument
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Writer_OpenDocument extends PHPExcel_Writer_Abstract implements PHPExcel_Writer_IWriter
class OpenDocument extends BaseWriter implements IWriter
{
/**
* Private writer parts

View File

@ -1,4 +1,7 @@
<?php
namespace PHPExcel\Writer\OpenDocument\Cell;
/**
* PHPExcel
*
@ -34,7 +37,7 @@
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @author Alexander Pervakov <frost-nzcr4@jagmort.com>
*/
class PHPExcel_Writer_OpenDocument_Cell_Comment
class Comment
{
public static function write(PHPExcel_Shared_XMLWriter $objWriter, PHPExcel_Cell $cell)
{

View File

@ -1,4 +1,7 @@
<?php
namespace PHPExcel\Writer\OpenDocument;
/**
* PHPExcel
*
@ -34,7 +37,7 @@
* @copyright Copyright (c) 2006 - 2015 PHPExcel (http://www.codeplex.com/PHPExcel)
* @author Alexander Pervakov <frost-nzcr4@jagmort.com>
*/
class PHPExcel_Writer_OpenDocument_Content extends PHPExcel_Writer_OpenDocument_WriterPart
class Content extends WriterPart
{
const NUMBER_COLS_REPEATED_MAX = 1024;
const NUMBER_ROWS_REPEATED_MAX = 1048576;

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer\OpenDocument;
/**
* PHPExcel_Writer_OpenDocument_Meta
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Writer_OpenDocument_Meta extends PHPExcel_Writer_OpenDocument_WriterPart
class Meta extends WriterPart
{
/**
* Write meta.xml to XML format

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer\OpenDocument;
/**
* PHPExcel_Writer_OpenDocument_MetaInf
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Writer_OpenDocument_MetaInf extends PHPExcel_Writer_OpenDocument_WriterPart
class MetaInf extends WriterPart
{
/**
* Write META-INF/manifest.xml to XML format

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer\OpenDocument;
/**
* PHPExcel
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Writer_OpenDocument_Mimetype extends PHPExcel_Writer_OpenDocument_WriterPart
class Mimetype extends WriterPart
{
/**
* Write mimetype to plain text format

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer\OpenDocument;
/**
* PHPExcel_Writer_OpenDocument_Settings
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Writer_OpenDocument_Settings extends PHPExcel_Writer_OpenDocument_WriterPart
class Settings extends WriterPart
{
/**
* Write settings.xml to XML format

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer\OpenDocument;
/**
* PHPExcel_Writer_OpenDocument_Styles
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Writer_OpenDocument_Styles extends PHPExcel_Writer_OpenDocument_WriterPart
class Styles extends WriterPart
{
/**
* Write styles.xml to XML format

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer\OpenDocument;
/**
* PHPExcel_Writer_OpenDocument_Thumbnails
*
@ -25,7 +27,7 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
class PHPExcel_Writer_OpenDocument_Thumbnails extends PHPExcel_Writer_OpenDocument_WriterPart
class Thumbnails extends WriterPart
{
/**
* Write Thumbnails/thumbnail.png to PNG format

View File

@ -1,5 +1,7 @@
<?php
namespace PHPExcel\Writer\OpenDocument;
/**
* PHPExcel_Writer_OpenDocument_WriterPart
*
@ -25,6 +27,6 @@
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
* @version ##VERSION##, ##DATE##
*/
abstract class PHPExcel_Writer_OpenDocument_WriterPart extends \PHPExcel\Writer\Excel2007\WriterPart
abstract class WriterPart extends \PHPExcel\Writer\Excel2007\WriterPart
{
}