-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FPPP: Add support for removal from list nodes
- Loading branch information
Showing
3 changed files
with
67 additions
and
5 deletions.
There are no files selected for viewing
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
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
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,40 @@ | ||
Removing from list nodes | ||
----- | ||
<?php $foo; $bar; $baz; | ||
----- | ||
array_splice($stmts, 1, 1, []); | ||
----- | ||
<?php $foo; $baz; | ||
----- | ||
<?php | ||
function foo( | ||
$a, | ||
$b, | ||
$c | ||
) {} | ||
----- | ||
array_pop($stmts[0]->params); | ||
----- | ||
<?php | ||
function foo( | ||
$a, | ||
$b | ||
) {} | ||
----- | ||
<?php | ||
function foo( | ||
$a, | ||
$b, | ||
$c | ||
) {} | ||
----- | ||
array_pop($stmts[0]->params); | ||
$stmts[0]->params[] = new Node\Param(new Expr\Variable('x')); | ||
$stmts[0]->params[] = new Node\Param(new Expr\Variable('y')); | ||
/* TODO The insertion here should try to to honor the style */ | ||
----- | ||
<?php | ||
function foo( | ||
$a, | ||
$b, $x, $y | ||
) {} |