diff --git a/.github/workflows/coding-style.yml b/.github/workflows/coding-style.yml index c86b983..8c60f76 100644 --- a/.github/workflows/coding-style.yml +++ b/.github/workflows/coding-style.yml @@ -10,7 +10,7 @@ jobs: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.1 coverage: none - run: composer create-project nette/code-checker temp/code-checker ^3 --no-progress @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.1 coverage: none - run: composer create-project nette/coding-standard temp/coding-standard ^3 --no-progress diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 5a39324..7db19f2 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.5 coverage: none - run: composer install --no-progress --prefer-dist diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e4e361f..8ed81e7 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['8.0', '8.1', '8.2', '8.3', '8.4'] + php: ['8.1', '8.2', '8.3', '8.4', '8.5'] fail-fast: false @@ -35,7 +35,7 @@ jobs: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.1 coverage: none - run: composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable @@ -49,7 +49,7 @@ jobs: - uses: actions/checkout@v4 - uses: shivammathur/setup-php@v2 with: - php-version: 8.0 + php-version: 8.1 coverage: none - run: composer install --no-progress --prefer-dist diff --git a/composer.json b/composer.json index 45d0b24..91bf564 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": "8.0 - 8.4", + "php": "8.1 - 8.5", "ext-tokenizer": "*", "nette/utils": "^4.0" }, @@ -37,7 +37,7 @@ }, "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.1-dev" } } } diff --git a/readme.md b/readme.md index 3c41405..63856f8 100644 --- a/readme.md +++ b/readme.md @@ -58,7 +58,7 @@ If you're building an application using [Composer](https://doc.nette.org/en/best composer require nette/robot-loader ``` -It requires PHP version 8.0 and supports PHP up to 8.4. +It requires PHP version 8.1 and supports PHP up to 8.5.   diff --git a/src/RobotLoader/RobotLoader.php b/src/RobotLoader/RobotLoader.php index f909422..5da3209 100644 --- a/src/RobotLoader/RobotLoader.php +++ b/src/RobotLoader/RobotLoader.php @@ -12,6 +12,8 @@ use Nette; use Nette\Utils\FileSystem; use SplFileInfo; +use function array_merge, defined, extension_loaded, file_get_contents, file_put_contents, filemtime, flock, fopen, function_exists, hash, is_array, is_dir, is_file, realpath, rename, serialize, spl_autoload_register, sprintf, strlen, unlink, var_export; +use const LOCK_EX, LOCK_SH, LOCK_UN, T_CLASS, T_COMMENT, T_DOC_COMMENT, T_ENUM, T_INTERFACE, T_NAME_QUALIFIED, T_NAMESPACE, T_STRING, T_TRAIT, T_WHITESPACE, TOKEN_PARSE; /** @@ -321,7 +323,6 @@ private function scanPhp(string $file): array } catch (\ParseError $e) { if ($this->reportParseErrors) { $rp = new \ReflectionProperty($e, 'file'); - $rp->setAccessible(true); $rp->setValue($e, $file); throw $e; } @@ -348,9 +349,7 @@ private function scanPhp(string $file): array case T_CLASS: case T_INTERFACE: case T_TRAIT: - case PHP_VERSION_ID < 80100 - ? T_CLASS - : T_ENUM: + case T_ENUM: $expected = $token->id; $name = ''; continue 2; @@ -503,7 +502,7 @@ private function generateCacheFileName(): string throw new \LogicException('Set path to temporary directory using setTempDirectory().'); } - return $this->tempDirectory . '/' . hash(PHP_VERSION_ID < 80100 ? 'md5' : 'xxh128', serialize($this->generateCacheKey())) . '.php'; + return $this->tempDirectory . '/' . hash('xxh128', serialize($this->generateCacheKey())) . '.php'; }