': return $sourceValue > $dataValue; break; case '<': return $sourceValue < $dataValue; break; case '>=': return $sourceValue >= $dataValue; break; case '<=': return $sourceValue <= $dataValue; break; case 'startsWith': return Str::startsWith($sourceValue, $dataValue); break; case 'endsWith': return Str::endsWith($sourceValue, $dataValue); break; case 'contains': return Str::contains($sourceValue, $dataValue); break; case 'doNotContains': return !Str::contains($sourceValue, $dataValue); break; case 'length_equal': if(is_array($sourceValue)) { return count($sourceValue) == $dataValue; } $sourceValue = strval($sourceValue); return strlen($sourceValue) == $dataValue; break; case 'length_less_than': if(is_array($sourceValue)) { return count($sourceValue) < $dataValue; } $sourceValue = strval($sourceValue); return strlen($sourceValue) < $dataValue; break; case 'length_greater_than': if(is_array($sourceValue)) { return count($sourceValue) > $dataValue; } $sourceValue = strval($sourceValue); return strlen($sourceValue) > $dataValue; break; case 'match_all': $sourceValue = (array) $sourceValue; $dataValue = (array) $dataValue; sort($sourceValue); sort($dataValue); return $sourceValue == $dataValue; break; case 'match_none_of': $sourceValue = (array) $sourceValue; $dataValue = (array) $dataValue; return !(array_intersect($sourceValue, $dataValue)); break; } } return false; } }