Debian Codegraph @

vendor/mck89/peast/lib/Peast/Syntax/Node/UpdateExpression.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 update expression.
14 * For example: a++
15 *
16 * @author Marco Marchiò <[email protected]>
17 */
18 class UpdateExpression extends Node implements Expression
19 {
20 /**
21 * Map of node properties
22 *
23 * @var array
24 */
25 protected $propertiesMap = array(
26 "argument" => true,
27 "operator" => false,
28 "prefix" => false
29 );
30
31 /**
32 * Expression's operator
33 *
34 * @var string
35 */
36 protected $operator;
37
38 /**
39 * Prefix flag that is true when the operator precedes the argument
40 *
41 * @var bool
42 */
43 protected $prefix = false;
44
45 /**
46 * Expression's argument
47 *
48 * @var Expression
49 */
50 protected $argument;
51
52 /**
53 * Returns the expression's operator
54 *
55 * @return string
56 */
57 public function getOperator()
58 {
59 return $this->operator;
60 }
61
62 /**
63 * Sets the expression's operator
64 *
65 * @param string $operator Operator
66 *
67 * @return $this
68 */
69 public function setOperator($operator)
70 {
71 $this->operator = $operator;
72 return $this;
73 }
74
75 /**
76 * Returns the prefix flag that is true when the operator precedes the
77 * argument
78 *
79 * @return bool
80 */
81 public function getPrefix()
82 {
83 return $this->prefix;
84 }
85
86 /**
87 * Sets the prefix flag that is true when the operator precedes the
88 * argument
89 *
90 * @param bool $prefix Prefix flag
91 *
92 * @return $this
93 */
94 public function setPrefix($prefix)
95 {
96 $this->prefix = $prefix;
97 return $this;
98 }
99
100 /**
101 * Returns the expression's argument
102 *
103 * @return Expression
104 */
105 public function getArgument()
106 {
107 return $this->argument;
108 }
109
110 /**
111 * Sets the expression's argument
112 *
113 * @param Expression $argument Argument
114 *
115 * @return $this
116 */
117 public function setArgument(Expression $argument)
118 {
119 $this->argument = $argument;
120 return $this;
121 }
122 }