• The keyword is used in a file which is included only if PHP 5.5+ is used, so it shouldn’t be a problem.

    The SVN commit fails with the following error:

    svn: E165001: Commit fallito (seguono dettagli):
    svn: E165001: Commit blocked by pre-commit hook (exit code 1) with output:
    PHP Parse error:  syntax error, unexpected '$claim' (T_VARIABLE) in - on line 229
    
    ***********************************
    PHP error in: web-push/trunk/vendor/lcobucci/jwt/src/Token.php:
    Errors parsing web-push/trunk/vendor/lcobucci/jwt/src/Token.php
    ***********************************

    Here’s the function that contains the line in question:

    private function getValidatableClaims()
        {
            foreach ($this->claims as $claim) {
                if ($claim instanceof Validatable) {
                    yield $claim;
                }
            }
        }

Viewing 1 replies (of 1 total)
  • I have run into the same problem.

    Does anyone have a solution?

    $iterable = \GuzzleHttp\Promise\iter_for($requests);
            $requests = function () use ($iterable, $client, $opts) {
                foreach ($iterable as $key => $rfn) {
                    if ($rfn instanceof RequestInterface) {
                        yield $key => $client->sendAsync($rfn, $opts);
                    } elseif (is_callable($rfn)) {
                        yield $key => $rfn($opts);
                    } else {
                        throw new \InvalidArgumentException('Each value yielded by '
                            . 'the iterator must be a Psr7\Http\Message\RequestInterface '
                            . 'or a callable that returns a promise that fulfills '
                            . 'with a Psr7\Message\Http\ResponseInterface object.');
                    }
                }
            };
Viewing 1 replies (of 1 total)
  • The topic ‘SVN commit fails because of 'yield' keyword’ is closed to new replies.