Skip to content

Commit

Permalink
Merge pull request #3 from glebLaModa/php8
Browse files Browse the repository at this point in the history
PHP 8 Support
  • Loading branch information
denpli authored Aug 12, 2021
2 parents 257eb07 + d820b5a commit 7431458
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
7 changes: 2 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ php:
- 7.1
- 7.2
- 7.3
- 7.4snapshot
# php8 is not supported yet
#- nightly
- 7.4
- 8.0

env:
matrix:
Expand All @@ -17,8 +16,6 @@ env:

matrix:
fast_finish: true
allow_failures:
- php: 7.4snapshot

install:
- if [[ "$DEPENDENCIES" = 'high' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS; fi
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"minimum-stability": "stable",
"require": {
"php": "^7.1"
"php": "^7.1 | ^8.0"
},
"autoload": {
"psr-4": {
Expand All @@ -28,6 +28,6 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.15",
"phpunit/phpunit": "^7.5 | ^8.2"
"phpunit/phpunit": "^7.5.20 | ^8.2 | ^9.0"
}
}
12 changes: 7 additions & 5 deletions src/Parser/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,14 @@ public function parse(string $data): Barcode
$position += $length + strlen($this->config->getGroupSeparator());
}

$this->assertValueIsValid($value);
if ($length > 0) {
$this->assertValueIsValid($value);

if ($ai) {
$foundAIs[$ai] = $value;
} else {
$buffer[] = $value;
if ($ai) {
$foundAIs[$ai] = $value;
} else {
$buffer[] = $value;
}
}
}

Expand Down

0 comments on commit 7431458

Please sign in to comment.