FluidTYPO3\Vhs\ViewHelpers\Condition\Iterator\ContainsViewHelper::assertHaystackHasNeedle PHP Method

assertHaystackHasNeedle() protected static method

protected static assertHaystackHasNeedle ( mixed $haystack, mixed $needle, array $arguments ) : boolean | integer
$haystack mixed
$needle mixed
$arguments array
return boolean | integer
    protected static function assertHaystackHasNeedle($haystack, $needle, $arguments)
    {
        if (true === is_array($haystack)) {
            return self::assertHaystackIsArrayAndHasNeedle($haystack, $needle, $arguments);
        } elseif ($haystack instanceof LazyObjectStorage) {
            return self::assertHaystackIsObjectStorageAndHasNeedle($haystack, $needle);
        } elseif ($haystack instanceof ObjectStorage) {
            return self::assertHaystackIsObjectStorageAndHasNeedle($haystack, $needle);
        } elseif ($haystack instanceof QueryResult) {
            return self::assertHaystackIsQueryResultAndHasNeedle($haystack, $needle);
        } elseif (true === is_string($haystack)) {
            return strpos($haystack, $needle);
        }
        return false;
    }