From 17cdbc159fadc9247d87ddf52acf739f2e5e6deb Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 10:54:16 +0100 Subject: [PATCH 01/29] Speed up local checks and silence warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Disable Xdebug by default in the PHP image, remove deprecated Rector skips and use stubs instead of mocks without expectations. 🤖 Generated with Claude Code --- CONTRIBUTING.md | 6 +++--- php.dockerfile | 2 +- rector.php | 5 ----- tests/Integration/Subscriptions/SubscriptionTest.php | 3 +-- tests/Unit/Subscriptions/Iterators/IteratorTestBase.php | 2 +- .../Unit/Subscriptions/Storage/CacheStorageManagerTest.php | 2 +- .../Unit/Subscriptions/Storage/RedisStorageManagerTest.php | 4 ++-- 7 files changed, 9 insertions(+), 15 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8ba92776be..4f552a5bf0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,10 +93,10 @@ If you cannot figure out how to fix it yourself, feel free to submit a PR with a Here is how to set up Xdebug in PhpStorm: https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html. -> Enabling Xdebug slows down tests by an order of magnitude. -> Stop listening for Debug Connection to speed it back up. +Xdebug is off by default because it slows down tests. +Enable it with `docker compose run --rm --env XDEBUG_MODE=debug php vendor/bin/phpunit`. -Set the environment variable `XDEBUG_REMOTE_HOST` to your host machine IP as seen from the Docker container. +Set the environment variable `XDEBUG_CONFIG="client_host="` to your host machine IP as seen from the Docker container. This may differ based on your setup. When running Docker for Desktop, it is usually `10.0.2.2`, when running from a VM it is something else. diff --git a/php.dockerfile b/php.dockerfile index 99b5b065b7..d12635aedc 100644 --- a/php.dockerfile +++ b/php.dockerfile @@ -23,7 +23,7 @@ RUN apt-get update && \ && docker-php-ext-enable \ xdebug \ redis \ - && echo 'memory_limit=-1' > /usr/local/etc/php/conf.d/lighthouse.ini + && printf 'memory_limit=-1\nxdebug.mode=off\n' > /usr/local/etc/php/conf.d/lighthouse.ini ARG USER ARG USER_ID diff --git a/rector.php b/rector.php index 820474a4c0..c144672eec 100644 --- a/rector.php +++ b/rector.php @@ -21,9 +21,7 @@ __DIR__ . '/tests/database/migrations', // Does not fit autoloader standards __DIR__ . '/tests/LaravelPhpdocAlignmentFixer.php', // Copied from Laravel __DIR__ . '/tests/Unit/Schema/Directives/MethodDirectiveTest.php', // System error: "Undefined array key 0" - Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector::class, // inefficient Rector\CodeQuality\Rector\Identical\FlipTypeControlToUseExclusiveTypeRector::class, // Unnecessarily complex with PHPStan - Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector::class, // if($truthy) is fine, readable and efficient Rector\CodeQuality\Rector\If_\ObjectExplicitBoolCompareRector::class, // if($truthy) is fine, readable and efficient Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector::class, // isset() is nice when moving towards typed properties Rector\CodingStyle\Rector\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector::class => [ @@ -33,11 +31,8 @@ Rector\CodeQuality\Rector\Catch_\ThrowWithPreviousExceptionRector::class => [ __DIR__ . '/src/Schema/Types/Scalars/DateScalar.php', // previous exception makes GraphQL\Error\Error not client-safe ], - Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector::class, // unreadable, slow, error prone Rector\PHPUnit\CodeQuality\Rector\Class_\NarrowUnusedSetUpDefinedPropertyRector::class, // falsely removes $this->schema assignments in some tests Rector\PHPUnit\CodeQuality\Rector\MethodCall\AssertEmptyNullableObjectToAssertInstanceofRector::class, // Makes assertions more brittle - Rector\PHPUnit\PHPUnit100\Rector\StmtsAwareInterface\WithConsecutiveRector::class, // messes up our custom withConsecutive replacement - Rector\PHPUnit\PHPUnit60\Rector\ClassMethod\AddDoesNotPerformAssertionToNonAssertingTestRector::class, // does not recognize mockResolver Rector\Php71\Rector\FuncCall\RemoveExtraParametersRector::class => [ __DIR__ . '/src/Testing/TestResponseMixin.php', // mixins are weird ], diff --git a/tests/Integration/Subscriptions/SubscriptionTest.php b/tests/Integration/Subscriptions/SubscriptionTest.php index 01f7170b0d..a6df4ce00c 100644 --- a/tests/Integration/Subscriptions/SubscriptionTest.php +++ b/tests/Integration/Subscriptions/SubscriptionTest.php @@ -30,8 +30,7 @@ protected function setUp(): void $this->setUpTestsSubscriptions(); - $this->mockResolverExpects($this->any()) - ->willReturnCallback(static fn (mixed $root, array $args): array => $args); + $this->registerMockResolver(static fn (mixed $root, array $args): array => $args, 'default'); $this->schema = /** @lang GraphQL */ <<<'GRAPHQL' type Post { diff --git a/tests/Unit/Subscriptions/Iterators/IteratorTestBase.php b/tests/Unit/Subscriptions/Iterators/IteratorTestBase.php index af2f4d6409..3bc8797daf 100644 --- a/tests/Unit/Subscriptions/Iterators/IteratorTestBase.php +++ b/tests/Unit/Subscriptions/Iterators/IteratorTestBase.php @@ -60,7 +60,7 @@ protected function subscribers(int $count): Collection private function generateSubscriber(): Subscriber { - $resolveInfo = $this->createMock(ResolveInfo::class); + $resolveInfo = $this->createStub(ResolveInfo::class); $resolveInfo->fieldName = 'foo'; $resolveInfo->operation = new OperationDefinitionNode([ 'name' => new NameNode([ diff --git a/tests/Unit/Subscriptions/Storage/CacheStorageManagerTest.php b/tests/Unit/Subscriptions/Storage/CacheStorageManagerTest.php index bd2561db2a..ee8c06f114 100644 --- a/tests/Unit/Subscriptions/Storage/CacheStorageManagerTest.php +++ b/tests/Unit/Subscriptions/Storage/CacheStorageManagerTest.php @@ -25,7 +25,7 @@ protected function setUp(): void /** Construct a dummy subscriber for testing. */ private function subscriber(string $queryString): Subscriber { - $subscriber = $this->createMock(Subscriber::class); + $subscriber = $this->createStub(Subscriber::class); $subscriber->channel = Subscriber::uniqueChannelName(); $subscriber->query = Parser::parse($queryString, ['noLocation' => true]); diff --git a/tests/Unit/Subscriptions/Storage/RedisStorageManagerTest.php b/tests/Unit/Subscriptions/Storage/RedisStorageManagerTest.php index 792f0598d1..dfd8950202 100644 --- a/tests/Unit/Subscriptions/Storage/RedisStorageManagerTest.php +++ b/tests/Unit/Subscriptions/Storage/RedisStorageManagerTest.php @@ -112,7 +112,7 @@ public function testDeleteSubscriber(): void public function testStoreSubscriber(): void { - $config = $this->createMock(ConfigRepository::class); + $config = $this->createStub(ConfigRepository::class); $redisConnection = $this->createMock(RedisConnection::class); $redisFactory = $this->mockRedisFactory($redisConnection); @@ -150,7 +150,7 @@ public function testStoreSubscriber(): void public function testStoreSubscriberWithoutTTL(): void { - $config = $this->createMock(ConfigRepository::class); + $config = $this->createStub(ConfigRepository::class); $redisConnection = $this->createMock(RedisConnection::class); $redisFactory = $this->mockRedisFactory($redisConnection); From 28e5b9e6d4ba6c7152529e5e9693009da7b833b0 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 10:57:03 +0100 Subject: [PATCH 02/29] Add parameter and return types to RoleFactory closures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- tests/database/factories/RoleFactory.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/database/factories/RoleFactory.php b/tests/database/factories/RoleFactory.php index c64c421b25..cee463ffc5 100644 --- a/tests/database/factories/RoleFactory.php +++ b/tests/database/factories/RoleFactory.php @@ -9,8 +9,8 @@ $factory->define(Role::class, static fn (Faker $faker): array => [ 'name' => "role_{$faker->unique()->randomNumber()}", 'bytes' => implode('', array_map( - fn ($b) => chr($b), // @phpstan-ignore-line will be 0-255 - Collection::times(16, fn () => $faker->numberBetween(0, 255))->all(), + fn (int $b): string => chr($b), // @phpstan-ignore-line will be 0-255 + Collection::times(16, fn (): int => $faker->numberBetween(0, 255))->all(), )), 'acl_id' => factory(ACL::class), ]); From 8f4effe42f3a762f4bf777cb7f33ab49f459f95d Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:02:55 +0100 Subject: [PATCH 03/29] Ignore only argument.type for chr in RoleFactory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- tests/database/factories/RoleFactory.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/database/factories/RoleFactory.php b/tests/database/factories/RoleFactory.php index cee463ffc5..9241ea1b10 100644 --- a/tests/database/factories/RoleFactory.php +++ b/tests/database/factories/RoleFactory.php @@ -9,7 +9,7 @@ $factory->define(Role::class, static fn (Faker $faker): array => [ 'name' => "role_{$faker->unique()->randomNumber()}", 'bytes' => implode('', array_map( - fn (int $b): string => chr($b), // @phpstan-ignore-line will be 0-255 + fn (int $b): string => chr($b), // @phpstan-ignore argument.type (will be 0-255) Collection::times(16, fn (): int => $faker->numberBetween(0, 255))->all(), )), 'acl_id' => factory(ACL::class), From d2c1052ad0d89acb6cc10714610f1b1b7db05773 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:02:55 +0100 Subject: [PATCH 04/29] Bump GitHub Actions and local PHP and Node images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update all actions to their latest majors, pass the Codecov token and move the prettier token to the github_token input. Run PHP 8.5 and Node 24 locally to match the newest CI versions. 🤖 Generated with Claude Code --- .github/workflows/format.yml | 16 +++++++--------- .github/workflows/generate-proto-code.yml | 4 ++-- .github/workflows/update-reports-proto.yml | 4 ++-- .github/workflows/validate.yml | 20 +++++++++++--------- node.dockerfile | 2 +- php.dockerfile | 2 +- 6 files changed, 24 insertions(+), 24 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index ed2fe27ddd..56ff7c9ea0 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -8,7 +8,7 @@ jobs: composer-normalize: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: ref: ${{ github.head_ref }} @@ -22,30 +22,28 @@ jobs: - run: composer normalize - - uses: stefanzweifel/git-auto-commit-action@v4 + - uses: stefanzweifel/git-auto-commit-action@v7 with: commit_message: Normalize composer.json prettier: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: ref: ${{ github.head_ref }} - - uses: creyD/prettier_action@v2.2 + - uses: creyD/prettier_action@v4 with: prettier_version: 2.8.8 prettier_options: --write --tab-width=2 docs/**/**/*.md docs/**/*.js - branch: ${{ github.head_ref }} commit_message: Prettify docs - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} php-cs-fixer: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: ref: ${{ github.head_ref }} @@ -61,6 +59,6 @@ jobs: - run: git pull - - uses: stefanzweifel/git-auto-commit-action@v4 + - uses: stefanzweifel/git-auto-commit-action@v7 with: commit_message: Apply php-cs-fixer changes diff --git a/.github/workflows/generate-proto-code.yml b/.github/workflows/generate-proto-code.yml index 9db1f573f1..3a4626a4d4 100644 --- a/.github/workflows/generate-proto-code.yml +++ b/.github/workflows/generate-proto-code.yml @@ -11,7 +11,7 @@ jobs: generate-proto-code: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: ref: ${{ github.head_ref }} @@ -27,6 +27,6 @@ jobs: - run: git pull - - uses: stefanzweifel/git-auto-commit-action@v5 + - uses: stefanzweifel/git-auto-commit-action@v7 with: commit_message: Apply proto changes diff --git a/.github/workflows/update-reports-proto.yml b/.github/workflows/update-reports-proto.yml index 504c3b9263..a3e6b7dfbc 100644 --- a/.github/workflows/update-reports-proto.yml +++ b/.github/workflows/update-reports-proto.yml @@ -8,7 +8,7 @@ jobs: update-reports-proto: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 with: ref: ${{ github.head_ref }} @@ -20,7 +20,7 @@ jobs: sed -i '3 i option php_namespace = "Nuwave\\\\Lighthouse\\\\Tracing\\\\FederatedTracing\\\\Proto";' src/Tracing/FederatedTracing/reports.proto sed -i '4 i option php_metadata_namespace = "Nuwave\\\\Lighthouse\\\\Tracing\\\\FederatedTracing\\\\Proto\\\\Metadata";' src/Tracing/FederatedTracing/reports.proto - - uses: peter-evans/create-pull-request@v5 + - uses: peter-evans/create-pull-request@v8 with: title: Update `reports.proto` commit-message: Update `reports.proto` diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 71cc73168e..65bcd7084d 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -59,7 +59,7 @@ jobs: laravel-version: "^13" steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: shivammathur/setup-php@v2 with: @@ -68,7 +68,7 @@ jobs: extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }} - name: "Cache composer dependencies" - uses: actions/cache@v3 + uses: actions/cache@v6 with: path: ~/.composer/cache key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}-os-${{ matrix.os }}-composer-${{ matrix.composer.name }} @@ -152,7 +152,7 @@ jobs: options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: shivammathur/setup-php@v2 with: @@ -162,7 +162,7 @@ jobs: ini-values: zend.assertions=1 - name: "Cache composer dependencies" - uses: actions/cache@v3 + uses: actions/cache@v6 with: path: ~/.composer/cache key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}-os-${{ matrix.os }}-composer-${{ matrix.composer.name }} @@ -209,7 +209,7 @@ jobs: options: --health-cmd="redis-cli ping" --health-interval=10s --health-timeout=5s --health-retries=3 steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: shivammathur/setup-php@v2 with: @@ -219,7 +219,7 @@ jobs: ini-values: zend.assertions=1 - name: "Cache composer dependencies" - uses: actions/cache@v3 + uses: actions/cache@v6 with: path: ~/.composer/cache key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }} @@ -231,7 +231,9 @@ jobs: - run: vendor/bin/phpunit --coverage-clover=coverage.xml - name: "Upload to Codecov" - uses: codecov/codecov-action@v2 + uses: codecov/codecov-action@v7 + with: + token: ${{ secrets.CODECOV_TOKEN }} benchmarks: runs-on: ubuntu-latest @@ -242,7 +244,7 @@ jobs: laravel-version: ["^13"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v7 - uses: shivammathur/setup-php@v2 with: @@ -251,7 +253,7 @@ jobs: extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }} - name: "Cache composer dependencies" - uses: actions/cache@v3 + uses: actions/cache@v6 with: path: ~/.composer/cache key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }} diff --git a/node.dockerfile b/node.dockerfile index cf86cca488..3c4652e144 100644 --- a/node.dockerfile +++ b/node.dockerfile @@ -1,4 +1,4 @@ -FROM node:22-slim +FROM node:24-slim ARG USER_ID ARG GROUP_ID diff --git a/php.dockerfile b/php.dockerfile index d12635aedc..115564f790 100644 --- a/php.dockerfile +++ b/php.dockerfile @@ -1,4 +1,4 @@ -FROM php:8.3-cli +FROM php:8.5-cli WORKDIR /workdir From 319a50c222840c6d3ef523f305b3e396c5674c9d Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:05:55 +0100 Subject: [PATCH 05/29] Pin prettier_action to v4.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The action publishes no floating v4 tag. 🤖 Generated with Claude Code --- .github/workflows/format.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 56ff7c9ea0..6276c02cda 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -33,7 +33,7 @@ jobs: with: ref: ${{ github.head_ref }} - - uses: creyD/prettier_action@v4 + - uses: creyD/prettier_action@v4.6 with: prettier_version: 2.8.8 prettier_options: --write --tab-width=2 docs/**/**/*.md docs/**/*.js From 5b540182f4937761080d3fedd115e669f6237642 Mon Sep 17 00:00:00 2001 From: spawnia Date: Sun, 25 Oct 2026 10:07:08 +0000 Subject: [PATCH 06/29] Prettify docs --- docs/2/api-reference/directives.md | 2 +- docs/3/api-reference/directives.md | 2 +- docs/4/api-reference/directives.md | 2 +- docs/5/api-reference/directives.md | 2 +- docs/6/api-reference/directives.md | 2 +- docs/master/api-reference/directives.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/2/api-reference/directives.md b/docs/2/api-reference/directives.md index d378d01e9a..4ae527a5a2 100644 --- a/docs/2/api-reference/directives.md +++ b/docs/2/api-reference/directives.md @@ -841,7 +841,7 @@ type Employee { } union Person @union(resolver: "App\\GraphQL\\UnionResolver@person") = - User + | User | Employee ``` diff --git a/docs/3/api-reference/directives.md b/docs/3/api-reference/directives.md index 5bde85af7d..5ae7c2aef3 100644 --- a/docs/3/api-reference/directives.md +++ b/docs/3/api-reference/directives.md @@ -1912,7 +1912,7 @@ type Employee { } union Person @union(resolveType: "App\\GraphQL\\Unions\\Person@resolveType") = - User + | User | Employee ``` diff --git a/docs/4/api-reference/directives.md b/docs/4/api-reference/directives.md index e0777370fd..ef474bb116 100644 --- a/docs/4/api-reference/directives.md +++ b/docs/4/api-reference/directives.md @@ -2586,7 +2586,7 @@ type Employee { } union Person @union(resolveType: "App\\GraphQL\\Unions\\Person@resolveType") = - User + | User | Employee ``` diff --git a/docs/5/api-reference/directives.md b/docs/5/api-reference/directives.md index 725331d2a1..c0b525b051 100644 --- a/docs/5/api-reference/directives.md +++ b/docs/5/api-reference/directives.md @@ -3342,7 +3342,7 @@ type Employee { } union Person @union(resolveType: "App\\GraphQL\\Unions\\Person@resolveType") = - User + | User | Employee ``` diff --git a/docs/6/api-reference/directives.md b/docs/6/api-reference/directives.md index 325176b945..ca9b6aed94 100644 --- a/docs/6/api-reference/directives.md +++ b/docs/6/api-reference/directives.md @@ -3841,7 +3841,7 @@ type Employee { } union Person @union(resolveType: "App\\GraphQL\\Unions\\Person@resolveType") = - User + | User | Employee ``` diff --git a/docs/master/api-reference/directives.md b/docs/master/api-reference/directives.md index 325176b945..ca9b6aed94 100644 --- a/docs/master/api-reference/directives.md +++ b/docs/master/api-reference/directives.md @@ -3841,7 +3841,7 @@ type Employee { } union Person @union(resolveType: "App\\GraphQL\\Unions\\Person@resolveType") = - User + | User | Employee ``` From 2928d73e6c57f155beb76571acdfc83729a789bc Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:13:03 +0100 Subject: [PATCH 07/29] Keep Rector and prettier caches between runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rector cached into the temporary directory of the removed container. 🤖 Generated with Claude Code --- .gitignore | 1 + docs/package.json | 2 +- rector.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 966235547a..add8e9ea45 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ docs/superpowers .php-cs-fixer.cache build phpstan-tmp-dir +rector-tmp-dir proto-tmp # composer diff --git a/docs/package.json b/docs/package.json index a2adf9308d..bfc108ed83 100644 --- a/docs/package.json +++ b/docs/package.json @@ -13,6 +13,6 @@ "scripts": { "start": "vuepress dev .", "build": "vuepress build .", - "prettify": "prettier --write --tab-width=2 --list-different **/**/*.md **/*.js .vuepress/*.js" + "prettify": "prettier --cache --write --tab-width=2 --list-different **/**/*.md **/*.js .vuepress/*.js" } } diff --git a/rector.php b/rector.php index c144672eec..ba664fdd4a 100644 --- a/rector.php +++ b/rector.php @@ -46,6 +46,7 @@ __DIR__ . '/_ide_helper.php', __DIR__ . '/rector.php', ]); + $rectorConfig->cacheDirectory(__DIR__ . '/rector-tmp-dir'); $rectorConfig->bootstrapFiles([ // Rector uses PHPStan internally, which in turn requires Larastan to be set up correctly __DIR__ . '/vendor/larastan/larastan/bootstrap.php', From 3f7b3c811b4782a89fff82ede5693793dff8336e Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:13:58 +0100 Subject: [PATCH 08/29] Revert "Prettify docs" This reverts commit 5b540182f4937761080d3fedd115e669f6237642. --- docs/2/api-reference/directives.md | 2 +- docs/3/api-reference/directives.md | 2 +- docs/4/api-reference/directives.md | 2 +- docs/5/api-reference/directives.md | 2 +- docs/6/api-reference/directives.md | 2 +- docs/master/api-reference/directives.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/2/api-reference/directives.md b/docs/2/api-reference/directives.md index 4ae527a5a2..d378d01e9a 100644 --- a/docs/2/api-reference/directives.md +++ b/docs/2/api-reference/directives.md @@ -841,7 +841,7 @@ type Employee { } union Person @union(resolver: "App\\GraphQL\\UnionResolver@person") = - | User + User | Employee ``` diff --git a/docs/3/api-reference/directives.md b/docs/3/api-reference/directives.md index 5ae7c2aef3..5bde85af7d 100644 --- a/docs/3/api-reference/directives.md +++ b/docs/3/api-reference/directives.md @@ -1912,7 +1912,7 @@ type Employee { } union Person @union(resolveType: "App\\GraphQL\\Unions\\Person@resolveType") = - | User + User | Employee ``` diff --git a/docs/4/api-reference/directives.md b/docs/4/api-reference/directives.md index ef474bb116..e0777370fd 100644 --- a/docs/4/api-reference/directives.md +++ b/docs/4/api-reference/directives.md @@ -2586,7 +2586,7 @@ type Employee { } union Person @union(resolveType: "App\\GraphQL\\Unions\\Person@resolveType") = - | User + User | Employee ``` diff --git a/docs/5/api-reference/directives.md b/docs/5/api-reference/directives.md index c0b525b051..725331d2a1 100644 --- a/docs/5/api-reference/directives.md +++ b/docs/5/api-reference/directives.md @@ -3342,7 +3342,7 @@ type Employee { } union Person @union(resolveType: "App\\GraphQL\\Unions\\Person@resolveType") = - | User + User | Employee ``` diff --git a/docs/6/api-reference/directives.md b/docs/6/api-reference/directives.md index ca9b6aed94..325176b945 100644 --- a/docs/6/api-reference/directives.md +++ b/docs/6/api-reference/directives.md @@ -3841,7 +3841,7 @@ type Employee { } union Person @union(resolveType: "App\\GraphQL\\Unions\\Person@resolveType") = - | User + User | Employee ``` diff --git a/docs/master/api-reference/directives.md b/docs/master/api-reference/directives.md index ca9b6aed94..325176b945 100644 --- a/docs/master/api-reference/directives.md +++ b/docs/master/api-reference/directives.md @@ -3841,7 +3841,7 @@ type Employee { } union Person @union(resolveType: "App\\GraphQL\\Unions\\Person@resolveType") = - | User + User | Employee ``` From 3cad96e13e80b2154ba0f5d5e88c5da89afcb1d0 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:13:58 +0100 Subject: [PATCH 09/29] Run prettier from docs/package.json in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit prettier_action v4 ignores prettier_version and formats with prettier 3, which conflicts with the local prettier 2.8.8. 🤖 Generated with Claude Code --- .github/workflows/format.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 6276c02cda..f3cd809e0c 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -33,12 +33,21 @@ jobs: with: ref: ${{ github.head_ref }} - - uses: creyD/prettier_action@v4.6 + - uses: actions/setup-node@v7 + with: + node-version: 24 + cache: yarn + cache-dependency-path: docs/yarn.lock + + - run: yarn install --frozen-lockfile + working-directory: docs + + - run: yarn run prettify + working-directory: docs + + - uses: stefanzweifel/git-auto-commit-action@v7 with: - prettier_version: 2.8.8 - prettier_options: --write --tab-width=2 docs/**/**/*.md docs/**/*.js commit_message: Prettify docs - github_token: ${{ secrets.GITHUB_TOKEN }} php-cs-fixer: runs-on: ubuntu-latest From 8e17205836194239d6679a6f5350756bc6804c4e Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:18:02 +0100 Subject: [PATCH 10/29] Skip gitignored paths in php-cs-fixer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It scanned the PHP files of the new Rector cache in rector-tmp-dir. 🤖 Generated with Claude Code --- .php-cs-fixer.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 300b8044d9..dc7630772d 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -4,10 +4,9 @@ ->in(__DIR__) ->name('*.php') ->notPath('src/Tracing/FederatedTracing/Proto') - ->notPath('vendor') - ->notPath('phpstan-tmp-dir') ->ignoreDotFiles(false) - ->ignoreVCS(true); + ->ignoreVCS(true) + ->ignoreVCSIgnored(true); return MLL\PhpCsFixerConfig\risky($finder, [ 'general_phpdoc_annotation_remove' => [ From 96b0f22f04899f1a2a0e84cd86575495e843946a Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:19:22 +0100 Subject: [PATCH 11/29] Remove unused dev dependencies predis and algolia MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests connect to Redis through the phpredis extension and set the Scout driver to null. 🤖 Generated with Claude Code --- composer.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/composer.json b/composer.json index 2ac87e269c..f99b2fe6ed 100644 --- a/composer.json +++ b/composer.json @@ -44,7 +44,6 @@ }, "require-dev": { "composer-runtime-api": "^2", - "algolia/algoliasearch-client-php": "^3", "bensampo/laravel-enum": "^5 || ^6", "ergebnis/composer-normalize": "^2.2.2", "fakerphp/faker": "^1.21", @@ -66,7 +65,6 @@ "phpstan/phpstan-mockery": "^1.1.3 || ^2", "phpstan/phpstan-phpunit": "^1.1.1 || ^2", "phpunit/phpunit": "^9.6.4 || ^10 || ^11 || ^12", - "predis/predis": "^1.1 || ^2.1", "pusher/pusher-php-server": "^5 || ^6 || ^7.0.2", "rector/rector": "^1.2.10 || ^2.5.7", "thecodingmachine/phpstan-safe-rule": "^1.2" From 59463c58d041092b9fc1df5d3ed91ef19659da32 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:19:39 +0100 Subject: [PATCH 12/29] Remove duplicate PHPStan excludePaths entry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- phpstan.neon | 1 - 1 file changed, 1 deletion(-) diff --git a/phpstan.neon b/phpstan.neon index c58493c437..b389cbd55e 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -27,7 +27,6 @@ parameters: - tests/Unit/Testing/TestingTraitDummyLumen.php # Native enums - tests/Utils/Enums/ImageableType.php - - tests/Utils/Enums/ImageableType.php ignoreErrors: # PHPUnit 10+ attributes don't exist in PHPUnit 9.x - path: tests From 482a3031e0108ceec374c572765a6f2c29bde373 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:19:39 +0100 Subject: [PATCH 13/29] Remove permission for nonexistent make target up MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- .ai/settings.json | 1 - 1 file changed, 1 deletion(-) diff --git a/.ai/settings.json b/.ai/settings.json index 50d82ae482..ad81103b29 100644 --- a/.ai/settings.json +++ b/.ai/settings.json @@ -8,7 +8,6 @@ "Bash(docker compose up:*)", "Bash(make setup)", "Bash(make it)", - "Bash(make up)", "Bash(make build)", "Bash(make test)", "Bash(make stan)", From 311299a69fda32e19b575d6f96c5374a744b6796 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:19:39 +0100 Subject: [PATCH 14/29] Remove composer --no-suggest, a no-op since Composer 2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- .github/workflows/format.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index f3cd809e0c..73cb897a5e 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -18,7 +18,7 @@ jobs: coverage: none extensions: mbstring - - run: composer install --no-interaction --no-progress --no-suggest + - run: composer install --no-interaction --no-progress - run: composer normalize @@ -62,7 +62,7 @@ jobs: coverage: none extensions: mbstring - - run: composer install --no-interaction --no-progress --no-suggest + - run: composer install --no-interaction --no-progress - run: vendor/bin/php-cs-fixer fix From 410d921aba75483b7593c2951ccd6f9f8f24b343 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:19:39 +0100 Subject: [PATCH 15/29] Remove checkout ref github.head_ref from workflows without pull_request MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GitHub sets head_ref only for pull_request events, so it was always empty. 🤖 Generated with Claude Code --- .github/workflows/format.yml | 6 ------ .github/workflows/generate-proto-code.yml | 2 -- .github/workflows/update-reports-proto.yml | 2 -- 3 files changed, 10 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 73cb897a5e..d57c05bcbb 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -9,8 +9,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - with: - ref: ${{ github.head_ref }} - uses: shivammathur/setup-php@v2 with: @@ -30,8 +28,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - with: - ref: ${{ github.head_ref }} - uses: actions/setup-node@v7 with: @@ -53,8 +49,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - with: - ref: ${{ github.head_ref }} - uses: shivammathur/setup-php@v2 with: diff --git a/.github/workflows/generate-proto-code.yml b/.github/workflows/generate-proto-code.yml index 3a4626a4d4..7d6a558487 100644 --- a/.github/workflows/generate-proto-code.yml +++ b/.github/workflows/generate-proto-code.yml @@ -12,8 +12,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - with: - ref: ${{ github.head_ref }} - uses: bufbuild/buf-action@v1 with: diff --git a/.github/workflows/update-reports-proto.yml b/.github/workflows/update-reports-proto.yml index a3e6b7dfbc..0443994420 100644 --- a/.github/workflows/update-reports-proto.yml +++ b/.github/workflows/update-reports-proto.yml @@ -9,8 +9,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - with: - ref: ${{ github.head_ref }} - run: curl -sSfo src/Tracing/FederatedTracing/reports.proto https://usage-reporting.api.apollographql.com/proto/reports.proto From 2cc553fdc0a0d692d039b3747dba8bf10181daac Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:19:39 +0100 Subject: [PATCH 16/29] Remove unused env and single-value os matrix from validate workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tests read LIGHTHOUSE_TEST_DB_USERNAME, not LIGHTHOUSE_TEST_DB_USER. 🤖 Generated with Claude Code --- .github/workflows/validate.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 65bcd7084d..46f4b1249e 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -7,7 +7,6 @@ on: env: REQUIRED_PHP_EXTENSIONS: mbstring, mysqli, pdo_mysql, redis - LIGHTHOUSE_TEST_DB_USER: root LIGHTHOUSE_TEST_DB_PASSWORD: root LIGHTHOUSE_TEST_DB_HOST: 127.0.0.1 LIGHTHOUSE_TEST_REDIS_HOST: 127.0.0.1 @@ -71,7 +70,7 @@ jobs: uses: actions/cache@v6 with: path: ~/.composer/cache - key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}-os-${{ matrix.os }}-composer-${{ matrix.composer.name }} + key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}-composer-${{ matrix.composer.name }} - name: "Remove conflicting dependencies that are not needed here" run: composer remove --dev --no-update phpbench/phpbench rector/rector @@ -93,7 +92,7 @@ jobs: tests: name: PHPUnit on PHP ${{ matrix.php-version }} with Laravel ${{ matrix.laravel-version }} and ${{ matrix.composer.name }} dependencies - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest strategy: fail-fast: false @@ -111,8 +110,6 @@ jobs: - "^11" - "^12" - "^13" - os: - - ubuntu-latest composer: - name: lowest arg: "--prefer-lowest --prefer-stable" @@ -165,7 +162,7 @@ jobs: uses: actions/cache@v6 with: path: ~/.composer/cache - key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}-os-${{ matrix.os }}-composer-${{ matrix.composer.name }} + key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }}-composer-${{ matrix.composer.name }} - name: "Remove conflicting dependencies that are not needed here" run: composer remove --dev --no-update phpstan/phpstan-mockery phpbench/phpbench From 0b54ca1079a85a553556bcea954a0d507800de93 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:19:39 +0100 Subject: [PATCH 17/29] Stop installing the unused mysqli extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Laravel connects to MySQL through pdo_mysql. 🤖 Generated with Claude Code --- .github/workflows/validate.yml | 2 +- php.dockerfile | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 46f4b1249e..ff96dd4d0b 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -6,7 +6,7 @@ on: - master env: - REQUIRED_PHP_EXTENSIONS: mbstring, mysqli, pdo_mysql, redis + REQUIRED_PHP_EXTENSIONS: mbstring, pdo_mysql, redis LIGHTHOUSE_TEST_DB_PASSWORD: root LIGHTHOUSE_TEST_DB_HOST: 127.0.0.1 LIGHTHOUSE_TEST_REDIS_HOST: 127.0.0.1 diff --git a/php.dockerfile b/php.dockerfile index 115564f790..307398ccfb 100644 --- a/php.dockerfile +++ b/php.dockerfile @@ -12,7 +12,6 @@ RUN apt-get update && \ libicu-dev \ && docker-php-ext-install \ zip \ - mysqli \ pdo_mysql \ intl \ bcmath \ From dcc53a16d5818f58ddaa61a7653c19183c15397a Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:19:39 +0100 Subject: [PATCH 18/29] Stop ignoring build, which no tool writes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index add8e9ea45..3e6f191275 100644 --- a/.gitignore +++ b/.gitignore @@ -12,7 +12,6 @@ docs/superpowers # Generated files .phpunit.result.cache .php-cs-fixer.cache -build phpstan-tmp-dir rector-tmp-dir proto-tmp From 14ffdd0507d2c36882e07478b012835ea07dba81 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:19:49 +0100 Subject: [PATCH 19/29] Remove commented-out PHPStan option and self-evident matrix comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- .github/workflows/validate.yml | 4 ++-- phpstan.neon | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index ff96dd4d0b..eb67307579 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -38,7 +38,7 @@ jobs: - name: lowest arg: "--prefer-lowest --prefer-stable" - name: highest - arg: "" # No args added as highest is default + arg: "" exclude: - php-version: "8.0" laravel-version: "^10" @@ -114,7 +114,7 @@ jobs: - name: lowest arg: "--prefer-lowest --prefer-stable" - name: highest - arg: "" # No args added as highest is default + arg: "" exclude: - php-version: "8.0" laravel-version: "^10" diff --git a/phpstan.neon b/phpstan.neon index b389cbd55e..687017e66b 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,8 +6,6 @@ parameters: - benchmarks - src - tests - # Does not work with rector, comment in to diagnose potential issues with Octane - #checkOctaneCompatibility: true reportUnmatchedIgnoredErrors: false # As long as we support multiple Laravel versions at once, there will be some dead spots # Install https://plugins.jetbrains.com/plugin/7677-awesome-console to make those links clickable editorUrl: '%%relFile%%:%%line%%' From ad0545191a98e1d92a916743aaeae19731f3209c Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:25:44 +0100 Subject: [PATCH 20/29] Export-ignore remaining dev-only files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- .gitattributes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.gitattributes b/.gitattributes index 42c9ffc9a1..e485735e91 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ * text=auto +/.ai export-ignore /.github export-ignore /benchmarks export-ignore /docs export-ignore @@ -9,6 +10,8 @@ /.gitattributes export-ignore /.gitignore export-ignore /.php-cs-fixer.php export-ignore +/.worktreeinclude export-ignore +/buf.gen.yaml export-ignore /CHANGELOG.md export-ignore /CONTRIBUTING.md export-ignore /docker-compose.yml export-ignore @@ -18,7 +21,9 @@ /node.dockerfile export-ignore /php.dockerfile export-ignore /phpbench.json export-ignore +/phpstan-bootstrap.php export-ignore /phpstan.neon export-ignore /phpunit.xml.dist export-ignore /rector.php export-ignore +/SECURITY.md export-ignore /UPGRADE.md export-ignore From 003b25f2051c2c4f4f223147ca15bad19726b597 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:25:56 +0100 Subject: [PATCH 21/29] Inline single-value matrices in coverage and benchmarks jobs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- .github/workflows/validate.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index eb67307579..84b97663f2 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -185,11 +185,6 @@ jobs: coverage: runs-on: ubuntu-latest - strategy: - matrix: - php-version: ["8.5"] - laravel-version: ["^13"] - services: mysql: image: mysql:5.7 @@ -210,7 +205,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php-version }} + php-version: "8.5" coverage: pcov extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }} ini-values: zend.assertions=1 @@ -219,11 +214,11 @@ jobs: uses: actions/cache@v6 with: path: ~/.composer/cache - key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }} + key: php-8.5-composer-^13 - run: composer remove --dev phpbench/phpbench --no-update - - run: composer require laravel/framework:${{ matrix.laravel-version }} --no-interaction --prefer-dist --no-progress + - run: composer require laravel/framework:^13 --no-interaction --prefer-dist --no-progress - run: vendor/bin/phpunit --coverage-clover=coverage.xml @@ -235,17 +230,12 @@ jobs: benchmarks: runs-on: ubuntu-latest - strategy: - matrix: - php-version: ["8.5"] - laravel-version: ["^13"] - steps: - uses: actions/checkout@v7 - uses: shivammathur/setup-php@v2 with: - php-version: ${{ matrix.php-version }} + php-version: "8.5" coverage: none extensions: ${{ env.REQUIRED_PHP_EXTENSIONS }} @@ -253,8 +243,8 @@ jobs: uses: actions/cache@v6 with: path: ~/.composer/cache - key: php-${{ matrix.php-version }}-composer-${{ matrix.laravel-version }} + key: php-8.5-composer-^13 - - run: composer require laravel/framework:${{ matrix.laravel-version }} --no-interaction --prefer-dist --no-progress + - run: composer require laravel/framework:^13 --no-interaction --prefer-dist --no-progress - run: vendor/bin/phpbench run --progress=none --report=aggregate From 70208274bf4dcf33cd0cb57a32eb0547760e3777 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:25:56 +0100 Subject: [PATCH 22/29] Format with PHP 8.5 to match CI and php.dockerfile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- .github/workflows/format.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index d57c05bcbb..2e6555b6c6 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -12,7 +12,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.5 coverage: none extensions: mbstring @@ -52,7 +52,7 @@ jobs: - uses: shivammathur/setup-php@v2 with: - php-version: 8.3 + php-version: 8.5 coverage: none extensions: mbstring From 57a9c86e69a19605065754f14b031be39a44cf5a Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:26:13 +0100 Subject: [PATCH 23/29] Share one node image between node-docs and node-tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- docker-compose.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 56e1334e9f..9638b60c24 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,6 +29,7 @@ services: image: redis:6 node-docs: + image: lighthouse-node build: context: . dockerfile: node.dockerfile @@ -43,9 +44,7 @@ services: - 8081:8080 node-tools: - build: - context: . - dockerfile: node.dockerfile + image: lighthouse-node volumes: - ./:/workdir working_dir: /workdir From 611bf746e1719ffb7bb64a44ce0333cdc7408c7c Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:31:16 +0100 Subject: [PATCH 24/29] Report unmatched PHPStan ignore patterns MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- phpstan.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan.neon b/phpstan.neon index 687017e66b..46245aefce 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,7 +6,7 @@ parameters: - benchmarks - src - tests - reportUnmatchedIgnoredErrors: false # As long as we support multiple Laravel versions at once, there will be some dead spots + reportUnmatchedIgnoredErrors: true # Install https://plugins.jetbrains.com/plugin/7677-awesome-console to make those links clickable editorUrl: '%%relFile%%:%%line%%' editorUrlTitle: '%%relFile%%:%%line%%' From ec02b47cdee4efa8c6bffd3daf76a5909a1860b4 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:42:39 +0100 Subject: [PATCH 25/29] Share proto update and install steps between Makefile and workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- .gitattributes | 1 + .github/workflows/generate-proto-code.yml | 8 +++----- .github/workflows/update-reports-proto.yml | 8 +------- Makefile | 10 ++-------- bin/install-generated-proto.sh | 8 ++++++++ bin/update-reports-proto.sh | 12 ++++++++++++ 6 files changed, 27 insertions(+), 20 deletions(-) create mode 100755 bin/install-generated-proto.sh create mode 100755 bin/update-reports-proto.sh diff --git a/.gitattributes b/.gitattributes index e485735e91..f81a72d581 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2,6 +2,7 @@ /.ai export-ignore /.github export-ignore +/bin export-ignore /benchmarks export-ignore /docs export-ignore /tests export-ignore diff --git a/.github/workflows/generate-proto-code.yml b/.github/workflows/generate-proto-code.yml index 7d6a558487..d9d3de36d6 100644 --- a/.github/workflows/generate-proto-code.yml +++ b/.github/workflows/generate-proto-code.yml @@ -17,11 +17,9 @@ jobs: with: setup_only: true - - run: | - buf generate - rm -rf src/Tracing/FederatedTracing/Proto - mv proto-tmp/Nuwave/Lighthouse/Tracing/FederatedTracing/Proto src/Tracing/FederatedTracing/Proto - rm -rf proto-tmp + - run: buf generate + + - run: bin/install-generated-proto.sh - run: git pull diff --git a/.github/workflows/update-reports-proto.yml b/.github/workflows/update-reports-proto.yml index 0443994420..e43b0a41ba 100644 --- a/.github/workflows/update-reports-proto.yml +++ b/.github/workflows/update-reports-proto.yml @@ -10,13 +10,7 @@ jobs: steps: - uses: actions/checkout@v7 - - run: curl -sSfo src/Tracing/FederatedTracing/reports.proto https://usage-reporting.api.apollographql.com/proto/reports.proto - - - run: | - sed -i 's/ \[(js_use_toArray) = true]//g' src/Tracing/FederatedTracing/reports.proto - sed -i 's/ \[(js_preEncoded) = true]//g' src/Tracing/FederatedTracing/reports.proto - sed -i '3 i option php_namespace = "Nuwave\\\\Lighthouse\\\\Tracing\\\\FederatedTracing\\\\Proto";' src/Tracing/FederatedTracing/reports.proto - sed -i '4 i option php_metadata_namespace = "Nuwave\\\\Lighthouse\\\\Tracing\\\\FederatedTracing\\\\Proto\\\\Metadata";' src/Tracing/FederatedTracing/reports.proto + - run: bin/update-reports-proto.sh - uses: peter-evans/create-pull-request@v8 with: diff --git a/Makefile b/Makefile index ed29ef6e8a..e435ceee97 100644 --- a/Makefile +++ b/Makefile @@ -71,17 +71,11 @@ ai-sync: ## Generate local agent configuration from .ai .PHONY: proto/update-reports proto/update-reports: - docker compose run --rm --no-deps php curl --silent --show-error --fail --output src/Tracing/FederatedTracing/reports.proto https://usage-reporting.api.apollographql.com/proto/reports.proto - docker compose run --rm --no-deps php sed --in-place 's/ \[(js_use_toArray) = true]//g' src/Tracing/FederatedTracing/reports.proto - docker compose run --rm --no-deps php sed --in-place 's/ \[(js_preEncoded) = true]//g' src/Tracing/FederatedTracing/reports.proto - docker compose run --rm --no-deps php sed --in-place '3 i option php_namespace = "Nuwave\\\\Lighthouse\\\\Tracing\\\\FederatedTracing\\\\Proto";' src/Tracing/FederatedTracing/reports.proto - docker compose run --rm --no-deps php sed --in-place '4 i option php_metadata_namespace = "Nuwave\\\\Lighthouse\\\\Tracing\\\\FederatedTracing\\\\Proto\\\\Metadata";' src/Tracing/FederatedTracing/reports.proto + docker compose run --rm --no-deps php bin/update-reports-proto.sh .PHONY: proto proto: docker run --rm --volume=.:/workdir --workdir=/workdir --pull=always bufbuild/buf generate - rm -rf src/Tracing/FederatedTracing/Proto # Using short options of `id` to ensure compatibility with macOS, see https://github.com/nuwave/lighthouse/pull/2504 sudo chown --recursive "$(shell id -u):$(shell id -g)" proto-tmp - mv proto-tmp/Nuwave/Lighthouse/Tracing/FederatedTracing/Proto src/Tracing/FederatedTracing/Proto - rm -rf proto-tmp + bin/install-generated-proto.sh diff --git a/bin/install-generated-proto.sh b/bin/install-generated-proto.sh new file mode 100755 index 0000000000..d36d0521e6 --- /dev/null +++ b/bin/install-generated-proto.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname "$0")/.." + +rm -rf src/Tracing/FederatedTracing/Proto +mv proto-tmp/Nuwave/Lighthouse/Tracing/FederatedTracing/Proto src/Tracing/FederatedTracing/Proto +rm -rf proto-tmp diff --git a/bin/update-reports-proto.sh b/bin/update-reports-proto.sh new file mode 100755 index 0000000000..adffa443e6 --- /dev/null +++ b/bin/update-reports-proto.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail + +cd "$(dirname "$0")/.." + +proto=src/Tracing/FederatedTracing/reports.proto + +curl --silent --show-error --fail --output "$proto" https://usage-reporting.api.apollographql.com/proto/reports.proto +sed -i 's/ \[(js_use_toArray) = true]//g' "$proto" +sed -i 's/ \[(js_preEncoded) = true]//g' "$proto" +sed -i '3 i option php_namespace = "Nuwave\\\\Lighthouse\\\\Tracing\\\\FederatedTracing\\\\Proto";' "$proto" +sed -i '4 i option php_metadata_namespace = "Nuwave\\\\Lighthouse\\\\Tracing\\\\FederatedTracing\\\\Proto\\\\Metadata";' "$proto" From 00440a3c6be19cba00e40a8ac3d63db617fde6f7 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:42:52 +0100 Subject: [PATCH 26/29] Define the shared job matrix once in validate workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- .github/workflows/validate.yml | 39 ++-------------------------------- 1 file changed, 2 insertions(+), 37 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 84b97663f2..7ef0171020 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false - matrix: + matrix: &matrix php-version: - "8.0" - "8.1" @@ -96,42 +96,7 @@ jobs: strategy: fail-fast: false - matrix: - php-version: - - "8.0" - - "8.1" - - "8.2" - - "8.3" - - "8.4" - - "8.5" - laravel-version: - - "^9" - - "^10" - - "^11" - - "^12" - - "^13" - composer: - - name: lowest - arg: "--prefer-lowest --prefer-stable" - - name: highest - arg: "" - exclude: - - php-version: "8.0" - laravel-version: "^10" - - php-version: "8.0" - laravel-version: "^11" - - php-version: "8.1" - laravel-version: "^11" - - php-version: "8.0" - laravel-version: "^12" - - php-version: "8.1" - laravel-version: "^12" - - php-version: "8.0" - laravel-version: "^13" - - php-version: "8.1" - laravel-version: "^13" - - php-version: "8.2" - laravel-version: "^13" + matrix: *matrix services: mysql: From f0e0889b6e14b0075f3cee28499ebc822edcc060 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:42:52 +0100 Subject: [PATCH 27/29] Link the PHPStan level TODO to its tracking issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with Claude Code --- phpstan.neon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpstan.neon b/phpstan.neon index 46245aefce..91c6af9930 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,5 @@ parameters: - level: 8 # TODO level up to max + level: 8 # TODO raise to max with https://github.com/nuwave/lighthouse/issues/2811 bootstrapFiles: - phpstan-bootstrap.php paths: From 9b5b37a8d05675b4b287cae54bcc7af8d0c7bb46 Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 11:57:14 +0100 Subject: [PATCH 28/29] Restore algolia/algoliasearch-client-php for PHPStan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With older Scout versions, Larastan fails without the Algolia client. 🤖 Generated with Claude Code --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index f99b2fe6ed..e608fcd5a9 100644 --- a/composer.json +++ b/composer.json @@ -44,6 +44,7 @@ }, "require-dev": { "composer-runtime-api": "^2", + "algolia/algoliasearch-client-php": "^3", "bensampo/laravel-enum": "^5 || ^6", "ergebnis/composer-normalize": "^2.2.2", "fakerphp/faker": "^1.21", From 49fc03565db7a832d0763690b709ecf3cff945af Mon Sep 17 00:00:00 2001 From: Benedikt Franke Date: Sun, 25 Oct 2026 12:34:24 +0100 Subject: [PATCH 29/29] Remove PHPStan ignores that match nothing in any CI job MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Turn reportUnmatchedIgnoredErrors off again: inline ignores have no per-comment opt-out, and 55 of them are needed only on some versions. 🤖 Generated with Claude Code --- phpstan.neon | 20 +------------------ src/Execution/Arguments/NestedManyToMany.php | 3 --- src/Execution/Arguments/NestedOneToMany.php | 3 --- .../ModelsLoader/PaginatedModelsLoader.php | 2 -- src/GraphQL.php | 6 +++--- src/Http/Middleware/AttemptAuthentication.php | 1 - src/Pagination/PaginationArgs.php | 2 +- src/Schema/AST/DocumentAST.php | 1 - src/Schema/Directives/DeleteDirective.php | 2 +- .../Directives/ModelMutationDirective.php | 2 +- src/Subscriptions/SubscriptionGuard.php | 1 - src/Testing/TestResponseMixin.php | 2 -- .../FederatedTracing/FederatedTracing.php | 2 +- tests/Integration/Defer/DeferDBTest.php | 1 - .../Directives/MorphManyDirectiveTest.php | 1 - tests/Unit/Execution/ResolveInfoTest.php | 1 - tests/Utils/Models/User.php | 1 - tests/Utils/Models/WithEnum.php | 1 - 18 files changed, 8 insertions(+), 44 deletions(-) diff --git a/phpstan.neon b/phpstan.neon index 91c6af9930..0196cd17fa 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -6,7 +6,7 @@ parameters: - benchmarks - src - tests - reportUnmatchedIgnoredErrors: true + reportUnmatchedIgnoredErrors: false # As long as we support multiple Laravel versions at once, there will be some dead spots # Install https://plugins.jetbrains.com/plugin/7677-awesome-console to make those links clickable editorUrl: '%%relFile%%:%%line%%' editorUrlTitle: '%%relFile%%:%%line%%' @@ -56,18 +56,15 @@ parameters: - '#generic class (Illuminate\\Database\\Eloquent\\Builder|Laravel\\Scout\\Builder)( but)? does not specify its types#' - '#contains generic type Illuminate\\Testing\\TestResponse<.+> but class Illuminate\\Testing\\TestResponse is not generic\.#' - '#Generic type Illuminate\\.+ specifies \d template types, but (class|interface) Illuminate\\.+ supports only \d: .+#' - - '#Method .+ should return Illuminate\\Database\\Eloquent\\Relations\\(BelongsToMany|MorphToMany)<(.+)> but returns Illuminate\\Database\\Eloquent\\Relations\\\1<\2, Illuminate\\Database\\Eloquent\\Relations\\Pivot>.#' - '#Method .+ should return Illuminate\\Database\\Eloquent\\Relations\\(HasOne|HasMany|BelongsToMany|MorphOne|MorphMany|MorphToMany)<(.+), .+> but returns Illuminate\\Database\\Eloquent\\Relations\\\1<\2>.#' - '#Method .+ should return Illuminate\\Database\\Eloquent\\Relations\\(BelongsTo|MorphTo)<(.+), \$this\((.+)\)> but returns Illuminate\\Database\\Eloquent\\Relations\\\1<\2, \3>.#' - '#Method .+ should return Illuminate\\Database\\Eloquent\\Relations\\(HasOneThrough|HasManyThrough)<(.+), .+> but returns Illuminate\\Database\\Eloquent\\Relations\\\1<\2>.#' - - '#Return type of call to method Illuminate\\Database\\Eloquent\\Relations\\BelongsToMany<.+>::save\(\) contains unresolvable type\.#' # covariance/generic issue - '#expects Illuminate\\Database\\Eloquent\\Collection<(.+), Illuminate\\Database\\Eloquent\\Model>, Illuminate\\Database\\Eloquent\\Collection<\1, TModel of Illuminate\\Database\\Eloquent\\Model> given.#' # PHPUnit version compatibility - InvocationMocker (PHPUnit 9-11) vs InvocationStubber (PHPUnit 12+) # The MocksResolvers trait uses conditional definition based on PHPUnit version - - '#PHPDoc tag @return contains generic type PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker<.+> but class PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker is not generic.#' - path: src/Testing/MocksResolvers.php message: '#(class|has invalid return type) PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker#' - '#Call to method (with|willReturn|willReturnCallback|willReturnMap|willReturnArgument|willReturnSelf|willReturnOnConsecutiveCalls|willThrowException|method|id|after|withAnyParameters|will)\(\) on an unknown class PHPUnit\\Framework\\MockObject\\Builder\\InvocationMocker\.#' @@ -82,21 +79,12 @@ parameters: # Possible footgun, but people who extend Lighthouse classes should know what they are doing - '#Cannot unset property .+ because it might have hooks in a subclass\.#' - # Ease transition for non-nullable properties towards native types https://github.com/phpstan/phpstan/issues/5150 - - '#Property .* in isset\(\) is not nullable\.#' - # Unavailable in thecodingmachine/safe:1 - '#Function (hrtime) is unsafe to use\. It can return FALSE instead of throwing an exception\.#' # Unavailable in thecodingmachine/safe:2 - '#Function (sort|substr|ksort) is unsafe to use\. It can return FALSE instead of throwing an exception\.#' - # Lumen type hints are just wrong - - '#Parameter \#1 \$content of function response expects string, .* given\.#' - - # Older versions of bensampo/laravel-enum are not generic yet - - '#contains generic type BenSampo\\Enum\\Enum<.+> but class BenSampo\\Enum\\Enum is not generic\.#' - # Ignore errors caused by the absence of Lumen in the dev dependencies - path: src/Support/AppVersion.php message: '#PHPDoc tag @var for variable \$container contains unknown class Laravel\\Lumen\\Application.#' @@ -111,18 +99,12 @@ parameters: - '#PHPDoc tag @var for variable \$router contains unknown class Laravel\\Lumen\\Routing\\Router\.#' - '#Call to method addRoute\(\) on an unknown class Laravel\\Lumen\\Routing\\Router\.#' - # Recent Mockery versions do not account for the last arg possibly being a closure - - path: tests/Unit/Subscriptions/Iterators/AuthenticatingSyncIteratorTest.php - message: '#Parameter \#2 \.\.\.\$args of static method Mockery::mock\(\) expects array\|class-string\|Nuwave\\Lighthouse\\Subscriptions\\SubscriptionGuard, Closure given\.#' - - path: tests/Integration/Schema/Directives/BuilderDirectiveTest.php message: '#Return type of call to static method Mockery::mock\(\) contains unresolvable type\.#' # Laravel added generics to Arr::first in 11.x, not sure how to handle them for now. - path: src/OrderBy/OrderByDirective.php message: '#Unable to resolve the template type TValue in call to method static method Illuminate\\Support\\Arr::first\(\)#' - - path: src/Testing/TestResponseMixin.php - message: '#Unable to resolve the template type TValue in call to method static method Illuminate\\Support\\Arr::first\(\)#' # Lots of work to specify the generics, little gain - path: tests diff --git a/src/Execution/Arguments/NestedManyToMany.php b/src/Execution/Arguments/NestedManyToMany.php index 68f2f08d3b..8978997ac8 100644 --- a/src/Execution/Arguments/NestedManyToMany.php +++ b/src/Execution/Arguments/NestedManyToMany.php @@ -37,7 +37,6 @@ public function __invoke($model, $args): void $saveModel = new ResolveNested(new SaveModel($relation)); foreach ($args->arguments['create']->value as $childArgs) { - // @phpstan-ignore-next-line Relation&Builder mixin not recognized $saveModel($relation->make(), $childArgs); } } @@ -46,7 +45,6 @@ public function __invoke($model, $args): void $updateModel = new ResolveNested(new UpdateModel(new SaveModel($relation))); foreach ($args->arguments['update']->value as $childArgs) { - // @phpstan-ignore-next-line Relation&Builder mixin not recognized $updateModel($relation->make(), $childArgs); } } @@ -55,7 +53,6 @@ public function __invoke($model, $args): void $upsertModel = new ResolveNested(new UpsertModel(new SaveModel($relation))); foreach ($args->arguments['upsert']->value as $childArgs) { - // @phpstan-ignore-next-line Relation&Builder mixin not recognized $upsertModel($relation->make(), $childArgs); } } diff --git a/src/Execution/Arguments/NestedOneToMany.php b/src/Execution/Arguments/NestedOneToMany.php index 8b2c216aa1..a1a35473ce 100644 --- a/src/Execution/Arguments/NestedOneToMany.php +++ b/src/Execution/Arguments/NestedOneToMany.php @@ -25,7 +25,6 @@ public function __invoke($model, $args): void $saveModel = new ResolveNested(new SaveModel($relation)); foreach ($args->arguments['create']->value as $childArgs) { - // @phpstan-ignore-next-line Relation&Builder mixin not recognized $saveModel($relation->make(), $childArgs); } } @@ -34,7 +33,6 @@ public function __invoke($model, $args): void $updateModel = new ResolveNested(new UpdateModel(new SaveModel($relation))); foreach ($args->arguments['update']->value as $childArgs) { - // @phpstan-ignore-next-line Relation&Builder mixin not recognized $updateModel($relation->make(), $childArgs); } } @@ -43,7 +41,6 @@ public function __invoke($model, $args): void $upsertModel = new ResolveNested(new UpsertModel(new SaveModel($relation))); foreach ($args->arguments['upsert']->value as $childArgs) { - // @phpstan-ignore-next-line Relation&Builder mixin not recognized $upsertModel($relation->make(), $childArgs); } } diff --git a/src/Execution/ModelsLoader/PaginatedModelsLoader.php b/src/Execution/ModelsLoader/PaginatedModelsLoader.php index 2f2bfb836a..46b04c44b1 100644 --- a/src/Execution/ModelsLoader/PaginatedModelsLoader.php +++ b/src/Execution/ModelsLoader/PaginatedModelsLoader.php @@ -61,14 +61,12 @@ protected function loadRelatedModels(EloquentCollection $parents): EloquentColle $relation->initRelation([$model], $this->relation); - // @phpstan-ignore-next-line Builder mixin is not understood return $relation->forPage($this->paginationArgs->page, $this->paginationArgs->first); }); // Merge all the relation queries into a single query with UNION ALL. $firstRelation = $relations->shift(); - // @phpstan-ignore function.impossibleType,instanceof.alwaysFalse assert($firstRelation instanceof Relation, 'Non-null because only non-empty lists of parents are passed into this loader.'); // Use ->getQuery() to respect model scopes, such as soft deletes diff --git a/src/GraphQL.php b/src/GraphQL.php index 9cd758f94e..6c5e7918af 100644 --- a/src/GraphQL.php +++ b/src/GraphQL.php @@ -396,13 +396,13 @@ protected function validateCacheableRules( } if ($queryHash === null) { - return DocumentValidator::validate($schema, $query, $validationRules); // @phpstan-ignore return.type (TODO remove ignore when requiring a newer version of webonyx/graphql-php) + return DocumentValidator::validate($schema, $query, $validationRules); } $validationCacheConfig = $this->configRepository->get('lighthouse.validation_cache'); if (! $validationCacheConfig['enable']) { - return DocumentValidator::validate($schema, $query, $validationRules); // @phpstan-ignore return.type (TODO remove ignore when requiring a newer version of webonyx/graphql-php) + return DocumentValidator::validate($schema, $query, $validationRules); } $cacheFactory = Container::getInstance()->make(CacheFactory::class); @@ -421,7 +421,7 @@ protected function validateCacheableRules( // As of webonyx/graphql-php 15.14.0, GraphQL\Error\Error is not serializable. // We would have to figure out how to serialize them properly to cache them. if ($result !== []) { - return $result; // @phpstan-ignore return.type (TODO remove ignore when requiring a newer version of webonyx/graphql-php) + return $result; } $store->put($cacheKey, $result, $validationCacheConfig['ttl']); diff --git a/src/Http/Middleware/AttemptAuthentication.php b/src/Http/Middleware/AttemptAuthentication.php index 897187824f..9450521863 100644 --- a/src/Http/Middleware/AttemptAuthentication.php +++ b/src/Http/Middleware/AttemptAuthentication.php @@ -31,7 +31,6 @@ protected function attemptAuthentication(array $guards): void foreach ($guards as $guard) { if ($this->authFactory->guard($guard)->check()) { - // @phpstan-ignore-next-line passing null works fine here $this->authFactory->shouldUse($guard); return; diff --git a/src/Pagination/PaginationArgs.php b/src/Pagination/PaginationArgs.php index a06316c1b2..c4a732d6f7 100644 --- a/src/Pagination/PaginationArgs.php +++ b/src/Pagination/PaginationArgs.php @@ -117,7 +117,7 @@ public function applyToBuilder(QueryBuilder|ScoutBuilder|EloquentBuilder|Relatio $total = $builder instanceof ScoutBuilder ? 0 // Laravel\Scout\Builder exposes no method to get the total count - : $builder->count(); // @phpstan-ignore-line see Illuminate\Database\Query\Builder::count(), available as a mixin in the other classes + : $builder->count(); return new ZeroPerPageLengthAwarePaginator($total, $this->page); // @phpstan-ignore return.type (generic type does not matter) } diff --git a/src/Schema/AST/DocumentAST.php b/src/Schema/AST/DocumentAST.php index 9d01a30d9b..2c15d1a653 100644 --- a/src/Schema/AST/DocumentAST.php +++ b/src/Schema/AST/DocumentAST.php @@ -249,7 +249,6 @@ protected function hydrateFromArray(array $ast): void $this->types = new NodeList($types); // @phpstan-ignore-next-line Since we start from the array form, the generic type does not match $this->directives = new NodeList($directives); - // @phpstan-ignore-next-line Since we start from the array form, the generic type does not match $this->schemaExtensions = array_map(fn (array $node): SchemaExtensionNode => $this->hydrateSchemaExtension($node), $schemaExtensions); } diff --git a/src/Schema/Directives/DeleteDirective.php b/src/Schema/Directives/DeleteDirective.php index c12e05fe36..9765ad464d 100644 --- a/src/Schema/Directives/DeleteDirective.php +++ b/src/Schema/Directives/DeleteDirective.php @@ -93,7 +93,7 @@ public function __invoke($model, $idOrIds): void $relation->delete(); } } else { - $related = $relation->make(); // @phpstan-ignore method.notFound (Relation delegates to Builder) + $related = $relation->make(); $related::destroy($idOrIds); } } diff --git a/src/Schema/Directives/ModelMutationDirective.php b/src/Schema/Directives/ModelMutationDirective.php index 3e272a6d65..42fc885f6f 100644 --- a/src/Schema/Directives/ModelMutationDirective.php +++ b/src/Schema/Directives/ModelMutationDirective.php @@ -52,7 +52,7 @@ public function __invoke($model, $args): mixed $relation = $model->{$this->relationName()}(); assert($relation instanceof Relation); - $related = $relation->make(); // @phpstan-ignore method.notFound (Relation delegates to Builder) + $related = $relation->make(); return $this->executeMutation($related, $args, $relation); } diff --git a/src/Subscriptions/SubscriptionGuard.php b/src/Subscriptions/SubscriptionGuard.php index 5b6dd5b24c..969223f16e 100644 --- a/src/Subscriptions/SubscriptionGuard.php +++ b/src/Subscriptions/SubscriptionGuard.php @@ -19,7 +19,6 @@ public function user(): ?Authenticatable public function reset(): void { - // @phpstan-ignore-next-line GuardHelpers in old Laravel versions has non-nullable PHPDoc for this type $this->user = null; } diff --git a/src/Testing/TestResponseMixin.php b/src/Testing/TestResponseMixin.php index 4db12aca49..bde56cee10 100644 --- a/src/Testing/TestResponseMixin.php +++ b/src/Testing/TestResponseMixin.php @@ -123,7 +123,6 @@ public function assertGraphQLSubscriptionAuthorized(): \Closure Assert::assertTrue(method_exists($testClassInstance, 'postJson'), 'Expected the given $testClassInstance to use the trait Illuminate\\Foundation\\Testing\\Concerns\\MakesHttpRequests.'); $testClassInstance - // @phpstan-ignore-next-line present in \Illuminate\Foundation\Testing\Concerns\MakesHttpRequests ->postJson('graphql/subscriptions/auth', [ 'channel_name' => $this->json('extensions.lighthouse_subscriptions.channel'), ]) @@ -142,7 +141,6 @@ public function assertGraphQLSubscriptionNotAuthorized(): \Closure Assert::assertTrue(method_exists($testClassInstance, 'postJson'), 'Expected the given $testClassInstance to use the trait Illuminate\\Foundation\\Testing\\Concerns\\MakesHttpRequests.'); $testClassInstance - // @phpstan-ignore-next-line present in \Illuminate\Foundation\Testing\Concerns\MakesHttpRequests ->postJson('graphql/subscriptions/auth', [ 'channel_name' => $this->json('extensions.lighthouse_subscriptions.channel'), ]) diff --git a/src/Tracing/FederatedTracing/FederatedTracing.php b/src/Tracing/FederatedTracing/FederatedTracing.php index 83623bfe7b..26fd6195d2 100644 --- a/src/Tracing/FederatedTracing/FederatedTracing.php +++ b/src/Tracing/FederatedTracing/FederatedTracing.php @@ -149,7 +149,7 @@ protected function recordError(GraphQLError $error): void protected function findOrNewNode(array $path): Node { assert($this->trace !== null); // @phpstan-ignore notIdentical.alwaysTrue (control flow not understood) - assert($this->trace->getRoot() !== null); // @phpstan-ignore notIdentical.alwaysTrue (control flow not understood) + assert($this->trace->getRoot() !== null); if ($path === []) { return $this->trace->getRoot(); diff --git a/tests/Integration/Defer/DeferDBTest.php b/tests/Integration/Defer/DeferDBTest.php index 47357fcbb1..159725143a 100644 --- a/tests/Integration/Defer/DeferDBTest.php +++ b/tests/Integration/Defer/DeferDBTest.php @@ -217,7 +217,6 @@ public function testDeferNestedListFields(): void $this->assertSame( $company->users - // @phpstan-ignore-next-line type of model is known ->map(static fn (User $user): array => [ 'email' => $user->email, 'company' => null, diff --git a/tests/Integration/Schema/Directives/MorphManyDirectiveTest.php b/tests/Integration/Schema/Directives/MorphManyDirectiveTest.php index 9dc03b7001..a5425c5268 100644 --- a/tests/Integration/Schema/Directives/MorphManyDirectiveTest.php +++ b/tests/Integration/Schema/Directives/MorphManyDirectiveTest.php @@ -60,7 +60,6 @@ protected function setUp(): void $this->post->user()->associate($this->user); $this->post->save(); - // @phpstan-ignore-next-line generic false-positive $this->postImages = Collection::times( $this->faker()->numberBetween(1, 10), function (): Image { diff --git a/tests/Unit/Execution/ResolveInfoTest.php b/tests/Unit/Execution/ResolveInfoTest.php index e4be132c65..583b976e29 100644 --- a/tests/Unit/Execution/ResolveInfoTest.php +++ b/tests/Unit/Execution/ResolveInfoTest.php @@ -96,7 +96,6 @@ public static function definition(): string $builder = User::query(); $resolveInfo = new class extends ResolveInfo { - /** @phpstan-ignore-next-line no need to call parent `__construct` */ public function __construct() { // empty diff --git a/tests/Utils/Models/User.php b/tests/Utils/Models/User.php index 29ee58e32d..717d3088fe 100644 --- a/tests/Utils/Models/User.php +++ b/tests/Utils/Models/User.php @@ -70,7 +70,6 @@ final class User extends Authenticatable */ protected $connection = DBTestCase::DEFAULT_CONNECTION; - // @phpstan-ignore-next-line iterable type missing in Laravel 9.0.0 protected $casts = [ 'email_verified_at' => 'datetime', 'date_of_birth' => 'date', diff --git a/tests/Utils/Models/WithEnum.php b/tests/Utils/Models/WithEnum.php index bdc4904584..6f777f6331 100644 --- a/tests/Utils/Models/WithEnum.php +++ b/tests/Utils/Models/WithEnum.php @@ -23,7 +23,6 @@ final class WithEnum extends Model { public $timestamps = false; - // @phpstan-ignore-next-line iterable type missing in Laravel 9.0.0 protected $casts = [ 'type' => AOrB::class, ];