Match value component symbol if required or present

@return bool|int
969860
private function symbol()
    {
        // If symbol requirement not set match colon if present
        if (null === $this->nextSymbol && $this->lexer->isNextToken(Lexer::T_COLON)) {
            $this->match(Lexer::T_COLON);

            // Set symbol requirement for any remaining value
            return $this->nextSymbol = Lexer::T_COLON;
        }

        // If symbol requirement not set match degree if present
        if (null === $this->nextSymbol && $this->lexer->isNextToken(Lexer::T_DEGREE)) {
            $this->match(Lexer::T_DEGREE);

            // Set requirement for any remaining value
            return $this->nextSymbol = Lexer::T_APOSTROPHE;
        }

        // Match symbol if requirement set and update requirement for next symbol
        switch ($this->nextSymbol) {
            case Lexer::T_COLON:
                $this->match(Lexer::T_COLON);

                return $this->nextSymbol;
            case Lexer::T_DEGREE:
                $this->match(Lexer::T_DEGREE);

                // Next symbol will be minutes
                return $this->nextSymbol = Lexer::T_APOSTROPHE;
            case Lexer::T_APOSTROPHE:
                $this->match(Lexer::T_APOSTROPHE);

                // Next symbol will be seconds
                return $this->nextSymbol = Lexer::T_QUOTE;
            case Lexer::T_QUOTE:
                $this->match(Lexer::T_QUOTE);

                return $this->nextSymbol;
        }

        // Set requirement for any remaining value
        return $this->nextSymbol = false;
    }
390432
public function getPreMatch()
    {
        if ($this->match) {
            return mb_substr($this->source, 0,
                ($this->head - mb_strlen($this->match)));
        } else {
            return null;
        }
    }
1046720
public function match() {
		$result = false;

		$this->matchedStatus = $this->result->getStatus();

		if ($this->result->hasHandler()) {
			$result = true;
			$this->matchedHandler = $this->result->getHandler();
		} else {
			$this->matchedHandler = $this->notFoundHandler;
		}

		return $result;
	}
543232
protected function getMatchedSiteAccess()
    {
        if (isset($this->matchedSiteAccess)) {
            return $this->matchedSiteAccess;
        }

        preg_match(
            "@{$this->regex}@",
            $this->element,
            $match
        );

        $this->matchedSiteAccess = isset($match[$this->itemNumber]) ? $match[$this->itemNumber] : false;

        return $this->matchedSiteAccess;
    }
208630
private function matchesIdAndEntityType()
    {
        $expr = $this->connection->getExpressionBuilder();

        return $expr->andX(
            $expr->eq('entity_id', ':entity_id'),
            $expr->eq('entity_type', ':entity_type')
        );
    }
565648
public function checkRequired()
    {
        if (is_array($this->value)) {
            return (bool) $this->value;
        }

        $value = (string) $this->value;

        return $this->value || $value === '0';
    }
1148702
public function isRequired() : Testable
    {
        $this->attributes['required'] = true;
        return $this->addTest('required', function ($value) {
            if (is_array($value)) {
                return $value;
            }
            return strlen(trim($value));
        });
    }
1270884
protected function validateFromAttributes()
    {
        $value = $this->attribs['value'];
        if (\strlen($value) == 0) {
            $this->debug->log('empty value');
            if ($this->isRequired()) {
                $this->flag();
            }
        } elseif (isset($this->attribs['pattern']) && !\preg_match('/^'.\str_replace('/', '\/', $this->attribs['pattern']).'$/', $value)) {
            $this->debug->log('pattern mismatch');
            $this->flag('invalid format');
        } elseif (isset($this->attribs['max']) && \preg_replace('/[^-\d\.]/', '', $value) > $this->attribs['max']) {
            $this->debug->log('too big');
            $this->flag('value is too large');
        } elseif (isset($this->attribs['min']) && \preg_replace('/[^-\d\.]/', '', $value) < $this->attribs['min']) {
            $this->debug->log('too small');
            $this->flag('value is too small');
        } elseif (isset($this->attribs['maxlength']) && \mb_strlen($value) > $this->attribs['maxlength']) {
            $this->debug->log('too long');
            if (empty($this->props['invalidReason'])) {
                $this->props['invalidReason'] = 'Value is too long';
            }
            $this->flag($this->props['invalidReason']);
        }
    }
499891
public function match($actual)
    {
        $target = null;
        $matcher = null;
        foreach ($this->_matchers as $target => $value) {
            if (!$target) {
                $matcher = $value;
                continue;
            }
            if ($actual instanceof $target) {
                $matcher = $value;
            }
        }
        if (!$matcher) {
            throw new Exception("Unexisting matcher attached to `'{$this->_name}'` for `{$target}`.");
        }
        $args = $this->_args;
        array_unshift($args, $actual);
        $boolean = call_user_func_array($matcher . '::match', $args);
        return $this->_not ? !$boolean : $boolean;
    }
345178
public function matches($value): bool
    {
        if (!interface_exists($this->type) && !class_exists($this->type)) {
            throw new UndefinedTypeException($this->type);
        }

        return $value instanceof $this->type;
    }
433980
public function matchesRequest()
    {
        return $this->event->get('token') === $this->config->get('token') && $this->event->get('type') === 'MESSAGE';
    }
126182
public function normalize($value)
    {
        if (is_null($value) || $value === '') {
            return;
        }
        if (is_bool($value)) {
            return $value;
        }

        if ($value === $this->valueTrue) {
            return true;
        }

        if ($value === $this->valueFalse) {
            return false;
        }

        if (is_numeric($value)) {
            return (bool) $value;
        }

        throw new ValidationException([$this->name => 'Must be a boolean value']);
    }
685392
function it_matches_identifiers()
    {
        $this->match('123')->shouldReturn('123');
        $this->match('3.14')->shouldReturn('3.14');
        $this->match('-123')->shouldReturn('-123');
    }
1308826
public function containsValuesEqualToVariableDefaultOnly()
    {
        $data = $this->getDataPlaceHolder();
        
        foreach ($data as $variable) {
            $value = $variable->getValue();
            $default = $variable->getDefaultValue();
            
            if (Utils::isNull($value) === true) {
                if (Utils::isNull($default) === false) {
                    return false;
                }
            } elseif ($value->equals($default) === false) {
                return false;
            }
        }
        
        return true;
    }
1058883
private function check($value) {

		if(true === is_string($value) || is_numeric($value)) {

			if(true === $this -> strict) {
				return true === is_int($value);
			}

			return !in_array(preg_match('/^-?[0-9]+$/', $value), [false, 0]);
		}

		return false;
	}
1212888
static function checkThisRequiredWhenThat($value, $params, $helper) {
    if (self::checkPath($params['that'], ['required' => TRUE, 'in' => (array) $params['is']], $helper)) {
      $params = array_merge(['message' => 'required when ' . $params['that'] . ' in (' . implode(', ', (array) $params['is']) . ')'], $params);
      
      return self::checkNotBlank($value, $params, $helper);
    }

    return $value;
  }
485466
public function _validation_match_value($val, $compare, $strict = false)
	{
		// first try direct match
		if ($this->_empty($val) || $val === $compare || ( ! $strict && $val == $compare))
		{
			return true;
		}

		// allow multiple input for comparison
		if (is_array($compare))
		{
			foreach($compare as $c)
			{
				if ($val === $c || ( ! $strict && $val == $c))
				{
					return true;
				}
			}
		}

		// all is lost, return failure
		return false;
	}