Fix code style

This commit is contained in:
Adrien Loison committed 2017-09-06 00:33:43 +02:00
1 parent 740fcfb8c1
commit b968513cb9
171 files changed
+517 -792

No files matched your search

@@ -4,8 +4,6 @@ namespace Box\Spout\Reader\XLSX\Helper;
/**
* Class CellHelperTest
*
* @package Box\Spout\Reader\XLSX\Helper
*/
class CellHelperTest extends \PHPUnit_Framework_TestCase
{
@@ -15,9 +13,9 @@ class CellHelperTest extends \PHPUnit_Framework_TestCase
public function dataProviderForTestFillMissingArrayIndexes()
{
return [
[ null, [] ],
[ [], [] ],
[ [1 => 1, 3 => 3], ['FILL', 1, 'FILL', 3] ]
[null, []],
[[], []],
[[1 => 1, 3 => 3], ['FILL', 1, 'FILL', 3]],
];
}
@@ -6,8 +6,6 @@ use Box\Spout\Common\Helper\Escaper;
/**
* Class CellValueFormatterTest
*
* @package Box\Spout\Reader\XLSX\Helper
*/
class CellValueFormatterTest extends \PHPUnit_Framework_TestCase
{
@@ -47,7 +45,7 @@ class CellValueFormatterTest extends \PHPUnit_Framework_TestCase
->expects($this->atLeastOnce())
->method('item')
->with(0)
->will($this->returnValue((object)['nodeValue' => $nodeValue]));
->will($this->returnValue((object) ['nodeValue' => $nodeValue]));
$nodeMock = $this->getMockBuilder('DOMElement')->disableOriginalConstructor()->getMock();
@@ -162,7 +160,7 @@ class CellValueFormatterTest extends \PHPUnit_Framework_TestCase
->expects($this->atLeastOnce())
->method('item')
->with(0)
->will($this->returnValue((object)['nodeValue' => $value]));
->will($this->returnValue((object) ['nodeValue' => $value]));
$nodeMock = $this->getMockBuilder('DOMElement')->disableOriginalConstructor()->getMock();
$nodeMock
@@ -4,8 +4,6 @@ namespace Box\Spout\Reader\XLSX\Helper;
/**
* Class DateFormatHelperTest
*
* @package Box\Spout\Reader\XLSX\Helper
*/
class DateFormatHelperTest extends \PHPUnit_Framework_TestCase
{
@@ -6,8 +6,6 @@ use Box\Spout\Reader\XLSX\Creator\HelperFactory;
/**
* Class CachingStrategyFactoryTest
*
* @package Box\Spout\Reader\XLSX\Manager\SharedStringsCaching
*/
class CachingStrategyFactoryTest extends \PHPUnit_Framework_TestCase
{
@@ -21,9 +19,9 @@ class CachingStrategyFactoryTest extends \PHPUnit_Framework_TestCase
[CachingStrategyFactory::MAX_NUM_STRINGS_PER_TEMP_FILE, -1, 'FileBasedStrategy'],
[CachingStrategyFactory::MAX_NUM_STRINGS_PER_TEMP_FILE + 10, -1, 'FileBasedStrategy'],
[CachingStrategyFactory::MAX_NUM_STRINGS_PER_TEMP_FILE - 10, -1, 'InMemoryStrategy'],
[10 , CachingStrategyFactory::AMOUNT_MEMORY_NEEDED_PER_STRING_IN_KB * 10, 'FileBasedStrategy'],
[10, CachingStrategyFactory::AMOUNT_MEMORY_NEEDED_PER_STRING_IN_KB * 10, 'FileBasedStrategy'],
[15, CachingStrategyFactory::AMOUNT_MEMORY_NEEDED_PER_STRING_IN_KB * 10, 'FileBasedStrategy'],
[5 , CachingStrategyFactory::AMOUNT_MEMORY_NEEDED_PER_STRING_IN_KB * 10, 'InMemoryStrategy'],
[5, CachingStrategyFactory::AMOUNT_MEMORY_NEEDED_PER_STRING_IN_KB * 10, 'InMemoryStrategy'],
];
}
@@ -12,8 +12,6 @@ use Box\Spout\TestUsingResource;
/**
* Class SharedStringsManagerTest
*
* @package Box\Spout\Reader\XLSX\Manager
*/
class SharedStringsManagerTest extends \PHPUnit_Framework_TestCase
{
@@ -9,12 +9,9 @@ use Box\Spout\Reader\XLSX\Manager\SharedStringsCaching\CachingStrategyFactory;
/**
* Class StyleManagerTest
*
* @package Box\Spout\Reader\XLSX\Manager
*/
class StyleManagerTest extends \PHPUnit_Framework_TestCase
{
/**
* @param array $styleAttributes
* @param array $customNumberFormats
+5 -9
View File
@@ -9,8 +9,6 @@ use Box\Spout\TestUsingResource;
/**
* Class ReaderTest
*
* @package Box\Spout\Reader\XLSX
*/
class ReaderTest extends \PHPUnit_Framework_TestCase
{
@@ -51,7 +49,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
['one_sheet_with_shared_strings.xlsx', 5, 5],
['one_sheet_with_inline_strings.xlsx', 5, 5],
['two_sheets_with_shared_strings.xlsx', 10, 5],
['two_sheets_with_inline_strings.xlsx', 10, 5]
['two_sheets_with_inline_strings.xlsx', 10, 5],
];
}
@@ -236,7 +234,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
\DateTime::createFromFormat('Y-m-d H:i:s', '1900-02-28 23:59:59'),
\DateTime::createFromFormat('Y-m-d H:i:s', '1900-03-01 00:00:00'),
\DateTime::createFromFormat('Y-m-d H:i:s', '1900-02-28 11:00:00'), // 1900-02-29 should be converted to 1900-02-28
]
],
];
$this->assertEquals($expectedRows, $allRows);
}
@@ -258,7 +256,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
\DateTime::createFromFormat('Y-m-d H:i:s', '1900-01-01 23:29:00'),
\DateTime::createFromFormat('Y-m-d H:i:s', '1900-01-01 01:42:25'),
\DateTime::createFromFormat('Y-m-d H:i:s', '1900-01-01 13:42:25'),
]
],
];
$this->assertEquals($expectedRows, $allRows);
}
@@ -579,7 +577,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
$expectedRows = [
['A', 'B', 'C'],
['1', '2', '3'],
['0', '0', '0']
['0', '0', '0'],
];
$this->assertEquals($expectedRows, $allRows, 'There should be only 3 rows, because zeros (0) are valid values');
}
@@ -595,12 +593,11 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
$expectedRows = [
['A', 'B', 'C'],
['0', '', ''],
['1', '1', '']
['1', '1', ''],
];
$this->assertEquals($expectedRows, $allRows, 'There should be 3 rows, with equal length');
}
/**
* https://github.com/box/spout/issues/195
* @return void
@@ -618,7 +615,6 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
$this->assertEquals($expectedRows, $allRows, 'Cell values should not be trimmed');
}
/**
* @param string $fileName
* @param bool $shouldFormatDates
-2
View File
@@ -8,8 +8,6 @@ use Box\Spout\TestUsingResource;
/**
* Class SheetTest
*
* @package Box\Spout\Reader\XLSX
*/
class SheetTest extends \PHPUnit_Framework_TestCase
{