Skip to content
Closed
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
34 changes: 34 additions & 0 deletions docs/nodes_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -1188,6 +1188,40 @@ $this->someProperty->methodName()

declare(strict_types=1);

use PhpParser\Node\Arg;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\Variable;
use PhpParser\Node\Identifier;
use PhpParser\Node\Scalar\String_;

$variable = new Variable('someObject');

$args = [];
$args[] = new Arg(new String_('yes'));
$args[] = new Arg(
value: new Variable('maybe'),
name: new Identifier(
name: 'argName'
)
);

$call = new MethodCall($variable, 'methodName', $args);
$callNext = new MethodCall($call, 'nextMethodName');
```


```php
$someObject->methodName('yes', argName: $maybe)->nextMethodName()
```

<br>

```php
<?php

declare(strict_types=1);

use PhpParser\Node\Arg;
use PhpParser\Node\Expr\MethodCall;
use PhpParser\Node\Expr\Variable;
Expand Down