Fix code style
This commit is contained in:
1 parent
740fcfb8c1
commit
b968513cb9
171 files changed
+517
-792
No files matched your search
@@ -3,19 +3,15 @@
|
||||
namespace Box\Spout\Reader\CSV;
|
||||
|
||||
use Box\Spout\Common\Creator\HelperFactory;
|
||||
use Box\Spout\Common\Helper\EncodingHelper;
|
||||
use Box\Spout\Common\Helper\GlobalFunctionsHelper;
|
||||
use Box\Spout\Reader\CSV\Creator\EntityFactory;
|
||||
use Box\Spout\Reader\CSV\Manager\OptionsManager;
|
||||
use Box\Spout\Reader\ReaderFactory;
|
||||
use Box\Spout\Common\Type;
|
||||
use Box\Spout\Common\Helper\EncodingHelper;
|
||||
use Box\Spout\Reader\ReaderInterface;
|
||||
use Box\Spout\TestUsingResource;
|
||||
|
||||
/**
|
||||
* Class ReaderTest
|
||||
*
|
||||
* @package Box\Spout\Reader\CSV
|
||||
*/
|
||||
class ReaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
@@ -79,7 +75,6 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
|
||||
$reader->open($resourcePath);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
@@ -144,7 +139,9 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
$allRows = $this->getAllRowsForFile(
|
||||
'csv_with_multiple_empty_lines.csv',
|
||||
',', '"', EncodingHelper::ENCODING_UTF8,
|
||||
',',
|
||||
'"',
|
||||
EncodingHelper::ENCODING_UTF8,
|
||||
$shouldPreserveEmptyRows = true
|
||||
);
|
||||
|
||||
@@ -379,7 +376,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');
|
||||
}
|
||||
@@ -395,7 +392,7 @@ 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');
|
||||
}
|
||||
@@ -490,8 +487,8 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
|
||||
$fieldDelimiter = ',',
|
||||
$fieldEnclosure = '"',
|
||||
$encoding = EncodingHelper::ENCODING_UTF8,
|
||||
$shouldPreserveEmptyRows = false)
|
||||
{
|
||||
$shouldPreserveEmptyRows = false
|
||||
) {
|
||||
$allRows = [];
|
||||
$resourcePath = $this->getResourcePath($fileName);
|
||||
|
||||
@@ -514,5 +511,4 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
return $allRows;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,8 +8,6 @@ use Box\Spout\TestUsingResource;
|
||||
|
||||
/**
|
||||
* Class SheetTest
|
||||
*
|
||||
* @package Box\Spout\Reader\CSV
|
||||
*/
|
||||
class SheetTest extends \PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
@@ -6,8 +6,6 @@ namespace Box\Spout\Reader\CSV;
|
||||
* Class SpoutTestStream
|
||||
* Custom stream that reads CSV files located in the tests/resources/csv folder.
|
||||
* For example: spout://foobar will point to tests/resources/csv/foobar.csv
|
||||
*
|
||||
* @package Box\Spout\Reader\CSV
|
||||
*/
|
||||
class SpoutTestStream
|
||||
{
|
||||
@@ -30,6 +28,7 @@ class SpoutTestStream
|
||||
public function url_stat($path, $flag)
|
||||
{
|
||||
$filePath = $this->getFilePathFromStreamPath($path);
|
||||
|
||||
return stat($filePath);
|
||||
}
|
||||
|
||||
@@ -40,6 +39,7 @@ class SpoutTestStream
|
||||
private function getFilePathFromStreamPath($streamPath)
|
||||
{
|
||||
$fileName = parse_url($streamPath, PHP_URL_HOST);
|
||||
|
||||
return self::PATH_TO_CSV_RESOURCES . $fileName . self::CSV_EXTENSION;
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ class SpoutTestStream
|
||||
public function stream_read($numBytes)
|
||||
{
|
||||
$this->position += $numBytes;
|
||||
|
||||
return fread($this->fileHandle, $numBytes);
|
||||
}
|
||||
|
||||
@@ -93,7 +94,7 @@ class SpoutTestStream
|
||||
|
||||
if ($whence === SEEK_SET) {
|
||||
$this->position = $offset;
|
||||
} else if ($whence === SEEK_CUR) {
|
||||
} elseif ($whence === SEEK_CUR) {
|
||||
$this->position += $offset;
|
||||
} else {
|
||||
// not implemented
|
||||
|
||||
Reference in new issue
Block a user