8000 minor #48006 [DomCrawler] remove duplicated catch block (PhilETaylor) · Nommyde/symfony@94dc762 · GitHub
[go: up one dir, main page]

Skip to content

Commit 94dc762

Browse files
committed
minor symfony#48006 [DomCrawler] remove duplicated catch block (PhilETaylor)
This PR was merged into the 5.4 branch. Discussion ---------- [DomCrawler] remove duplicated catch block | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | License | MIT Exception '\PHPUnit\Framework\Error\Notice' is already caught - this PR deletes unused/unreachable code. Before: ```php try { $crawler = $this->createCrawler('<p></p>'); $crawler->filter('p')->children(); $this->assertTrue(true, '->children() does not trigger a notice if the node has no children'); } catch (\PHPUnit\Framework\Error\Notice $e) { $this->fail('->children() does not trigger a notice if the node has no children'); } catch (\PHPUnit\Framework\Error\Notice $e) { $this->fail('->children() does not trigger a notice if the node has no children'); } ``` After ```php try { $crawler = $this->createCrawler('<p></p>'); $crawler->filter('p')->children(); $this->assertTrue(true, '->children() does not trigger a notice if the node has no children'); } catch (\PHP 8000 Unit\Framework\Error\Notice $e) { $this->fail('->children() does not trigger a notice if the node has no children'); } ``` Commits ------- dc40fb5 remove duplicated catch block
2 parents a18aad8 + dc40fb5 commit 94dc762

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

src/Symfony/Component/DomCrawler/Tests/AbstractCrawlerTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,8 +1072,6 @@ public function testChildren()
10721072
$this->assertTrue(true, '->children() does not trigger a notice if the node has no children');
10731073
} catch (\PHPUnit\Framework\Error\Notice $e) {
10741074
$this->fail('->children() does not trigger a notice if the node has no children');
1075-
} catch (\PHPUnit\Framework\Error\Notice $e) {
1076-
$this->fail('->children() does not trigger a notice if the node has no children');
10771075
}
10781076
}
10791077

0 commit comments

Comments
 (0)
0