From b812332afcc594a683f2334293ad61c6a24b67b0 Mon Sep 17 00:00:00 2001 From: Sebastian Bergmann Date: Fri, 7 Sep 2018 18:15:45 +0200 Subject: [PATCH] Fix return type (declaration) --- src/Runner/Filter/NameFilterIterator.php | 9 +++------ tests/unit/Runner/Filter/NameFilterIteratorTest.php | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/Runner/Filter/NameFilterIterator.php b/src/Runner/Filter/NameFilterIterator.php index 46e71875366..7d3bec6a5ec 100644 --- a/src/Runner/Filter/NameFilterIterator.php +++ b/src/Runner/Filter/NameFilterIterator.php @@ -89,10 +89,7 @@ protected function setFilter($filter) $this->filter = $filter; } - /** - * @return bool - */ - public function accept() + public function accept(): bool { $test = $this->getInnerIterator()->current(); @@ -105,7 +102,7 @@ public function accept() if ($test instanceof WarningTestCase) { $name = $test->getMessage(); } else { - if ($tmp[0] != '') { + if ($tmp[0] !== '') { $name = \implode('::', $tmp); } else { $name = $tmp[1]; @@ -119,6 +116,6 @@ public function accept() $accepted = $set >= $this->filterMin && $set <= $this->filterMax; } - return $accepted; + return (bool) $accepted; } } diff --git a/tests/unit/Runner/Filter/NameFilterIteratorTest.php b/tests/unit/Runner/Filter/NameFilterIteratorTest.php index 166fdc01223..d832851d686 100644 --- a/tests/unit/Runner/Filter/NameFilterIteratorTest.php +++ b/tests/unit/Runner/Filter/NameFilterIteratorTest.php @@ -16,12 +16,12 @@ class NameFilterIteratorTest extends TestCase { public function testCaseSensitiveMatch() { - $this->assertTrue((bool) $this->createFilter('BankAccountTest')->accept()); + $this->assertTrue($this->createFilter('BankAccountTest')->accept()); } public function testCaseInsensitiveMatch() { - $this->assertTrue((bool) $this->createFilter('bankaccounttest')->accept()); + $this->assertTrue($this->createFilter('bankaccounttest')->accept()); } private function createFilter(string $filter): NameFilterIterator