Skip to content

Commit

Permalink
more fixture
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jan 2, 2025
1 parent 8c53cf8 commit 3dd6b90
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php

namespace Rector\Tests\Issues\ScopeNotAvailable\FixtureJsonThrowCaseSensitiveConstFetch;

class NonExactValueAfterUnreachableStmts
{
/**
* @param 'foo' $foo
*/
public static function run($foo)
{
if ($foo === 'foo') {
return;
}

echo 'some statement 1';
echo 'some statement 2';

function foo($foo) {
echo(json_encode($foo));
}
}
}

?>
-----
<?php

namespace Rector\Tests\Issues\ScopeNotAvailable\FixtureJsonThrowCaseSensitiveConstFetch;

class NonExactValueAfterUnreachableStmts
{
/**
* @param 'foo' $foo
*/
public static function run($foo)
{
if ($foo === 'foo') {
return;
}

echo 'some statement 1';
echo 'some statement 2';

function foo($foo) {
echo(json_encode($foo, JSON_THROW_ON_ERROR));
}
}
}

?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

namespace Rector\Tests\Issues\ScopeNotAvailable\FixtureJsonThrowCaseSensitiveConstFetch;

if (true) {
return;
}

echo 'some statement 1';
echo 'some statement 2';

function foo($foo) {
echo(json_encode($foo));
}

?>
-----
<?php

namespace Rector\Tests\Issues\ScopeNotAvailable\FixtureJsonThrowCaseSensitiveConstFetch;

if (true) {
return;
}

echo 'some statement 1';
echo 'some statement 2';

function foo($foo) {
echo(json_encode($foo, JSON_THROW_ON_ERROR));
}

?>

0 comments on commit 3dd6b90

Please sign in to comment.