Skip to content

Commit eb840e5

Browse files
committed
Removed support for Laravel 8 and therefore for PHP < 8.0
1 parent 485c756 commit eb840e5

File tree

13 files changed

+22
-200
lines changed

13 files changed

+22
-200
lines changed

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

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,13 @@ jobs:
1919
strategy:
2020
fail-fast: false
2121
matrix:
22-
php: [8.3, 8.2, 8.1, 8.0, 7.4, 7.3]
23-
laravel: [10.*, 9.*, 8.*]
22+
php: [8.3, 8.2, 8.1, 8.0]
23+
laravel: [10.*, 9.*]
2424
exclude:
2525
- php: 8.0
2626
laravel: 10.*
27-
- php: 7.4
28-
laravel: 10.*
29-
- php: 7.3
30-
laravel: 10.*
3127
- php: 8.3
3228
laravel: 9.*
33-
- php: 7.4
34-
laravel: 9.*
35-
- php: 7.3
36-
laravel: 9.*
37-
- php: 8.3
38-
laravel: 8.*
39-
- php: 8.2
40-
laravel: 8.*
4129
name: P${{ matrix.php }} - Laravel${{ matrix.laravel }}
4230
steps:
4331
- name: Checkout code

.github/workflows/run-tests.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,26 +20,14 @@ jobs:
2020
strategy:
2121
matrix:
2222
os: [ubuntu-20.04, windows-2019]
23-
php: [8.3, 8.2, 8.1, 8.0, 7.4, 7.3]
24-
laravel: [8.*, 9.*, 10.*]
23+
php: [8.3, 8.2, 8.1, 8.0]
24+
laravel: [9.*, 10.*]
2525
dependency-version: [prefer-lowest, prefer-stable]
2626
exclude:
2727
- php: 8.0
2828
laravel: 10.*
29-
- php: 7.4
30-
laravel: 10.*
31-
- php: 7.3
32-
laravel: 10.*
3329
- php: 8.0
3430
dependency-version: prefer-lowest
35-
- php: 7.4
36-
laravel: 9.*
37-
- php: 7.3
38-
laravel: 9.*
39-
- os: windows-2019
40-
php: 7.4
41-
- os: windows-2019
42-
php: 7.3
4331
steps:
4432
- name: Set git to use LF
4533
if: ${{ matrix.os == 'windows-2019' }}

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
55
[Next release](https://github.com/barryvdh/laravel-ide-helper/compare/v2.14.0...master)
66
--------------
77

8+
### Changed
9+
- Removed support for Laravel 8 and therefore for PHP < 8.0 [#1504 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1504)
10+
811
2024-02-05, 2.14.0
912
------------------
1013

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
This package generates helper files that enable your IDE to provide accurate autocompletion.
1212
Generation is done based on the files in your project, so they are always up-to-date.
1313

14-
It supports Laravel 8+ and PHP 7.3+
14+
It supports Laravel 9+ and PHP 8.0+
1515

1616
- [Installation](#installation)
1717
- [Usage](#usage)

composer.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,24 @@
2020
}
2121
],
2222
"require": {
23-
"php": "^7.3 || ^8.0",
23+
"php": "^8.0",
2424
"ext-json": "*",
2525
"barryvdh/reflection-docblock": "^2.0.6",
2626
"composer/class-map-generator": "^1.0",
2727
"doctrine/dbal": "^2.6 || ^3",
28-
"illuminate/console": "^8 || ^9 || ^10",
29-
"illuminate/filesystem": "^8 || ^9 || ^10",
30-
"illuminate/support": "^8 || ^9 || ^10",
28+
"illuminate/console": "^9 || ^10",
29+
"illuminate/filesystem": "^9 || ^10",
30+
"illuminate/support": "^9 || ^10",
3131
"nikic/php-parser": "^4.18 || ^5",
3232
"phpdocumentor/type-resolver": "^1.1.0"
3333
},
3434
"require-dev": {
3535
"ext-pdo_sqlite": "*",
3636
"friendsofphp/php-cs-fixer": "^2",
37-
"illuminate/config": "^8 || ^9 || ^10",
38-
"illuminate/view": "^8 || ^9 || ^10",
37+
"illuminate/config": "^9 || ^10",
38+
"illuminate/view": "^9 || ^10",
3939
"mockery/mockery": "^1.4",
40-
"orchestra/testbench": "^6 || ^7 || ^8",
40+
"orchestra/testbench": "^7 || ^8",
4141
"phpunit/phpunit": "^8.5 || ^9",
4242
"spatie/phpunit-snapshot-assertions": "^3 || ^4",
4343
"vimeo/psalm": "^5.4"

src/Console/ModelsCommand.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,11 +1330,7 @@ protected function getFactoryMethods($model)
13301330
return;
13311331
}
13321332

1333-
if (version_compare($this->laravel->version(), '9', '>=')) {
1334-
$this->setMethod('factory', $factory, ['$count = null, $state = []']);
1335-
} else {
1336-
$this->setMethod('factory', $factory, ['...$parameters']);
1337-
}
1333+
$this->setMethod('factory', $factory, ['$count = null, $state = []']);
13381334
}
13391335

13401336
/**

tests/Console/ModelsCommand/Attributes/Test.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,6 @@
99

1010
class Test extends AbstractModelsCommand
1111
{
12-
protected function setUp(): void
13-
{
14-
parent::setUp();
15-
16-
if (!class_exists('\Illuminate\Database\Eloquent\Casts\Attribute')) {
17-
$this->markTestSkipped('This test requires Laravel 8.77 or newer');
18-
}
19-
}
20-
2112
public function test(): void
2213
{
2314
$command = $this->app->make(ModelsCommand::class);

tests/Console/ModelsCommand/DynamicRelations/Test.php

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,11 @@ public function test(): void
1717
'--write' => true,
1818
]);
1919

20-
if (PHP_VERSION_ID >= 80000) {
21-
$errors = [
22-
'Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicBelongsTo() : Attempt to read property "created_at" on null',
23-
'Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicHasMany() : Attempt to read property "created_at" on null',
24-
'Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicHasOne() : Attempt to read property "created_at" on null',
25-
];
26-
} else {
27-
$errors = [
28-
"Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicBelongsTo() : Trying to get property 'created_at' of non-object",
29-
"Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicHasMany() : Trying to get property 'created_at' of non-object",
30-
"Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicHasOne() : Trying to get property 'created_at' of non-object",
31-
];
32-
}
20+
$errors = [
21+
'Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicBelongsTo() : Attempt to read property "created_at" on null',
22+
'Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicHasMany() : Attempt to read property "created_at" on null',
23+
'Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicHasOne() : Attempt to read property "created_at" on null',
24+
];
3325

3426
$this->assertSame(0, $tester->getStatusCode());
3527
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());

tests/Console/ModelsCommand/Factories/Test.php

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,12 @@
88
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AbstractModelsCommand;
99
use Closure;
1010
use Illuminate\Database\Eloquent\Factories\Factory;
11-
use Illuminate\Foundation\Application;
1211
use Illuminate\Support\Str;
1312

1413
class Test extends AbstractModelsCommand
1514
{
16-
public function test_8(): void
15+
public function testFactory(): void
1716
{
18-
if (!version_compare(Application::VERSION, '8.2', '>=') || !version_compare(Application::VERSION, '9', '<')) {
19-
$this->markTestSkipped(
20-
'This test only works in Laravel >= 8.2 and < 9'
21-
);
22-
}
23-
24-
Factory::guessFactoryNamesUsing(static::getFactoryNameResolver());
25-
26-
$command = $this->app->make(ModelsCommand::class);
27-
28-
$tester = $this->runCommand($command, [
29-
'--write' => true,
30-
]);
31-
32-
$this->assertSame(0, $tester->getStatusCode());
33-
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
34-
$this->assertStringNotContainsString('not found', $tester->getDisplay());
35-
$this->assertMatchesMockedSnapshot();
36-
}
37-
38-
public function test_9(): void
39-
{
40-
if (!version_compare(Application::VERSION, '9', '>=')) {
41-
$this->markTestSkipped(
42-
'This test only works in Laravel >= 9'
43-
);
44-
}
45-
4617
Factory::guessFactoryNamesUsing(static::getFactoryNameResolver());
4718

4819
$command = $this->app->make(ModelsCommand::class);

0 commit comments

Comments
 (0)