@param     $needle
@param int $flags

@return bool
160698
public function contains($needle, $flags = 0)
    {
        return ($flags & self::CASE_SENSITIVE) ? (strpos($this->getInternalValue(),
                $needle) !== false) : (stripos($this->getInternalValue(), $needle) !== false);
    }
732173
public static function searchKey($array, $needle)
    {
        $return = false;
        if (!\is_array($array)) {
            $array = array();
        }
        $arrayKeys = array();
        foreach ($array as $k => $v) {
            if ($k == $needle) {
                $return = $v;
                break;
            }
            if (\is_array($v)) {
                // don't search deeper levels until finished with this level
                $arrayKeys[] = $k;
            }
        }
        if ($return === false) {
            foreach ($arrayKeys as $k) {
                $result = self::searchKey($array[$k], $needle);
                if ($result !== false) {
                    $return = $result;
                    break;
                }
            }
        }
        return $return;
    }
1154610
public function contains($needle): bool
    {
        if (null === $this->value) {
            return is_null($needle);
        }

        if (is_string($this->value)) {
            return false !== strpos($this->value, (string) $needle);
        }

        if (is_array($this->value) || $this->value instanceof \Traversable) {
            foreach ($this->value as $element) {
                if ($element === $needle) {
                    return true;
                }
            }
        }

        return false;
    }
11941
public function nameContains($needle, $caseSensitive = null)
    {
        if ('' === $needle) {
            return true;
        }
        if (null === $caseSensitive) {
            $caseSensitive = false;
        }

        if ($caseSensitive) {
            return false !== mb_strpos($this->name(), $needle);
        }

        return false !== mb_stripos($this->name(), $needle);
    }
154663
protected function isStartWith($haystack, $needles) {
        if (!is_array($needles)) {
            $needles = array($needles);
        }
        foreach ($needles as $needle) {
            if (substr($haystack, 0, strlen($needle)) === $needle) {
                return true;
            }
        }
        return false;
    }
1305279
public static function getStartsWith($haystack, $needles)
    {
        foreach ((array) $needles as $needle) {
            if ($needle != '' && strpos($haystack, $needle) === 0) {
                return $needle;
            }
        }

        return false;
    }
617236
public function containsValues(array $needles): bool
    {
        return \count(\array_intersect($needles, $this->getArray()), \COUNT_NORMAL)
               ===
               \count($needles, \COUNT_NORMAL);
    }
1239455
public function in_multiarray($needle, $haystack)
    {
        foreach ($haystack as $value) {
            if (is_array($value)) {
                if ($this->in_multiarray($needle, $value)) {
                    return true;
                }
            } else {
                if ($value == $needle) {
                    return true;
                }
            }
        }
        return false;
    }
885152
public function setFlag(string $flag, $numbers): bool
    {
        return \imap_setflag_full($this->resource->getStream(), $this->prepareMessageIds($numbers), $flag, \ST_UID);
    }
801148
protected function wasDispatched($needle, array $haystack)
    {
        foreach ($haystack as $dispatched) {
            if ((is_string($dispatched) && ($dispatched === $needle || is_subclass_of($dispatched, $needle))) ||
                $dispatched instanceof $needle) {
                return true;
            }
        }

        return false;
    }
1236694
protected function mayWrite($flags)
    {
        if ($this->quiet) {
            return false;
        }

        if ($flags & IO::VERBOSE) {
            return $this->verbosity >= IO::VERBOSE;
        }

        if ($flags & IO::VERY_VERBOSE) {
            return $this->verbosity >= IO::VERY_VERBOSE;
        }

        if ($flags & IO::DEBUG) {
            return $this->verbosity >= IO::DEBUG;
        }

        return true;
    }
1215036
protected function in_array($needle, $haystack)
    {
        return count(array_filter($haystack, function ($hay) use ($needle) {
            return $hay === $needle;
        })) > 0;
    }
741173
public static function checkFileContainsStr($filename, $needle)
    {
        if (file_exists($filename)) {
            $content = file_get_contents($filename);

            if (strstr($content, $needle)) {
                return true;
            }
        }

        return false;
    }
918765
public function hasFlag($flags)
    {
        $mask = $this->getMaskFromFlags($flags);

        return ($this->bitmask & $mask) === $mask;
    }
76339
public static function contains($haystack, $needles)
    {
        $needles = (array) $needles;

        foreach ($needles as $needle) {
            if ($needle && strpos($haystack, $needle) !== false) {
                return true;
            }
        }

        return false;
    }
30804
public static function isNeedlesExists($haystack, $needles) {
        foreach($needles as $needle) {
            if(stripos($haystack, $needle)!==false){
                return true;
            }
        }
        return false;
    }
31724
public static function hasBeginning(string $needle, string $haystack): bool
    {
        return $needle === '' || strpos($haystack, $needle) === 0;
    }