Skip to content

Commit d820b5a

Browse files
committed
PHP 8 Support
1 parent 257eb07 commit d820b5a

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

.travis.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ php:
44
- 7.1
55
- 7.2
66
- 7.3
7-
- 7.4snapshot
8-
# php8 is not supported yet
9-
#- nightly
7+
- 7.4
8+
- 8.0
109

1110
env:
1211
matrix:
@@ -17,8 +16,6 @@ env:
1716

1817
matrix:
1918
fast_finish: true
20-
allow_failures:
21-
- php: 7.4snapshot
2219

2320
install:
2421
- if [[ "$DEPENDENCIES" = 'high' ]]; then travis_retry composer update $DEFAULT_COMPOSER_FLAGS; fi

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"minimum-stability": "stable",
1313
"require": {
14-
"php": "^7.1"
14+
"php": "^7.1 | ^8.0"
1515
},
1616
"autoload": {
1717
"psr-4": {
@@ -28,6 +28,6 @@
2828
},
2929
"require-dev": {
3030
"friendsofphp/php-cs-fixer": "^2.15",
31-
"phpunit/phpunit": "^7.5 | ^8.2"
31+
"phpunit/phpunit": "^7.5.20 | ^8.2 | ^9.0"
3232
}
3333
}

src/Parser/Parser.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,14 @@ public function parse(string $data): Barcode
203203
$position += $length + strlen($this->config->getGroupSeparator());
204204
}
205205

206-
$this->assertValueIsValid($value);
206+
if ($length > 0) {
207+
$this->assertValueIsValid($value);
207208

208-
if ($ai) {
209-
$foundAIs[$ai] = $value;
210-
} else {
211-
$buffer[] = $value;
209+
if ($ai) {
210+
$foundAIs[$ai] = $value;
211+
} else {
212+
$buffer[] = $value;
213+
}
212214
}
213215
}
214216

0 commit comments

Comments
 (0)