PSR2 Fixes

This commit is contained in:
Progi1984 2015-05-17 18:34:30 +02:00
parent 576effef30
commit b6bc0db105
39 changed files with 285 additions and 345 deletions

View File

@ -391,7 +391,7 @@ class PHPExcel_Worksheet implements PHPExcel_IComparable
* Code to execute when this worksheet is unset()
*
*/
function __destruct()
public function __destruct()
{
PHPExcel_Calculation::getInstance($this->_parent)->clearCalculationCacheForWorksheet($this->_title);

View File

@ -6,8 +6,7 @@ class AutoloaderTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -52,5 +51,4 @@ class AutoloaderTest extends PHPUnit_Framework_TestCase
// ... of the correct type
$this->assertTrue(is_a($result,'PHPExcel_Calculation_Function'));
}
}

View File

@ -8,8 +8,7 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -462,5 +461,4 @@ class DateTimeTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/Calculation/DateTime/YEARFRAC.data');
}
}

View File

@ -12,8 +12,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -174,8 +173,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMCONJUGATE'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMCONJUGATE()
@ -192,8 +190,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMCOS'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMCOS()
@ -210,8 +207,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMDIV'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMDIV()
@ -228,8 +224,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMEXP'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMEXP()
@ -246,8 +241,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLN'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMLN()
@ -264,8 +258,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLOG2'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMLOG2()
@ -282,8 +275,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMLOG10'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMLOG10()
@ -300,8 +292,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMPOWER'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMPOWER()
@ -318,8 +309,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMPRODUCT'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMPRODUCT()
@ -336,8 +326,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSIN'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMSIN()
@ -354,8 +343,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSQRT'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMSQRT()
@ -372,8 +360,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSUB'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMSUB()
@ -390,8 +377,7 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
$expectedResult = array_pop($args);
$result = call_user_func_array(array('PHPExcel_Calculation_Engineering','IMSUM'), $args);
$complexAssert = new complexAssert();
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8),
$complexAssert->getErrorMessage());
$this->assertTrue($complexAssert->assertComplexEquals($expectedResult, $result, 1E-8), $complexAssert->getErrorMessage());
}
public function providerIMSUM()
@ -694,5 +680,4 @@ class EngineeringTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/Calculation/Engineering/CONVERTUOM.data');
}
}

View File

@ -8,8 +8,7 @@ class FinancialTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -512,5 +511,4 @@ class FinancialTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/Calculation/Financial/XIRR.data');
}
}

View File

@ -8,8 +8,7 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -272,5 +271,4 @@ class FunctionsTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/Calculation/Functions/N.data');
}
}

View File

@ -8,8 +8,7 @@ class LogicalTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -108,5 +107,4 @@ class LogicalTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/Calculation/Logical/IFERROR.data');
}
}

View File

@ -8,8 +8,7 @@ class LookupRefTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -48,5 +47,4 @@ class LookupRefTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/Calculation/LookupRef/VLOOKUP.data');
}
}

View File

@ -8,8 +8,7 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -556,5 +555,4 @@ class MathTrigTest extends PHPUnit_Framework_TestCase
),
);
}
}

View File

@ -8,8 +8,7 @@ class TextDataTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -361,5 +360,4 @@ class TextDataTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/Calculation/TextData/VALUE.data');
}
}

View File

@ -4,7 +4,6 @@ require_once 'testDataFileIterator.php';
class CalculationTest extends PHPUnit_Framework_TestCase
{
public function setUp()
{
if (!defined('PHPEXCEL_ROOT')) {
@ -33,5 +32,4 @@ class CalculationTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/CalculationBinaryComparisonOperation.data');
}
}

View File

@ -6,8 +6,7 @@ class DataTypeTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -20,5 +19,4 @@ class DataTypeTest extends PHPUnit_Framework_TestCase
$this->assertGreaterThan(0, count($result));
$this->assertArrayHasKey('#NULL!', $result);
}
}

View File

@ -8,8 +8,7 @@ class DefaultValueBinderTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');

View File

@ -6,8 +6,7 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -84,5 +83,4 @@ class HyperlinkTest extends PHPUnit_Framework_TestCase
$result = $testInstance->getHashCode();
$this->assertEquals($initialExpectedHash, $result);
}
}

View File

@ -291,5 +291,4 @@ class CellTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/CellExtractAllCellReferencesInRange.data');
}
}

View File

@ -6,8 +6,7 @@ class DataSeriesValuesTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -51,5 +50,4 @@ class DataSeriesValuesTest extends PHPUnit_Framework_TestCase
$result = $testInstance->getDataType();
$this->assertEquals($dataTypeValue, $result);
}
}

View File

@ -6,8 +6,7 @@ class LayoutTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -33,5 +32,4 @@ class LayoutTest extends PHPUnit_Framework_TestCase
$result = $testInstance->getLayoutTarget();
$this->assertEquals($LayoutTargetValue, $result);
}
}

View File

@ -6,8 +6,7 @@ class LegendTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');

View File

@ -51,5 +51,4 @@ class XEEValidatorTest extends PHPUnit_Framework_TestCase
}
return $tests;
}
}

View File

@ -54,5 +54,4 @@ class ReferenceHelperTest extends PHPUnit_Framework_TestCase
$this->assertEquals($columnExpectedResult[$key], $value);
}
}
}

View File

@ -53,5 +53,4 @@ class CodePageTest extends PHPUnit_Framework_TestCase
}
$this->fail('An expected exception has not been raised.');
}
}

View File

@ -184,5 +184,4 @@ class DateTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/Shared/DateTimeExcelToPHP1900Timezone.data');
}
}

View File

@ -16,7 +16,7 @@ class FileTest extends PHPUnit_Framework_TestCase
public function testGetUseUploadTempDirectory()
{
$expectedResult = FALSE;
$expectedResult = false;
$result = call_user_func(array('PHPExcel_Shared_File','getUseUploadTempDirectory'));
$this->assertEquals($expectedResult, $result);

View File

@ -90,5 +90,4 @@ class FontTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/Shared/CentimeterSizeToPixels.data');
}
}

View File

@ -29,5 +29,4 @@ class PasswordHasherTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/Shared/PasswordHashes.data');
}
}

View File

@ -79,5 +79,4 @@ class StringTest extends PHPUnit_Framework_TestCase
$result = call_user_func(array('PHPExcel_Shared_String','getCurrencyCode'));
$this->assertEquals($expectedResult, $result);
}
}

View File

@ -35,5 +35,4 @@ class TimeZoneTest extends PHPUnit_Framework_TestCase
$result = call_user_func(array('PHPExcel_Shared_TimeZone','setTimezone'), $unsupportedTimezone);
$this->assertFalse($result);
}
}

View File

@ -77,5 +77,4 @@ class ColorTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/Style/ColorChangeBrightness.data');
}
}

View File

@ -32,5 +32,4 @@ class NumberFormatTest extends PHPUnit_Framework_TestCase
{
return new testDataFileIterator('rawTestData/Style/NumberFormat.data');
}
}

View File

@ -105,5 +105,4 @@ class RuleTest extends PHPUnit_Framework_TestCase
$result = clone $this->_testAutoFilterRuleObject;
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column_Rule', $result);
}
}

View File

@ -169,5 +169,4 @@ class AutofilterColumnTest extends PHPUnit_Framework_TestCase
$result = clone $this->_testAutoFilterColumnObject;
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter_Column', $result);
}
}

View File

@ -336,5 +336,4 @@ class AutoFilterTest extends PHPUnit_Framework_TestCase
$result = clone $this->_testAutoFilterObject;
$this->assertInstanceOf('PHPExcel_Worksheet_AutoFilter', $result);
}
}

View File

@ -5,8 +5,7 @@ class CellCollectionTest extends PHPUnit_Framework_TestCase
public function setUp()
{
if (!defined('PHPEXCEL_ROOT'))
{
if (!defined('PHPEXCEL_ROOT')) {
define('PHPEXCEL_ROOT', APPLICATION_PATH . '/');
}
require_once(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
@ -27,5 +26,4 @@ class CellCollectionTest extends PHPUnit_Framework_TestCase
PHPExcel_CachedObjectStorageFactory::finalize();
}
}
}

View File

@ -85,5 +85,4 @@ class ColumnIteratorTest extends PHPUnit_Framework_TestCase
$iterator = new PHPExcel_Worksheet_ColumnIterator($this->mockWorksheet, 'B', 'D');
$iterator->prev();
}
}

View File

@ -85,5 +85,4 @@ class RowCellIteratorTest extends PHPUnit_Framework_TestCase
$iterator = new PHPExcel_Worksheet_RowCellIterator($this->mockWorksheet, 2, 'B', 'D');
$iterator->prev();
}
}

View File

@ -83,5 +83,4 @@ class RowIteratorTest extends PHPUnit_Framework_TestCase
$iterator = new PHPExcel_Worksheet_RowIterator($this->mockWorksheet, 2, 4);
$iterator->prev();
}
}

View File

@ -93,7 +93,8 @@ class Complex
return $this->suffix;
}
public function __toString() {
public function __toString()
{
$str = "";
if ($this->imaginaryPart != 0.0) {
if (abs($this->imaginaryPart) != 1.0) {
@ -103,13 +104,14 @@ class Complex
}
}
if ($this->realPart != 0.0) {
if (($str) && ($this->imaginaryPart > 0.0))
if (($str) && ($this->imaginaryPart > 0.0)) {
$str = "+" . $str;
}
$str = $this->realPart . $str;
}
if (!$str)
if (!$str) {
$str = "0.0";
}
return $str;
}
}