Skip to content
Merged

Cleanup #1714

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/AllRectorsOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -3547,7 +3547,7 @@ services:

- class: `Rector\Php\Rector\FuncCall\PregReplaceEModifierRector`

The /e modifier is no longer supported, use preg_replace_callback instead
The /e modifier is no longer supported, use preg_replace_callback instead

```diff
class SomeClass
Expand Down
2 changes: 1 addition & 1 deletion docs/NodesOverview.md
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,7 @@ if (true) {

```php
?>
<strong>feel</strong><?php
<strong>feel</strong><?php
```
<br>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,7 @@ public function refactor(Node $node): ?Node
}

$variable = $node->left->args[0]->value;
}

if ($node->right instanceof FuncCall) {
} elseif ($node->right instanceof FuncCall) {
if (! $this->isName($node->right, 'strlen')) {
return null;
}
Expand All @@ -76,6 +74,8 @@ public function refactor(Node $node): ?Node
}

$variable = $node->right->args[0]->value;
} else {
return null;
}

/** @var Expr $variable */
Expand Down
8 changes: 2 additions & 6 deletions tests/PhpParser/Node/Value/ValueResolverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rector\Tests\PhpParser\Node\Value;

use Generator;
use Iterator;
use PhpParser\BuilderFactory;
use PhpParser\Node\Expr;
use PhpParser\Node\Expr\BinaryOp\Plus;
Expand All @@ -28,17 +28,13 @@ protected function setUp(): void
/**
* @dataProvider dataProvider
* @param mixed $expected
* @param Expr $expr
*/
public function test($expected, Expr $expr): void
{
$this->assertSame($expected, $this->valueResolver->resolve($expr));
}

/**
* @return Generator
*/
public function dataProvider(): Generator
public function dataProvider(): Iterator
{
$builderFactory = new BuilderFactory();

Expand Down