mirror of
https://github.com/phabelio/PHP-Parser.git
synced 2024-12-02 17:38:19 +01:00
40 lines
583 B
Plaintext
40 lines
583 B
Plaintext
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
|
|
) {} |