-
-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality] Handle crash previous duplicated on ThrowWithPreviousEx…
…ceptionRector (#6773) * [CodeQuality] Handle crash previous duplicated on ThrowWithPreviousExceptionRector * Fix * fix phpstan * [ci-review] Rector Rectify --------- Co-authored-by: GitHub Action <actions@github.com>
- Loading branch information
1 parent
01e60df
commit 483849a
Showing
2 changed files
with
43 additions
and
5 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
...ty/Rector/Catch_/ThrowWithPreviousExceptionRector/Fixture/named_argument_previous.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector\Fixture; | ||
|
||
class NamedArgumentPrevious | ||
{ | ||
public function run() | ||
{ | ||
try { | ||
throw new \Exception('foo'); | ||
} catch (\Throwable $e) { | ||
throw new \RuntimeException(previous: $e); | ||
} | ||
} | ||
} | ||
|
||
?> | ||
----- | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector\Fixture; | ||
|
||
class NamedArgumentPrevious | ||
{ | ||
public function run() | ||
{ | ||
try { | ||
throw new \Exception('foo'); | ||
} catch (\Throwable $e) { | ||
throw new \RuntimeException(message: $e->getMessage(), code: $e->getCode(), previous: $e); | ||
} | ||
} | ||
} | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters