You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
0 commit comments