Skip to content

Commit

Permalink
Merge pull request #276 from alcaeus/php-7.4-compat
Browse files Browse the repository at this point in the history
Fix lookahead on PHP 7.4
  • Loading branch information
alcaeus committed Aug 8, 2019
2 parents 3f35255 + 635b79b commit fa4c4e8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ php:
- 7.1
- 7.2
- 7.3
- 7.4snapshot
- nightly

cache:
Expand All @@ -24,10 +23,13 @@ script:

jobs:
allow_failures:
- php: 7.4snapshot
- php: nightly

include:
- stage: Test
php: 7.4snapshot
install: travis_retry composer require --dev phpunit/phpunit:^7.5@dev

- stage: Lint
before_script:
- travis_retry composer require --dev --prefer-dist --prefer-stable phpstan/phpstan:^0.7
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"require-dev": {
"doctrine/cache": "1.*",
"phpunit/phpunit": "^7.0"
"phpunit/phpunit": "^7.5@dev"
},
"config": {
"sort-packages": true
Expand Down
8 changes: 5 additions & 3 deletions lib/Doctrine/Common/Annotations/DocParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -997,9 +997,11 @@ private function Identifier()

$className = $this->lexer->token['value'];

while ($this->lexer->lookahead['position'] === ($this->lexer->token['position'] + strlen($this->lexer->token['value']))
&& $this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR)) {

while (
null !== $this->lexer->lookahead &&
$this->lexer->lookahead['position'] === ($this->lexer->token['position'] + strlen($this->lexer->token['value'])) &&
$this->lexer->isNextToken(DocLexer::T_NAMESPACE_SEPARATOR)
) {
$this->match(DocLexer::T_NAMESPACE_SEPARATOR);
$this->matchAny(self::$classIdentifiers);

Expand Down

0 comments on commit fa4c4e8

Please sign in to comment.