mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-22 08:09:15 +00:00
Php-cs-fixer Upgrade
It generates a number of new easily-remedied messages.
This commit is contained in:
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user