Skip to content

Commit fa15938

Browse files
committed
correctly forwared insertparentheses for numeral types
1 parent 03246a1 commit fa15938

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

src/Types/PropertyTypes/NumeralType.php

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,81 +42,91 @@ interface NumeralType extends PropertyType
4242
* Add this expression to the given expression.
4343
*
4444
* @param NumeralType $right
45+
* @param bool $insertParentheses
4546
* @return Addition
4647
*/
47-
public function plus(NumeralType $right): Addition;
48+
public function plus(NumeralType $right, bool $insertParentheses = true): Addition;
4849

4950
/**
5051
* Divide this expression by the given expression.
5152
*
5253
* @param NumeralType $right
54+
* @param bool $insertParentheses
5355
* @return Division
5456
*/
55-
public function divide(NumeralType $right): Division;
57+
public function divide(NumeralType $right, bool $insertParentheses = true): Division;
5658

5759
/**
5860
* Perform an exponentiation with the given expression.
5961
*
6062
* @param NumeralType $right
63+
* @param bool $insertParentheses
6164
* @return Exponentiation
6265
*/
63-
public function exponentiate(NumeralType $right): Exponentiation;
66+
public function exponentiate(NumeralType $right, bool $insertParentheses = true): Exponentiation;
6467

6568
/**
6669
* Perform a greater than comparison against the given expression.
6770
*
6871
* @param NumeralType $right
72+
* @param bool $insertParentheses
6973
* @return GreaterThan
7074
*/
71-
public function gt(NumeralType $right): GreaterThan;
75+
public function gt(NumeralType $right, bool $insertParentheses = true): GreaterThan;
7276

7377
/**
7478
* Perform a greater than or equal comparison against the given expression.
7579
*
7680
* @param NumeralType $right
81+
* @param bool $insertParentheses
7782
* @return GreaterThanOrEqual
7883
*/
79-
public function gte(NumeralType $right): GreaterThanOrEqual;
84+
public function gte(NumeralType $right, bool $insertParentheses = true): GreaterThanOrEqual;
8085

8186
/**
8287
* Perform a less than comparison against the given expression.
8388
*
8489
* @param NumeralType $right
90+
* @param bool $insertParentheses
8591
* @return LessThan
8692
*/
87-
public function lt(NumeralType $right): LessThan;
93+
public function lt(NumeralType $right, bool $insertParentheses = true): LessThan;
8894

8995
/**
9096
* Perform a less than or equal comparison against the given expression.
9197
*
9298
* @param NumeralType $right
99+
* @param bool $insertParentheses
93100
* @return LessThanOrEqual
94101
*/
95-
public function lte(NumeralType $right): LessThanOrEqual;
102+
public function lte(NumeralType $right, bool $insertParentheses = true): LessThanOrEqual;
96103

97104
/**
98105
* Perform the modulo operation with the given expression.
99106
*
100107
* @param NumeralType $right
108+
* @param bool $insertParentheses
101109
* @return Modulo
102110
*/
103-
public function mod(NumeralType $right): Modulo;
111+
public function mod(NumeralType $right, bool $insertParentheses = true): Modulo;
104112

105113
/**
106114
* Perform a multiplication with the given expression.
107115
*
108116
* @param NumeralType $right
117+
* @param bool $insertParentheses
109118
* @return Multiplication
110119
*/
111-
public function times(NumeralType $right): Multiplication;
120+
public function times(NumeralType $right, bool $insertParentheses = true): Multiplication;
112121

113122
/**
114123
* Subtract the given expression from this expression.
115124
*
116125
* @param NumeralType $right
126+
* @param bool $insertParentheses
117127
* @return Subtraction
118128
*/
119-
public function minus(NumeralType $right): Subtraction;
129+
public function minus(NumeralType $right, bool $insertParentheses = true): Subtraction;
120130

121131
/**
122132
* Negate this expression (negate the numeral using "0").

0 commit comments

Comments
 (0)