src/Parser/Parser.php
/**
     * Try parse a test case.
     *
     * @param LocationInterface      $location    The location.
     * @param string                 $command     The command.
     * @param null|string            $argument    The argument or null if no argument.
     * @param ParseErrorInterface[]  $parseErrors The parse errors.
     * @param TestCaseInterface|null $testCase    The parsed test case or null if parsing failed.
     *
     * @return bool True if this was a test case, false otherwise.
     */
Try parse a test case.
@param LocationInterface      $location    The location.
@param string                 $command     The command.
@param null|string            $argument    The argument or null if no argument.
@param ParseErrorInterface[]  $parseErrors The parse errors.
@param TestCaseInterface|null $testCase    The parsed test case or null if parsing failed.

@return bool True if this was a test case, false otherwise.
Try parse a test case . @param LocationInterface $location The location . @param string $command The command . @param null|string $argument The argument or null if no argument . @param ParseErrorInterface [] $parseErrors The parse errors . @param TestCaseInterface|null $testCase The parsed test case or null if parsing failed . @return bool True if this was a test case false otherwise .
private static function tryParseTestCase(LocationInterface $location, string $command, ?string $argument, array &$parseErrors, ?TestCaseInterface &$testCase): bool
    {
        $testCase = null;
        if ($command !== 'get') {
            return false;
        }
        if ($argument === null) {
            $parseErrors[] = new ParseError($location, 'Missing argument: Missing Url argument for "' . $command . '".');
            return true;
        }
        try {
            $url = Url::parse($argument);
        } catch (UrlInvalidArgumentException $exception) {
            $parseErrors[] = new ParseError($location, 'Invalid argument: Invalid Url argument "' . $argument . '" for "' . $command . '": ' . $exception->getMessage());
            return true;
        }
        $testCase = new TestCase($location, $url);
        return true;
    }
private static function tryParseTestCase ( LocationInterface $ location , string $ command , ? string $ argument , array & $ parseErrors , ? TestCaseInterface & $ testCase ) : bool { $ testCase = null ; if ( $ command !== 'get' ) { return false ; } if ( $ argument === null ) { $ parseErrors [ ] = new ParseError ( $ location , 'Missing argument: Missing Url argument for "' . $ command . '".' ) ; return true ; } try { $ url = Url :: parse ( $ argument ) ; } catch ( UrlInvalidArgumentException $ exception ) { $ parseErrors [ ] = new ParseError ( $ location , 'Invalid argument: Invalid Url argument "' . $ argument . '" for "' . $ command . '": ' . $ exception -> getMessage ( ) ) ; return true ; } $ testCase = new TestCase ( $ location , $ url ) ; return true ; }
Try parse a test case.
Try parse a test case .