Add phpstan until level 7

This commit is contained in:
Antoine Lamirault committed 2021-09-18 18:09:14 +02:00
1 parent ab973cab34
commit bfb7c2c68f
114 files changed
+527 -319

No files matched your search

+1 -1
View File
@@ -61,7 +61,7 @@ class WriterPerfTest extends TestCase
*/
private function getNumWrittenRows($resourcePath)
{
$lineCountResult = `wc -l $resourcePath`;
$lineCountResult = shell_exec("wc -l $resourcePath");
return (int) $lineCountResult;
}
+7 -3
View File
@@ -69,6 +69,7 @@ class WriterTest extends TestCase
$this->expectException(InvalidArgumentException::class);
$writer = WriterEntityFactory::createCSVWriter();
/* @phpstan-ignore-next-line */
$writer->addRows([['csv--11', 'csv--12']]);
$writer->close();
}
@@ -176,7 +177,7 @@ class WriterTest extends TestCase
$this->assertEquals('#This is, a comma#,csv--12,csv--13', $writtenContent, 'The fields should be enclosed with #');
}
public function testWriteShouldSupportedEscapedCharacters()
public function testWriteShouldSupportedEscapedCharacters() : void
{
$allRows = $this->createRowsFromValues([
['"csv--11"', 'csv--12\\', 'csv--13\\\\', 'csv--14\\\\\\'],
@@ -193,7 +194,7 @@ class WriterTest extends TestCase
* @param string $fieldDelimiter
* @param string $fieldEnclosure
* @param bool $shouldAddBOM
* @return string|null
* @return string
*/
private function writeToCsvFileAndReturnWrittenContent($allRows, $fileName, $fieldDelimiter = ',', $fieldEnclosure = '"', $shouldAddBOM = true)
{
@@ -209,7 +210,10 @@ class WriterTest extends TestCase
$writer->addRows($allRows);
$writer->close();
return file_get_contents($resourcePath);
/** @var string $content */
$content = file_get_contents($resourcePath);
return $content;
}
/**