Skip to content

Commit 874c2e4

Browse files
committed
Add tests for condition
1 parent 0338ef4 commit 874c2e4

File tree

3 files changed

+418
-9
lines changed

3 files changed

+418
-9
lines changed

src/Condition.php

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static function notEqual($value, $comparable)
5151
*
5252
* @return bool
5353
*/
54-
public static function notExactEqual($value, $comparable)
54+
public static function strictNotEqual($value, $comparable)
5555
{
5656
return $value !== $comparable;
5757
}
@@ -168,6 +168,10 @@ public static function isNotNull($value)
168168
*/
169169
public static function startWith($value, $comparable)
170170
{
171+
if (is_array($comparable) || is_array($value) || is_object($comparable) || is_object($value)) {
172+
return false;
173+
}
174+
171175
if (preg_match("/^$comparable/", $value)) {
172176
return true;
173177
}
@@ -185,6 +189,10 @@ public static function startWith($value, $comparable)
185189
*/
186190
public static function endWith($value, $comparable)
187191
{
192+
if (is_array($comparable) || is_array($value) || is_object($comparable) || is_object($value)) {
193+
return false;
194+
}
195+
188196
if (preg_match("/$comparable$/", $value)) {
189197
return true;
190198
}
@@ -202,6 +210,10 @@ public static function endWith($value, $comparable)
202210
*/
203211
public static function match($value, $comparable)
204212
{
213+
if (is_array($comparable) || is_array($value) || is_object($comparable) || is_object($value)) {
214+
return false;
215+
}
216+
205217
$comparable = trim($comparable);
206218

207219
if (preg_match("/^$comparable$/", $value)) {

0 commit comments

Comments
 (0)