Skip to content

Commit 67e848e

Browse files
committed
add in try catch
1 parent e256776 commit 67e848e

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
namespace Rector\Tests\CodeQuality\Rector\ClassMethod\ExplicitReturnNullRector\Fixture;
4+
5+
final class SkipIfElseReturnInTryCatch
6+
{
7+
public function run(int $number)
8+
{
9+
if (rand(0, 1)) {
10+
try {
11+
return execute();
12+
} catch (\Exception $e) {
13+
return 2;
14+
}
15+
} else {
16+
return 2;
17+
}
18+
}
19+
}

0 commit comments

Comments
 (0)