@@ -42,81 +42,91 @@ interface NumeralType extends PropertyType
42
42
* Add this expression to the given expression.
43
43
*
44
44
* @param NumeralType $right
45
+ * @param bool $insertParentheses
45
46
* @return Addition
46
47
*/
47
- public function plus (NumeralType $ right ): Addition ;
48
+ public function plus (NumeralType $ right, bool $ insertParentheses = true ): Addition ;
48
49
49
50
/**
50
51
* Divide this expression by the given expression.
51
52
*
52
53
* @param NumeralType $right
54
+ * @param bool $insertParentheses
53
55
* @return Division
54
56
*/
55
- public function divide (NumeralType $ right ): Division ;
57
+ public function divide (NumeralType $ right, bool $ insertParentheses = true ): Division ;
56
58
57
59
/**
58
60
* Perform an exponentiation with the given expression.
59
61
*
60
62
* @param NumeralType $right
63
+ * @param bool $insertParentheses
61
64
* @return Exponentiation
62
65
*/
63
- public function exponentiate (NumeralType $ right ): Exponentiation ;
66
+ public function exponentiate (NumeralType $ right, bool $ insertParentheses = true ): Exponentiation ;
64
67
65
68
/**
66
69
* Perform a greater than comparison against the given expression.
67
70
*
68
71
* @param NumeralType $right
72
+ * @param bool $insertParentheses
69
73
* @return GreaterThan
70
74
*/
71
- public function gt (NumeralType $ right ): GreaterThan ;
75
+ public function gt (NumeralType $ right, bool $ insertParentheses = true ): GreaterThan ;
72
76
73
77
/**
74
78
* Perform a greater than or equal comparison against the given expression.
75
79
*
76
80
* @param NumeralType $right
81
+ * @param bool $insertParentheses
77
82
* @return GreaterThanOrEqual
78
83
*/
79
- public function gte (NumeralType $ right ): GreaterThanOrEqual ;
84
+ public function gte (NumeralType $ right, bool $ insertParentheses = true ): GreaterThanOrEqual ;
80
85
81
86
/**
82
87
* Perform a less than comparison against the given expression.
83
88
*
84
89
* @param NumeralType $right
90
+ * @param bool $insertParentheses
85
91
* @return LessThan
86
92
*/
87
- public function lt (NumeralType $ right ): LessThan ;
93
+ public function lt (NumeralType $ right, bool $ insertParentheses = true ): LessThan ;
88
94
89
95
/**
90
96
* Perform a less than or equal comparison against the given expression.
91
97
*
92
98
* @param NumeralType $right
99
+ * @param bool $insertParentheses
93
100
* @return LessThanOrEqual
94
101
*/
95
- public function lte (NumeralType $ right ): LessThanOrEqual ;
102
+ public function lte (NumeralType $ right, bool $ insertParentheses = true ): LessThanOrEqual ;
96
103
97
104
/**
98
105
* Perform the modulo operation with the given expression.
99
106
*
100
107
* @param NumeralType $right
108
+ * @param bool $insertParentheses
101
109
* @return Modulo
102
110
*/
103
- public function mod (NumeralType $ right ): Modulo ;
111
+ public function mod (NumeralType $ right, bool $ insertParentheses = true ): Modulo ;
104
112
105
113
/**
106
114
* Perform a multiplication with the given expression.
107
115
*
108
116
* @param NumeralType $right
117
+ * @param bool $insertParentheses
109
118
* @return Multiplication
110
119
*/
111
- public function times (NumeralType $ right ): Multiplication ;
120
+ public function times (NumeralType $ right, bool $ insertParentheses = true ): Multiplication ;
112
121
113
122
/**
114
123
* Subtract the given expression from this expression.
115
124
*
116
125
* @param NumeralType $right
126
+ * @param bool $insertParentheses
117
127
* @return Subtraction
118
128
*/
119
- public function minus (NumeralType $ right ): Subtraction ;
129
+ public function minus (NumeralType $ right, bool $ insertParentheses = true ): Subtraction ;
120
130
121
131
/**
122
132
* Negate this expression (negate the numeral using "0").
0 commit comments