Skip to content

Commit a147618

Browse files
mfnd3v2a
authored andcommitted
Add support for nikic/php-parser:^5 and (hopefully) doctrine/dbal:^4 (barryvdh#1502)
* Add support for nikic/php-parser:^5 - `createForHostVersion` has been added to php-parse 4.18 so code can run with both versions [1] - therefore also bumped the minimum required version to it Note: The dev dependency vimeo/psalm is **not** compatible with php-parser:^5 currently. This does not impact usages of this library, but sometimes cause friction when working on this library. For our CI this isn't a problem, because we already remove that dependency before running the test suite. [1] https://github.com/nikic/PHP-Parser/blob/master/UPGRADE-5.0.md#changes-to-the-parser-factory * gha: prevent cancelling of all jobs if one fails * Update CHANGELOG.md * gha: remove unsupported Laravel / PHP combinations According to https://laravel.com/docs/10.x/releases * Add dbal:^4 too
1 parent 01c13dd commit a147618

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

.github/workflows/run-integration-tests.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
env:
1818
COMPOSER_NO_INTERACTION: 1
1919
strategy:
20+
fail-fast: false
2021
matrix:
2122
php: [8.3, 8.2, 8.1, 8.0, 7.4, 7.3]
2223
laravel: [10.*, 9.*, 8.*]
@@ -25,14 +26,18 @@ jobs:
2526
laravel: 10.*
2627
- php: 7.4
2728
laravel: 10.*
28-
- php: 7.4
29-
laravel: 10.*
3029
- php: 7.3
3130
laravel: 10.*
31+
- php: 8.3
32+
laravel: 9.*
3233
- php: 7.4
3334
laravel: 9.*
3435
- php: 7.3
3536
laravel: 9.*
37+
- php: 8.3
38+
laravel: 8.*
39+
- php: 8.2
40+
laravel: 8.*
3641
name: P${{ matrix.php }} - Laravel${{ matrix.laravel }}
3742
steps:
3843
- name: Checkout code

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
1313
- Add support for attribute accessors marked as protected. [#1339 / pindab0ter](https://github.com/barryvdh/laravel-ide-helper/pull/1339)
1414

1515
### Added
16+
- Add support for nikic/php-parser 5 (next to 4) [#1502 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1502)
1617
- Add support for `immutable_date:*` and `immutable_datetime:*` casts. [#1380 / thekonz](https://github.com/barryvdh/laravel-ide-helper/pull/1380)
1718

1819
2023-02-04, 2.13.0

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
"ext-json": "*",
2525
"barryvdh/reflection-docblock": "^2.0.6",
2626
"composer/class-map-generator": "^1.0",
27-
"doctrine/dbal": "^2.6 || ^3",
27+
"doctrine/dbal": "^2.6 || ^3 || ^4",
2828
"illuminate/console": "^8 || ^9 || ^10",
2929
"illuminate/filesystem": "^8 || ^9 || ^10",
3030
"illuminate/support": "^8 || ^9 || ^10",
31-
"nikic/php-parser": "^4.7",
31+
"nikic/php-parser": "^4.18 || ^5",
3232
"phpdocumentor/type-resolver": "^1.1.0"
3333
},
3434
"require-dev": {

src/UsesResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function loadFromCode(string $classFQN, string $code): array
6464
'\\'
6565
);
6666

67-
$parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7);
67+
$parser = (new ParserFactory())->createForHostVersion();
6868
$namespaceData = null;
6969

7070
foreach ($parser->parse($code) as $node) {

0 commit comments

Comments
 (0)