Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / nikic / php-parser / lib / PhpParser / Node / Param.php
1 <?php declare(strict_types=1);
2
3 namespace PhpParser\Node;
4
5 use PhpParser\NodeAbstract;
6
7 class Param extends NodeAbstract
8 {
9     /** @var null|Identifier|Name|NullableType Typehint */
10     public $type;
11     /** @var bool Whether parameter is passed by reference */
12     public $byRef;
13     /** @var bool Whether this is a variadic argument */
14     public $variadic;
15     /** @var Expr\Variable|Expr\Error Parameter variable */
16     public $var;
17     /** @var null|Expr Default value */
18     public $default;
19
20     /**
21      * Constructs a parameter node.
22      *
23      * @param Expr\Variable|Expr\Error      $var        Parameter variable
24      * @param null|Expr                     $default    Default value
25      * @param null|string|Name|NullableType $type       Typehint
26      * @param bool                          $byRef      Whether is passed by reference
27      * @param bool                          $variadic   Whether this is a variadic argument
28      * @param array                         $attributes Additional attributes
29      */
30     public function __construct(
31         $var, Expr $default = null, $type = null,
32         bool $byRef = false, bool $variadic = false, array $attributes = []
33     ) {
34         parent::__construct($attributes);
35         $this->type = \is_string($type) ? new Identifier($type) : $type;
36         $this->byRef = $byRef;
37         $this->variadic = $variadic;
38         $this->var = $var;
39         $this->default = $default;
40     }
41
42     public function getSubNodeNames() : array {
43         return ['type', 'byRef', 'variadic', 'var', 'default'];
44     }
45     
46     public function getType() : string {
47         return 'Param';
48     }
49 }