Php-cs-fixer Upgrade

It generates a number of new easily-remedied messages.
This commit is contained in:
oleibman
2024-01-01 20:21:03 -08:00
parent a17a56b6e0
commit d164ad2211
15 changed files with 36 additions and 31 deletions
@@ -13,7 +13,7 @@ class ReadFilterFilter implements IReadFilter
* @param int $row Row number
* @param string $worksheetName Optional worksheet name
*
* @see \PhpOffice\PhpSpreadsheet\Reader\IReadFilter::readCell()
* @see IReadFilter::readCell()
*/
public function readCell($column, $row, $worksheetName = ''): bool
{
+3 -3
View File
@@ -171,7 +171,7 @@ class IOFactoryTest extends TestCase
public function testRegisterInvalidReader(): void
{
$this->expectException(\PhpOffice\PhpSpreadsheet\Reader\Exception::class);
$this->expectException(ReaderException::class);
IOFactory::registerReader('foo', 'bar');
}
@@ -185,7 +185,7 @@ class IOFactoryTest extends TestCase
public function testCreateInvalidReader(): void
{
$this->expectException(\PhpOffice\PhpSpreadsheet\Reader\Exception::class);
$this->expectException(ReaderException::class);
IOFactory::createReader('bad');
}
@@ -212,7 +212,7 @@ class IOFactoryTest extends TestCase
public function testCreateReaderNotSpreadsheet(): void
{
$this->expectException(\PhpOffice\PhpSpreadsheet\Reader\Exception::class);
$this->expectException(ReaderException::class);
$filename = __FILE__;
IOFactory::createReaderForFile($filename);
}
@@ -200,4 +200,13 @@ class GnumericLoadTest extends TestCase
$reader = new Gnumeric();
$reader->load($filename);
}
public function testDoctype(): void
{
$this->expectException(ReaderException::class);
$this->expectExceptionMessage('prevent XXE');
$filename = 'tests/data/Reader/Gnumeric/xmlwithdoctype.gnumeric';
$reader = new Gnumeric();
$reader->load($filename);
}
}
@@ -42,7 +42,7 @@ class XmlScannerTest extends TestCase
*/
public function testInvalidXML(mixed $filename): void
{
$this->expectException(\PhpOffice\PhpSpreadsheet\Reader\Exception::class);
$this->expectException(ReaderException::class);
$reader = XmlScanner::getInstance(new \PhpOffice\PhpSpreadsheet\Reader\Xml());
$expectedResult = 'FAILURE: Should throw an Exception rather than return a value';
@@ -375,7 +375,7 @@ class AutoFilterTest extends SetupTeardown
public function testGetColumnWithoutRangeSet(): void
{
$this->expectException(\PhpOffice\PhpSpreadsheet\Exception::class);
$this->expectException(PhpSpreadsheetException::class);
$sheet = $this->getSheet();
$autoFilter = $sheet->getAutoFilter();
$autoFilter->setRange(self::INITIAL_RANGE);
@@ -455,7 +455,7 @@ class TableTest extends SetupTeardown
public function testGetColumnWithoutRangeSet(): void
{
$this->expectException(\PhpOffice\PhpSpreadsheet\Exception::class);
$this->expectException(PhpSpreadsheetException::class);
$table = new Table(self::INITIAL_RANGE);
// Clear the range