@@ -46,7 +46,7 @@ class Conditional
46
46
*
47
47
* @return mixed The value of returnIfTrue or returnIfFalse determined by condition
48
48
*/
49
- public static function statementIf ($ condition = true , $ returnIfTrue = 0 , $ returnIfFalse = false )
49
+ public static function if ($ condition = true , $ returnIfTrue = 0 , $ returnIfFalse = false )
50
50
{
51
51
$ condition = ($ condition === null ) ? true : Functions::flattenSingleValue ($ condition );
52
52
@@ -86,7 +86,7 @@ public static function statementIf($condition = true, $returnIfTrue = 0, $return
86
86
*
87
87
* @return mixed The value of matched expression
88
88
*/
89
- public static function statementSwitch (...$ arguments )
89
+ public static function switch (...$ arguments )
90
90
{
91
91
$ result = ExcelError::VALUE ();
92
92
@@ -132,15 +132,15 @@ public static function statementSwitch(...$arguments)
132
132
* If an array of values is passed as the $testValue argument, then the returned result will also be
133
133
* an array with the same dimensions
134
134
*/
135
- public static function IFERROR ($ testValue = '' , $ errorpart = '' )
135
+ public static function ifError ($ testValue = '' , $ errorpart = '' )
136
136
{
137
137
if (is_array ($ testValue )) {
138
138
return self ::evaluateArrayArgumentsSubset ([self ::class, __FUNCTION__ ], 1 , $ testValue , $ errorpart );
139
139
}
140
140
141
141
$ errorpart = $ errorpart ?? '' ;
142
142
143
- return self ::statementIf (ErrorValue::isError ($ testValue ), $ errorpart , $ testValue );
143
+ return self ::if (ErrorValue::isError ($ testValue ), $ errorpart , $ testValue );
144
144
}
145
145
146
146
/**
@@ -158,15 +158,15 @@ public static function IFERROR($testValue = '', $errorpart = '')
158
158
* If an array of values is passed as the $testValue argument, then the returned result will also be
159
159
* an array with the same dimensions
160
160
*/
161
- public static function IFNA ($ testValue = '' , $ napart = '' )
161
+ public static function ifNa ($ testValue = '' , $ napart = '' )
162
162
{
163
163
if (is_array ($ testValue )) {
164
164
return self ::evaluateArrayArgumentsSubset ([self ::class, __FUNCTION__ ], 1 , $ testValue , $ napart );
165
165
}
166
166
167
167
$ napart = $ napart ?? '' ;
168
168
169
- return self ::statementIf (ErrorValue::isNa ($ testValue ), $ napart , $ testValue );
169
+ return self ::if (ErrorValue::isNa ($ testValue ), $ napart , $ testValue );
170
170
}
171
171
172
172
/**
@@ -185,7 +185,7 @@ public static function IFNA($testValue = '', $napart = '')
185
185
*
186
186
* @return mixed|string The value of returnIfTrue_n, if testValue_n was true. #N/A if none of testValues was true
187
187
*/
188
- public static function IFS (...$ arguments )
188
+ public static function ifSeries (...$ arguments )
189
189
{
190
190
$ argumentCount = count ($ arguments );
191
191
@@ -197,7 +197,7 @@ public static function IFS(...$arguments)
197
197
for ($ i = 0 ; $ i < $ argumentCount ; $ i += 2 ) {
198
198
$ testValue = ($ arguments [$ i ] === null ) ? '' : Functions::flattenSingleValue ($ arguments [$ i ]);
199
199
$ returnIfTrue = ($ arguments [$ i + 1 ] === null ) ? '' : $ arguments [$ i + 1 ];
200
- $ result = self ::statementIf ($ testValue , $ returnIfTrue , $ falseValueException );
200
+ $ result = self ::if ($ testValue , $ returnIfTrue , $ falseValueException );
201
201
202
202
if ($ result !== $ falseValueException ) {
203
203
return $ result ;
0 commit comments