Skip to content

Commit 2f7f8e0

Browse files
committed
- PHP 8 support
- PHP 7.1 or older, is no longer supported
1 parent c5a6718 commit 2f7f8e0

5 files changed

Lines changed: 8 additions & 9 deletions

File tree

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ env:
44
sudo: false
55
language: php
66
php:
7+
- 8.0
8+
- 7.4
9+
- 7.3
710
- 7.2
811
- 7.1
912
- 7.0
10-
- 5.6
11-
- 5.5
12-
- hhvm
1313
install:
1414
- composer install
1515
before_script:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Parser and group determiner optimized for ``robots.txt``, ``X-Robots-tag`` and `
1111
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/1386c14c-546c-4c42-ac55-91ea3a3a1ae1/big.png)](https://insight.sensiolabs.com/projects/1386c14c-546c-4c42-ac55-91ea3a3a1ae1)
1212

1313
#### Requirements:
14-
- PHP 5.5+ or 7.0+
14+
- PHP 5.5+, 7.0+ or 8.0+
1515

1616
## Installation
1717
The library is available for install via [Composer](https://getcomposer.org). Just add this to your `composer.json` file:

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@
2929
}
3030
],
3131
"require": {
32-
"php": "^5.5 || ^7.0"
32+
"php": "^7.2 || ^8.0"
3333
},
3434
"require-dev": {
35-
"phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5"
35+
"phpunit/phpunit": "^8.0 || ^9.0"
3636
},
3737
"support": {
3838
"email": "support@vipnytt.no",

src/UserAgentParser.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ public function getVersions()
237237
);
238238
asort($result);
239239
usort($result, function ($a, $b) {
240-
// PHP 7: Switch to the <=> "Spaceship" operator
241-
return strlen($b) - strlen($a);
240+
return strlen($b) <=> strlen($a);
242241
});
243242
return $this->filterDuplicates($result);
244243
}

tests/TruncateInvalidTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class TruncateInvalidTest extends Framework\TestCase
2626
*/
2727
public function testTruncateInvalid($product, $version)
2828
{
29-
$this->expectException(Framework\Error\Notice::class);
29+
$this->expectNotice();
3030
new UserAgentParser($product, $version);
3131
}
3232

0 commit comments

Comments
 (0)