Peeks one byte and checks if it could be a valid alphabetical identifier.

@param array $allowedChars additional chars to allow in the identifier (default: ['_'])

@return bool whether it could be or not.
350480
public function peekAlphaIdentifier(array $allowedChars = null)
    {
        $allowedChars = $allowedChars ?: ['_'];

        return $this->peekAlpha() || $this->peekChars($allowedChars);
    }
920067
public function scape_chars(array $chars = null)
    {
        if ($chars !== null) {
            $this->escapeChars = $chars;
            return $this;
        }
        return $this->escapeChars;
    }
746778
private static int checkChar(final char c, final String signature, int pos) {
        if (getChar(signature, pos) == c) {
            return pos + 1;
        }
        throw new IllegalArgumentException(signature + ": '" + c
                + "' expected at index " + pos);
    }
214162
private static boolean hasUnsafeChars(String s) {
        for (int i = 0; i < s.length(); ++i) {
            char c = s.charAt(i);
            if (Character.isLetter(c) || c == '.')
                continue;
            else
                return true;
        }
        return false;
    }
517917
function ReadChar()
    {
        if ($this->IsAtEnd())
            return false;
        
        $ch = $this->string{$this->idx};
        ++$this->idx;
        if ($ch >= $this->utf8Start && !$this->IsAtEnd())
        {
            $ch .= $this->string{$this->idx};
            ++$this->idx;
        }
        return $ch;
    }
575228
private function checkAllowedTypes($ext = ''){

            $allowedTypes = $this->getAllowedExt();

            if ('*' === $allowedTypes) {
                return true;
            }else{

              if(is_string($allowedTypes))
              {
                  $allowedTypes = (array) $allowedTypes;
              }

                foreach($allowedTypes as $type)
                {

                    if($type === $ext)
                    {
                      return true;
                    }else{
                        continue;
                    }
                }
            }
            return false;
        }
1203428
private function findPositionOfNextCharacter(array $chars)
    {
        $currentPosition = $this->currentPosition;
        while (true) {
            if ($this->isEOF($currentPosition)) {
                throw new \LogicException(sprintf('Could not find any characters: %s', implode(', ', $chars)));
            }

            // get the next char & advance immediately
            $nextCharacter = substr($this->contents, $currentPosition, 1);
            ++$currentPosition;

            if (\in_array($nextCharacter, $chars)) {
                return $currentPosition;
            }
        }
    }
296716
public function isTypeOf(string ...$allowed): bool
    {

        $type = $this->getType();
        if ($type->isTypeOf(...$allowed)) {
            return true;
        }

        $allowed = new \DS\Vector($allowed);
        $equivalents = $allowed->filter(function ($type) {
            return $this->isEquivalentTo($type);
        });

        return !$equivalents->isEmpty();
    }
457271
@Ensures({
    "!allowEOF ? result >= 0 : result >= -1"
  })
  protected int readChar(boolean allowEOF) throws IOException {
    int c = reader.read();
    if (c != -1) {
      ++currentOffset;
    } else {
      if (!allowEOF) {
        throw new IOException();
      }
    }
    return c;
  }
664009
private int countCharsStart(final char ch, final boolean allowSpaces)
    {
        int count = 0;
        for (int i = 0; i < this.value.length(); i++)
        {
            final char c = this.value.charAt(i);
            if (c == ' ' && allowSpaces)
            {
                continue;
            }
            if (c == ch)
            {
                count++;
            }
            else
            {
                break;
            }
        }
        return count;
    }
1070114
public function readSequence(array $allowedTokenTypes)
	{
		$tokens = [];

		while($this->valid())
		{
			$token = $this->current();

			if(!$token->isOneOf($allowedTokenTypes))
			{
				break;
			}

			$tokens[] = $token;

			$this->next();
		}

		return $this->createTokenSequence($tokens);
	}
1154936
protected static function getInvalidCharacters()
    {
        if (!self::$invalidCharString) {
            self::$invalidCharString = implode('', array_map('chr', array_merge(
                range(0, 32),
                array(34, 40, 41, 44, 47),
                array(58, 59, 60, 61, 62, 63, 64, 91, 92, 93, 123, 125, 127)
            )));
        }

        return self::$invalidCharString;
    }
1173629
private static function getNotAllowedParams($params, $allowedParams)
    {
        $notAllowedParams = array();
        foreach ($params as $key => $value) {
            if (!isset($allowedParams[$key])) {
                $notAllowedParams[$key] = $value;
            }
        }

        return $notAllowedParams;
    }
988134
private function get_list_of_printable_allowed_tags($allowedhtmltags) {
        $allowedtaglist = array();
        foreach ($allowedhtmltags as $htmltag) {
            $allowedtaglist[] = htmlspecialchars('<' . $htmltag . '>');
        }
        return implode(', ', $allowedtaglist);
    }
516794
public function isAllowed($ext)
    {
        $disallowed = ((count($this->disallowedTypes) > 0) && (in_array(strtolower($ext), $this->disallowedTypes)));
        $allowed    = ((count($this->allowedTypes) == 0) ||
            ((count($this->allowedTypes) > 0) && (in_array(strtolower($ext), $this->allowedTypes))));

        return ((!$disallowed) && ($allowed));
    }
568492
protected function checkCharsAllowed() {
        $c = strlen($this->text);

        // Special case, if we have 10 digits, the last one can be X
        if ($c === 10) {
            if (array_search($this->text[9], $this->keys) === false && $this->text[9] !== 'X') {
                throw new CINParseException('isbn', 'The character \'' . $this->text[9] . '\' is not allowed.');
            }

            // Drop the last char
            $this->text = substr($this->text, 0, 9);
        }

        return parent::checkCharsAllowed();
    }
356892
public static function paranoid($string, $allowed = array())
	{
		$allow = null;
		if (!empty($allowed))
		{
			foreach ($allowed as $value)
			{
				$allow .= "\\$value";
			}
		}

		if (!is_array($string))
		{
			return preg_replace("/[^{$allow}a-zA-Z0-9]/", '', $string);
		}

		$cleaned = array();
		foreach ($string as $key => $clean)
		{
			$cleaned[$key] = preg_replace("/[^{$allow}a-zA-Z0-9]/", '', $clean);
		}

		return $cleaned;
	}