-
-
Notifications
You must be signed in to change notification settings - Fork 336
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TypeDeclaration] Skip conditional Throw_ on ReturnNeverTypeRector (#…
…1217) Co-authored-by: Markus Staab <markus.staab@redaxo.de> Co-authored-by: GitHub Action <action@github.com>
- Loading branch information
1 parent
5f9adb6
commit af81708
Showing
3 changed files
with
28 additions
and
4 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
...laration/Rector/ClassMethod/ReturnNeverTypeRector/Fixture/skip_conditional_throw2.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,12 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector\Fixture; | ||
|
||
function assertEmptyOutputBuffer($messagePrefix) | ||
{ | ||
if (Rocket::isAppMode('development')) { | ||
if (ob_get_length() > 0) { | ||
throw new Exception($messagePrefix.'Unexpected start of output:'.print_r(ob_get_contents(), true)); | ||
} | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...laration/Rector/ClassMethod/ReturnNeverTypeRector/Fixture/skip_conditional_throw3.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,14 @@ | ||
<?php | ||
namespace Rector\Tests\TypeDeclaration\Rector\ClassMethod\ReturnNeverTypeRector\Fixture; | ||
|
||
class X { | ||
protected function configBoot() | ||
{ | ||
if (isset($helper_files)) { | ||
throw new Exception('error'); | ||
} | ||
if (isset($builtin_files)) { | ||
throw new Exception('error'); | ||
} | ||
} | ||
} |
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