From eb840e5844fdf9e1ed76ec97425219271e742930 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Sun, 28 Jan 2024 20:33:37 +0100 Subject: [PATCH 1/3] Removed support for Laravel 8 and therefore for PHP < 8.0 --- .github/workflows/run-integration-tests.yml | 16 +--- .github/workflows/run-tests.yml | 16 +--- CHANGELOG.md | 3 + README.md | 2 +- composer.json | 14 +-- src/Console/ModelsCommand.php | 6 +- .../Console/ModelsCommand/Attributes/Test.php | 9 -- .../ModelsCommand/DynamicRelations/Test.php | 18 +--- .../Console/ModelsCommand/Factories/Test.php | 31 +----- ...test_9__1.php => Test__testFactory__1.php} | 0 .../__snapshots__/Test__test_8__1.php | 94 ------------------- .../Console/ModelsCommand/UnionTypes/Test.php | 9 -- tests/MacroTest.php | 4 - 13 files changed, 22 insertions(+), 200 deletions(-) rename tests/Console/ModelsCommand/Factories/__snapshots__/{Test__test_9__1.php => Test__testFactory__1.php} (100%) delete mode 100644 tests/Console/ModelsCommand/Factories/__snapshots__/Test__test_8__1.php diff --git a/.github/workflows/run-integration-tests.yml b/.github/workflows/run-integration-tests.yml index 84345c5dc..6edd28188 100644 --- a/.github/workflows/run-integration-tests.yml +++ b/.github/workflows/run-integration-tests.yml @@ -19,25 +19,13 @@ jobs: strategy: fail-fast: false matrix: - php: [8.3, 8.2, 8.1, 8.0, 7.4, 7.3] - laravel: [10.*, 9.*, 8.*] + php: [8.3, 8.2, 8.1, 8.0] + laravel: [10.*, 9.*] exclude: - php: 8.0 laravel: 10.* - - php: 7.4 - laravel: 10.* - - php: 7.3 - laravel: 10.* - php: 8.3 laravel: 9.* - - php: 7.4 - laravel: 9.* - - php: 7.3 - laravel: 9.* - - php: 8.3 - laravel: 8.* - - php: 8.2 - laravel: 8.* name: P${{ matrix.php }} - Laravel${{ matrix.laravel }} steps: - name: Checkout code diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 55b79cdff..b94dc0d1b 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -20,26 +20,14 @@ jobs: strategy: matrix: os: [ubuntu-20.04, windows-2019] - php: [8.3, 8.2, 8.1, 8.0, 7.4, 7.3] - laravel: [8.*, 9.*, 10.*] + php: [8.3, 8.2, 8.1, 8.0] + laravel: [9.*, 10.*] dependency-version: [prefer-lowest, prefer-stable] exclude: - php: 8.0 laravel: 10.* - - php: 7.4 - laravel: 10.* - - php: 7.3 - laravel: 10.* - php: 8.0 dependency-version: prefer-lowest - - php: 7.4 - laravel: 9.* - - php: 7.3 - laravel: 9.* - - os: windows-2019 - php: 7.4 - - os: windows-2019 - php: 7.3 steps: - name: Set git to use LF if: ${{ matrix.os == 'windows-2019' }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 15556fa99..16fa90442 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file. [Next release](https://github.com/barryvdh/laravel-ide-helper/compare/v2.14.0...master) -------------- +### Changed +- Removed support for Laravel 8 and therefore for PHP < 8.0 [#1504 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1504) + 2024-02-05, 2.14.0 ------------------ diff --git a/README.md b/README.md index 7050d13d1..e35427173 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This package generates helper files that enable your IDE to provide accurate autocompletion. Generation is done based on the files in your project, so they are always up-to-date. -It supports Laravel 8+ and PHP 7.3+ +It supports Laravel 9+ and PHP 8.0+ - [Installation](#installation) - [Usage](#usage) diff --git a/composer.json b/composer.json index 8d7163d6f..08ae9c061 100644 --- a/composer.json +++ b/composer.json @@ -20,24 +20,24 @@ } ], "require": { - "php": "^7.3 || ^8.0", + "php": "^8.0", "ext-json": "*", "barryvdh/reflection-docblock": "^2.0.6", "composer/class-map-generator": "^1.0", "doctrine/dbal": "^2.6 || ^3", - "illuminate/console": "^8 || ^9 || ^10", - "illuminate/filesystem": "^8 || ^9 || ^10", - "illuminate/support": "^8 || ^9 || ^10", + "illuminate/console": "^9 || ^10", + "illuminate/filesystem": "^9 || ^10", + "illuminate/support": "^9 || ^10", "nikic/php-parser": "^4.18 || ^5", "phpdocumentor/type-resolver": "^1.1.0" }, "require-dev": { "ext-pdo_sqlite": "*", "friendsofphp/php-cs-fixer": "^2", - "illuminate/config": "^8 || ^9 || ^10", - "illuminate/view": "^8 || ^9 || ^10", + "illuminate/config": "^9 || ^10", + "illuminate/view": "^9 || ^10", "mockery/mockery": "^1.4", - "orchestra/testbench": "^6 || ^7 || ^8", + "orchestra/testbench": "^7 || ^8", "phpunit/phpunit": "^8.5 || ^9", "spatie/phpunit-snapshot-assertions": "^3 || ^4", "vimeo/psalm": "^5.4" diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index ec39deec5..05104aa91 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -1330,11 +1330,7 @@ protected function getFactoryMethods($model) return; } - if (version_compare($this->laravel->version(), '9', '>=')) { - $this->setMethod('factory', $factory, ['$count = null, $state = []']); - } else { - $this->setMethod('factory', $factory, ['...$parameters']); - } + $this->setMethod('factory', $factory, ['$count = null, $state = []']); } /** diff --git a/tests/Console/ModelsCommand/Attributes/Test.php b/tests/Console/ModelsCommand/Attributes/Test.php index 32bdbfd0d..15a56638f 100644 --- a/tests/Console/ModelsCommand/Attributes/Test.php +++ b/tests/Console/ModelsCommand/Attributes/Test.php @@ -9,15 +9,6 @@ class Test extends AbstractModelsCommand { - protected function setUp(): void - { - parent::setUp(); - - if (!class_exists('\Illuminate\Database\Eloquent\Casts\Attribute')) { - $this->markTestSkipped('This test requires Laravel 8.77 or newer'); - } - } - public function test(): void { $command = $this->app->make(ModelsCommand::class); diff --git a/tests/Console/ModelsCommand/DynamicRelations/Test.php b/tests/Console/ModelsCommand/DynamicRelations/Test.php index dedfb2275..064797dc5 100644 --- a/tests/Console/ModelsCommand/DynamicRelations/Test.php +++ b/tests/Console/ModelsCommand/DynamicRelations/Test.php @@ -17,19 +17,11 @@ public function test(): void '--write' => true, ]); - if (PHP_VERSION_ID >= 80000) { - $errors = [ - 'Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicBelongsTo() : Attempt to read property "created_at" on null', - 'Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicHasMany() : Attempt to read property "created_at" on null', - 'Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicHasOne() : Attempt to read property "created_at" on null', - ]; - } else { - $errors = [ - "Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicBelongsTo() : Trying to get property 'created_at' of non-object", - "Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicHasMany() : Trying to get property 'created_at' of non-object", - "Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicHasOne() : Trying to get property 'created_at' of non-object", - ]; - } + $errors = [ + 'Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicBelongsTo() : Attempt to read property "created_at" on null', + 'Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicHasMany() : Attempt to read property "created_at" on null', + 'Error resolving relation model of Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DynamicRelations\Models\Dynamic:dynamicHasOne() : Attempt to read property "created_at" on null', + ]; $this->assertSame(0, $tester->getStatusCode()); $this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay()); diff --git a/tests/Console/ModelsCommand/Factories/Test.php b/tests/Console/ModelsCommand/Factories/Test.php index 1e96e342a..f601911ef 100644 --- a/tests/Console/ModelsCommand/Factories/Test.php +++ b/tests/Console/ModelsCommand/Factories/Test.php @@ -8,41 +8,12 @@ use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AbstractModelsCommand; use Closure; use Illuminate\Database\Eloquent\Factories\Factory; -use Illuminate\Foundation\Application; use Illuminate\Support\Str; class Test extends AbstractModelsCommand { - public function test_8(): void + public function testFactory(): void { - if (!version_compare(Application::VERSION, '8.2', '>=') || !version_compare(Application::VERSION, '9', '<')) { - $this->markTestSkipped( - 'This test only works in Laravel >= 8.2 and < 9' - ); - } - - Factory::guessFactoryNamesUsing(static::getFactoryNameResolver()); - - $command = $this->app->make(ModelsCommand::class); - - $tester = $this->runCommand($command, [ - '--write' => true, - ]); - - $this->assertSame(0, $tester->getStatusCode()); - $this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay()); - $this->assertStringNotContainsString('not found', $tester->getDisplay()); - $this->assertMatchesMockedSnapshot(); - } - - public function test_9(): void - { - if (!version_compare(Application::VERSION, '9', '>=')) { - $this->markTestSkipped( - 'This test only works in Laravel >= 9' - ); - } - Factory::guessFactoryNamesUsing(static::getFactoryNameResolver()); $command = $this->app->make(ModelsCommand::class); diff --git a/tests/Console/ModelsCommand/Factories/__snapshots__/Test__test_9__1.php b/tests/Console/ModelsCommand/Factories/__snapshots__/Test__testFactory__1.php similarity index 100% rename from tests/Console/ModelsCommand/Factories/__snapshots__/Test__test_9__1.php rename to tests/Console/ModelsCommand/Factories/__snapshots__/Test__testFactory__1.php diff --git a/tests/Console/ModelsCommand/Factories/__snapshots__/Test__test_8__1.php b/tests/Console/ModelsCommand/Factories/__snapshots__/Test__test_8__1.php deleted file mode 100644 index 6c705147d..000000000 --- a/tests/Console/ModelsCommand/Factories/__snapshots__/Test__test_8__1.php +++ /dev/null @@ -1,94 +0,0 @@ -markTestSkipped('This test requires PHP 8.0 or higher'); - } - } - public function test(): void { $command = $this->app->make(ModelsCommand::class); diff --git a/tests/MacroTest.php b/tests/MacroTest.php index a0fa904a2..00970acb9 100644 --- a/tests/MacroTest.php +++ b/tests/MacroTest.php @@ -190,10 +190,6 @@ function ($a = null): int { public function testInitPhpDocParamsWithUnionTypes(): void { - if (PHP_VERSION_ID < 80000) { - $this->markTestSkipped('This test requires PHP 8.0 or higher'); - } - $phpdoc = (new MacroMock())->getPhpDoc(eval(<<<'PHP' return new ReflectionFunction( /** From 96a5f4cf3d633ac99da77f999a5fea383f5a45a8 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Sun, 28 Jan 2024 20:44:05 +0100 Subject: [PATCH 2/3] Update php-cs-fixer to v3 --- .gitignore | 6 +++--- .php_cs.common.php => .php-cs-fixer.common.php | 3 +-- .php_cs.dist => .php-cs-fixer.dist.php | 6 +++--- .php_cs.tests.php => .php-cs-fixer.tests.php | 6 +++--- composer.json | 4 ++-- 5 files changed, 12 insertions(+), 13 deletions(-) rename .php_cs.common.php => .php-cs-fixer.common.php (94%) rename .php_cs.dist => .php-cs-fixer.dist.php (59%) rename .php_cs.tests.php => .php-cs-fixer.tests.php (69%) diff --git a/.gitignore b/.gitignore index 1192196b0..c92a701bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ .phpunit.result.cache /.idea -/.php_cs -/.php_cs.cache -/.php_cs.tests.cache +/.php-cs-fixer.cache +/.php-cs-fixer.php +/.php-cs-fixer.tests.cache /composer.lock /vendor diff --git a/.php_cs.common.php b/.php-cs-fixer.common.php similarity index 94% rename from .php_cs.common.php rename to .php-cs-fixer.common.php index aebd5441d..31f433b90 100644 --- a/.php_cs.common.php +++ b/.php-cs-fixer.common.php @@ -30,7 +30,6 @@ ], 'return_type_declaration' => true, 'short_scalar_cast' => true, - 'single_blank_line_before_namespace' => true, 'single_trait_insert_per_statement' => true, 'ternary_operator_spaces' => true, 'visibility_required' => [ @@ -56,7 +55,7 @@ 'no_unused_imports' => true, 'single_quote' => true, 'space_after_semicolon' => true, - 'trailing_comma_in_multiline_array' => true, + 'trailing_comma_in_multiline' => true, 'trim_array_spaces' => true, 'unary_operator_spaces' => true, 'whitespace_after_comma_in_array' => true, diff --git a/.php_cs.dist b/.php-cs-fixer.dist.php similarity index 59% rename from .php_cs.dist rename to .php-cs-fixer.dist.php index 208334516..41c5d21e4 100644 --- a/.php_cs.dist +++ b/.php-cs-fixer.dist.php @@ -5,10 +5,10 @@ ->in(__DIR__) ->exclude('tests'); -$config = require __DIR__ . '/.php_cs.common.php'; +$config = require __DIR__ . '/.php-cs-fixer.common.php'; -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setFinder($finder) ->setRules($config) ->setRiskyAllowed(true) - ->setCacheFile(__DIR__ . '/.php_cs.cache'); + ->setCacheFile(__DIR__ . '/.php-cs-fixer.cache'); diff --git a/.php_cs.tests.php b/.php-cs-fixer.tests.php similarity index 69% rename from .php_cs.tests.php rename to .php-cs-fixer.tests.php index 24c484d1f..652efcdaa 100644 --- a/.php_cs.tests.php +++ b/.php-cs-fixer.tests.php @@ -5,7 +5,7 @@ ->in(__DIR__ . '/tests') ->exclude('__snapshots__'); -$config = require __DIR__ . '/.php_cs.common.php'; +$config = require __DIR__ . '/.php-cs-fixer.common.php'; // Additional rules for tests $config = array_merge( @@ -15,8 +15,8 @@ ] ); -return PhpCsFixer\Config::create() +return (new PhpCsFixer\Config()) ->setFinder($finder) ->setRules($config) ->setRiskyAllowed(true) - ->setCacheFile(__DIR__ . '/.php_cs.tests.cache'); + ->setCacheFile(__DIR__ . '/.php-cs-fixer.tests.cache'); diff --git a/composer.json b/composer.json index 08ae9c061..07d7a023a 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ }, "require-dev": { "ext-pdo_sqlite": "*", - "friendsofphp/php-cs-fixer": "^2", + "friendsofphp/php-cs-fixer": "^3", "illuminate/config": "^9 || ^10", "illuminate/view": "^9 || ^10", "mockery/mockery": "^1.4", @@ -81,7 +81,7 @@ ], "fix-style": [ "php-cs-fixer fix", - "php-cs-fixer fix --config=.php_cs.tests.php" + "php-cs-fixer fix --config=.php-cs-fixer.tests.php" ], "psalm-set-baseline": "psalm --set-baseline=psalm-baseline.xml", "test": "phpunit", From ece9d73bfced8aad4011beb7864e5383377a47b7 Mon Sep 17 00:00:00 2001 From: Markus Podar Date: Sun, 28 Jan 2024 20:44:16 +0100 Subject: [PATCH 3/3] composer fix-style --- src/Alias.php | 4 ++-- src/Console/GeneratorCommand.php | 4 ++-- src/Console/ModelsCommand.php | 22 +++++++++---------- src/Generator.php | 4 ++-- src/Listeners/GenerateModelHelper.php | 8 +++---- src/Method.php | 2 +- .../Attributes/Models/Simple.php | 2 +- .../__snapshots__/Test__test__1.php | 2 +- .../Casts/CastableReturnsAnonymousCaster.php | 2 +- .../Casts/CastableWithoutReturnType.php | 2 +- .../CustomCasterWithDocblockReturnFqn.php | 2 +- tests/MacroTest.php | 4 ++-- 12 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/Alias.php b/src/Alias.php index ff4ae67fa..046fffe41 100644 --- a/src/Alias.php +++ b/src/Alias.php @@ -329,7 +329,7 @@ protected function addMagicMethods() continue; } $method = new \ReflectionMethod($className, $name); - $class = new \ReflectionClass($className); + $class = new ReflectionClass($className); if (!in_array($magic, $this->usedMethods)) { if ($class !== $this->root) { @@ -348,7 +348,7 @@ protected function addMagicMethods() protected function detectMethods() { foreach ($this->classes as $class) { - $reflection = new \ReflectionClass($class); + $reflection = new ReflectionClass($class); $methods = $reflection->getMethods(\ReflectionMethod::IS_PUBLIC); if ($methods) { diff --git a/src/Console/GeneratorCommand.php b/src/Console/GeneratorCommand.php index 40758ecf7..0004e8ff0 100644 --- a/src/Console/GeneratorCommand.php +++ b/src/Console/GeneratorCommand.php @@ -42,7 +42,7 @@ class GeneratorCommand extends Command /** @var \Illuminate\Config\Repository */ protected $config; - /** @var \Illuminate\Filesystem\Filesystem */ + /** @var Filesystem */ protected $files; /** @var \Illuminate\View\Factory */ @@ -54,7 +54,7 @@ class GeneratorCommand extends Command /** * * @param \Illuminate\Config\Repository $config - * @param \Illuminate\Filesystem\Filesystem $files + * @param Filesystem $files * @param \Illuminate\View\Factory $view */ public function __construct( diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 05104aa91..c2ce4a674 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -354,7 +354,7 @@ protected function loadModels() /** * cast the properties's type from $casts. * - * @param \Illuminate\Database\Eloquent\Model $model + * @param Model $model */ public function castPropertiesType($model) { @@ -498,7 +498,7 @@ protected function getTypeOverride($type) /** * Load the properties from the database table. * - * @param \Illuminate\Database\Eloquent\Model $model + * @param Model $model * * @throws DBALException If custom field failed to register */ @@ -602,7 +602,7 @@ public function getPropertiesFromTable($model) } /** - * @param \Illuminate\Database\Eloquent\Model $model + * @param Model $model */ public function getPropertiesFromMethods($model) { @@ -777,7 +777,7 @@ public function getPropertiesFromMethods($model) 'int|null', true, false - // What kind of comments should be added to the relation count here? + // What kind of comments should be added to the relation count here? ); } } elseif ( @@ -1126,7 +1126,7 @@ protected function getCollectionClass($className) return '\Illuminate\Database\Eloquent\Collection'; } - /** @var \Illuminate\Database\Eloquent\Model $model */ + /** @var Model $model */ $model = new $className(); return '\\' . get_class($model->newCollection()); } @@ -1285,7 +1285,7 @@ protected function getReturnTypeFromReflection(\ReflectionMethod $reflection): ? /** * Generates methods provided by the SoftDeletes trait - * @param \Illuminate\Database\Eloquent\Model $model + * @param Model $model */ protected function getSoftDeleteMethods($model) { @@ -1302,7 +1302,7 @@ protected function getSoftDeleteMethods($model) /** * Generate factory method from "HasFactory" trait. * - * @param \Illuminate\Database\Eloquent\Model $model + * @param Model $model */ protected function getFactoryMethods($model) { @@ -1335,7 +1335,7 @@ protected function getFactoryMethods($model) /** * Generates methods that return collections - * @param \Illuminate\Database\Eloquent\Model $model + * @param Model $model */ protected function getCollectionMethods($model) { @@ -1378,7 +1378,7 @@ protected function checkForCastableCasts(string $type, array $params = []): stri return $type; } - $reflection = new \ReflectionClass($type); + $reflection = new ReflectionClass($type); if (!$reflection->implementsInterface(Castable::class)) { return $type; @@ -1410,7 +1410,7 @@ protected function checkForCustomLaravelCasts(string $type): ?string return $type; } - $reflection = new \ReflectionClass($type); + $reflection = new ReflectionClass($type); if (!$reflection->implementsInterface(CastsAttributes::class)) { return $type; @@ -1616,7 +1616,7 @@ protected function getReflectionNamedType(ReflectionNamedType $paramType): strin } /** - * @param \Illuminate\Database\Eloquent\Model $model + * @param Model $model * @throws \Illuminate\Contracts\Container\BindingResolutionException * @throws \RuntimeException */ diff --git a/src/Generator.php b/src/Generator.php index 61417e2cf..abad5346b 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -26,7 +26,7 @@ class Generator /** @var \Illuminate\View\Factory */ protected $view; - /** @var \Symfony\Component\Console\Output\OutputInterface */ + /** @var OutputInterface */ protected $output; protected $extra = []; @@ -37,7 +37,7 @@ class Generator /** * @param \Illuminate\Config\Repository $config * @param \Illuminate\View\Factory $view - * @param \Symfony\Component\Console\Output\OutputInterface $output + * @param OutputInterface $output * @param string $helpers */ public function __construct( diff --git a/src/Listeners/GenerateModelHelper.php b/src/Listeners/GenerateModelHelper.php index 86e2bd4bf..c448aef70 100644 --- a/src/Listeners/GenerateModelHelper.php +++ b/src/Listeners/GenerateModelHelper.php @@ -16,15 +16,15 @@ class GenerateModelHelper */ public static $shouldRun = false; - /** @var \Illuminate\Contracts\Console\Kernel */ + /** @var Artisan */ protected $artisan; - /** @var \Illuminate\Contracts\Config\Repository */ + /** @var Config */ protected $config; /** - * @param \Illuminate\Contracts\Console\Kernel $artisan - * @param \Illuminate\Contracts\Config\Repository $config + * @param Artisan $artisan + * @param Config $config */ public function __construct(Artisan $artisan, Config $config) { diff --git a/src/Method.php b/src/Method.php index f7f7ffaaf..a46e3f2f3 100644 --- a/src/Method.php +++ b/src/Method.php @@ -22,7 +22,7 @@ class Method { - /** @var \Barryvdh\Reflection\DocBlock */ + /** @var DocBlock */ protected $phpdoc; /** @var \ReflectionMethod */ diff --git a/tests/Console/ModelsCommand/Attributes/Models/Simple.php b/tests/Console/ModelsCommand/Attributes/Models/Simple.php index f64861b44..d2b860920 100644 --- a/tests/Console/ModelsCommand/Attributes/Models/Simple.php +++ b/tests/Console/ModelsCommand/Attributes/Models/Simple.php @@ -27,7 +27,7 @@ function (?string $name): ?string { * phpdoc is ignored here deliberately due to performance reasons and also * isn't supported by Laravel itself. * - * @return \Illuminate\Database\Eloquent\Casts\Attribute + * @return Attribute */ protected function notAnAttribute() { diff --git a/tests/Console/ModelsCommand/Attributes/__snapshots__/Test__test__1.php b/tests/Console/ModelsCommand/Attributes/__snapshots__/Test__test__1.php index df6863950..ef96b279e 100644 --- a/tests/Console/ModelsCommand/Attributes/__snapshots__/Test__test__1.php +++ b/tests/Console/ModelsCommand/Attributes/__snapshots__/Test__test__1.php @@ -38,7 +38,7 @@ function (?string $name): ?string { * phpdoc is ignored here deliberately due to performance reasons and also * isn't supported by Laravel itself. * - * @return \Illuminate\Database\Eloquent\Casts\Attribute + * @return Attribute */ protected function notAnAttribute() { diff --git a/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableReturnsAnonymousCaster.php b/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableReturnsAnonymousCaster.php index 268e3574d..99eca4990 100644 --- a/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableReturnsAnonymousCaster.php +++ b/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableReturnsAnonymousCaster.php @@ -11,7 +11,7 @@ class CastableReturnsAnonymousCaster implements Castable { public static function castUsing(array $arguments) { - return new class() implements CastsAttributes { + return new class () implements CastsAttributes { /** * @inheritDoc * @return CastedProperty diff --git a/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableWithoutReturnType.php b/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableWithoutReturnType.php index c4d499140..4f726b52f 100644 --- a/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableWithoutReturnType.php +++ b/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CastableWithoutReturnType.php @@ -11,7 +11,7 @@ class CastableWithoutReturnType implements Castable { public static function castUsing(array $arguments) { - return new class() implements CastsAttributes { + return new class () implements CastsAttributes { public function get($model, string $key, $value, array $attributes) { return new CastedProperty(); diff --git a/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithDocblockReturnFqn.php b/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithDocblockReturnFqn.php index f436aad7d..b06013b68 100644 --- a/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithDocblockReturnFqn.php +++ b/tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithDocblockReturnFqn.php @@ -10,7 +10,7 @@ class CustomCasterWithDocblockReturnFqn implements CastsAttributes { /** * @inheritDoc - * @return \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Casts\CastedProperty + * @return CastedProperty */ public function get($model, string $key, $value, array $attributes) { diff --git a/tests/MacroTest.php b/tests/MacroTest.php index 00970acb9..cf1f79fa4 100644 --- a/tests/MacroTest.php +++ b/tests/MacroTest.php @@ -227,7 +227,7 @@ public function testCanInstantiate() { $reflectionMethod = new \ReflectionMethod(UrlGeneratorMacroClass::class, '__invoke'); - $macro = new Macro($reflectionMethod, UrlGenerator::class, new \ReflectionClass(UrlGenerator::class), 'macroName'); + $macro = new Macro($reflectionMethod, UrlGenerator::class, new ReflectionClass(UrlGenerator::class), 'macroName'); $this->assertInstanceOf(Macro::class, $macro); } @@ -239,7 +239,7 @@ public function testOutput() { $reflectionMethod = new \ReflectionMethod(UrlGeneratorMacroClass::class, '__invoke'); - $macro = new Macro($reflectionMethod, 'URL', new \ReflectionClass(UrlGenerator::class), 'macroName'); + $macro = new Macro($reflectionMethod, 'URL', new ReflectionClass(UrlGenerator::class), 'macroName'); $output = <<<'DOC' /** *