From 6b4feb6142e3422554ae058c4983dccfc3a555fc Mon Sep 17 00:00:00 2001 From: Owen Leibman Date: Fri, 27 Nov 2020 07:16:23 -0800 Subject: [PATCH] Changes for Scrutinizer Two changes to fix minor problems reported by Scrutinizer. --- tests/PhpSpreadsheetTests/DefinedNameTest.php | 10 ++++------ tests/PhpSpreadsheetTests/IOFactoryTest.php | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/tests/PhpSpreadsheetTests/DefinedNameTest.php b/tests/PhpSpreadsheetTests/DefinedNameTest.php index c199e7f2..8a411775 100644 --- a/tests/PhpSpreadsheetTests/DefinedNameTest.php +++ b/tests/PhpSpreadsheetTests/DefinedNameTest.php @@ -137,12 +137,10 @@ class DefinedNameTest extends TestCase $namedRange = $this->spreadsheet->getDefinedName('XYZ'); self::assertInstanceOf(NamedRange::class, $namedRange); - if ($namedRange instanceof NamedRange) { - self::assertEquals('A1', $namedRange->getRange()); - self::assertEquals('A1', $namedRange->getValue()); - $namedRange->setRange('A2'); - self::assertEquals('A2', $namedRange->getValue()); - } + self::assertEquals('A1', $namedRange->getRange()); + self::assertEquals('A1', $namedRange->getValue()); + $namedRange->setRange('A2'); + self::assertEquals('A2', $namedRange->getValue()); } public function testChangeWorksheet(): void diff --git a/tests/PhpSpreadsheetTests/IOFactoryTest.php b/tests/PhpSpreadsheetTests/IOFactoryTest.php index 9b07ad33..886fcb36 100644 --- a/tests/PhpSpreadsheetTests/IOFactoryTest.php +++ b/tests/PhpSpreadsheetTests/IOFactoryTest.php @@ -200,6 +200,6 @@ class IOFactoryTest extends TestCase { $this->expectException(\PhpOffice\PhpSpreadsheet\Reader\Exception::class); $filename = __FILE__; - $reader = IOFactory::createReaderForFile($filename); + IOFactory::createReaderForFile($filename); } }