Debian Codegraph @

vendor/mck89/peast/lib/Peast/Syntax/Node/RestElement.php

raw
1 <?php
2 /**
3 * This file is part of the Peast package
4 *
5 * (c) Marco Marchiò <[email protected]>
6 *
7 * For the full copyright and license information refer to the LICENSE file
8 * distributed with this source code
9 */
10 namespace Peast\Syntax\Node;
11
12 /**
13 * A node that represents the rest element in array binding patterns or function
14 * parameters.
15 * For example "...rest" in: [a, ...rest] = b
16 *
17 * @author Marco Marchiò <[email protected]>
18 */
19 class RestElement extends Node implements Pattern
20 {
21 /**
22 * Map of node properties
23 *
24 * @var array
25 */
26 protected $propertiesMap = array(
27 "argument" => true
28 );
29
30 /**
31 * The node's argument
32 *
33 * @var Pattern
34 */
35 protected $argument;
36
37 /**
38 * Returns the node's argument
39 *
40 * @return Pattern
41 */
42 public function getArgument()
43 {
44 return $this->argument;
45 }
46
47 /**
48 * Sets the node's argument
49 *
50 * @param Pattern $argument Node's argument
51 *
52 * @return $this
53 */
54 public function setArgument(Pattern $argument)
55 {
56 $this->argument = $argument;
57 return $this;
58 }
59 }