Debian Codegraph @

vendor/mck89/peast/lib/Peast/Syntax/Node/AssignmentPattern.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 an assignment in a binding context.
14 * For example "a = b" in: var {a = b} = c
15 *
16 * @author Marco Marchiò <[email protected]>
17 */
18 class AssignmentPattern extends Node implements Pattern
19 {
20 /**
21 * Map of node properties
22 *
23 * @var array
24 */
25 protected $propertiesMap = array(
26 "left" => true,
27 "right" => true
28 );
29
30 /**
31 * The left node of the assignment
32 *
33 * @var Pattern
34 */
35 protected $left;
36
37 /**
38 * The right node of the assignment
39 *
40 * @var Expression
41 */
42 protected $right;
43
44 /**
45 * Returns the left node of the assignment
46 *
47 * @return Pattern
48 */
49 public function getLeft()
50 {
51 return $this->left;
52 }
53
54 /**
55 * Sets the left node of the assignment
56 *
57 * @param Pattern $left Left node
58 *
59 * @return $this
60 */
61 public function setLeft(Pattern $left)
62 {
63 $this->left = $left;
64 return $this;
65 }
66
67 /**
68 * Returns the right node of the assignment
69 *
70 * @return Expression
71 */
72 public function getRight()
73 {
74 return $this->right;
75 }
76
77 /**
78 * Sets the right node of the assignment
79 *
80 * @param Expression $right Right node
81 *
82 * @return $this
83 */
84 public function setRight(Expression $right)
85 {
86 $this->right = $right;
87 return $this;
88 }
89 }