Skip to content

Commit 5c2cdff

Browse files
committed
compatibility with PHP 8.0
1 parent 2a677c4 commit 5c2cdff

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ php:
44
- 7.2
55
- 7.3
66
- 7.4
7+
- 8.0snapshot
78

89
before_install:
910
# turn off XDebug
@@ -60,6 +61,7 @@ jobs:
6061
allow_failures:
6162
- stage: Static Analysis (informative)
6263
- stage: Code Coverage
64+
- php: nightly
6365

6466

6567
sudo: false

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
],
1717
"require": {
18-
"php": ">=7.1",
18+
"php": ">=7.1 <8.1",
1919
"ext-tokenizer": "*",
2020
"nette/finder": "^2.5 || ^3.0",
2121
"nette/utils": "^3.0"

readme.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ RobotLoader is a tool that gives you comfort of automated class loading for your
2222

2323
RobotLoader is incredibly comfortable and addictive!
2424

25-
It requires PHP version 7.1 and supports PHP up to 7.4.
26-
2725
If you like Nette, **[please make a donation now](https://nette.org/donate)**. Thank you!
2826

2927
So we can forget about those famous code blocks:
@@ -50,7 +48,7 @@ The recommended way to install is via Composer:
5048
composer require nette/robot-loader
5149
```
5250

53-
It requires PHP version 7.1.
51+
It requires PHP version 7.1 and supports PHP up to 8.0.
5452

5553

5654
Usage

src/RobotLoader/RobotLoader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,8 +338,8 @@ private function scanPhp(string $file): array
338338
case T_WHITESPACE:
339339
continue 2;
340340

341-
case T_NS_SEPARATOR:
342341
case T_STRING:
342+
case PHP_VERSION_ID < 80000 ? T_NS_SEPARATOR : T_NAME_QUALIFIED:
343343
if ($expected) {
344344
$name .= $token[1];
345345
}

0 commit comments

Comments
 (0)