Skip to content

Commit 204ccca

Browse files
authored
Support Laravel 12
1 parent 766f8b3 commit 204ccca

File tree

6 files changed

+37
-20
lines changed

6 files changed

+37
-20
lines changed

.github/workflows/validate.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,13 @@ jobs:
1818
- "8.0"
1919
- "8.1"
2020
- "8.2"
21+
- "8.3"
22+
- "8.4"
2123
laravel-version:
2224
- "^9"
2325
- "^10"
2426
- "^11"
27+
- "^12"
2528
composer:
2629
- name: lowest
2730
arg: "--prefer-lowest --prefer-stable"
@@ -32,8 +35,18 @@ jobs:
3235
laravel-version: "^10"
3336
- php-version: "8.0"
3437
laravel-version: "^11"
38+
- php-version: "8.0"
39+
laravel-version: "^12"
3540
- php-version: "8.1"
3641
laravel-version: "^11"
42+
- php-version: "8.1"
43+
laravel-version: "^12"
44+
- php-version: "8.3"
45+
laravel-version: "^9"
46+
- php-version: "8.4"
47+
laravel-version: "^9"
48+
- php-version: "8.4"
49+
laravel-version: "^10"
3750

3851
steps:
3952
- uses: actions/checkout@v4
@@ -53,4 +66,4 @@ jobs:
5366
--update-with-all-dependencies
5467
${{ matrix.composer.arg }}
5568
56-
- run: vendor/bin/phpstan
69+
- run: vendor/bin/phpstan analyse --configuration=phpstan.neon

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ it: fix stan ## Perform all quality checks
33

44
.PHONY: help
55
help: ## Displays this list of targets with descriptions
6-
@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'
6+
@grep --extended-regexp '^[a-zA-Z0-9_-]+:.*?## .*$$' $(firstword $(MAKEFILE_LIST)) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}'
77

88
.PHONY: setup
99
setup: vendor ## Setup the local environment
@@ -15,7 +15,7 @@ fix: ## Fix the codestyle
1515

1616
.PHONY: stan
1717
stan: ## Run static analysis
18-
vendor/bin/phpstan
18+
vendor/bin/phpstan analyse --configuration=phpstan.neon
1919

20-
vendor: composer.json composer.lock ## Install dependencies through composer
20+
vendor: composer.json ## Install dependencies through composer
2121
composer update

composer.json

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,17 @@
1515
],
1616
"require": {
1717
"php": "^8",
18-
"illuminate/console": "^9 || ^10 || ^11",
19-
"illuminate/contracts": "^9 || ^10 || ^11",
20-
"illuminate/support": "^9 || ^10 || ^11"
18+
"illuminate/console": "^9 || ^10 || ^11 || ^12",
19+
"illuminate/contracts": "^9 || ^10 || ^11 || ^12",
20+
"illuminate/support": "^9 || ^10 || ^11 || ^12"
2121
},
2222
"require-dev": {
23-
"ergebnis/composer-normalize": "^2.29",
24-
"larastan/larastan": "^2.5.2",
25-
"mll-lab/php-cs-fixer-config": "^5",
26-
"orchestra/testbench": "^7.7 || ^8.8 || ^9",
27-
"phpstan/extension-installer": "^1",
28-
"phpstan/phpstan": "^1.10.15",
29-
"phpstan/phpstan-mockery": "^1.1.1",
30-
"phpstan/phpstan-phpunit": "^1.3.11"
23+
"ergebnis/composer-normalize": "^2.45",
24+
"larastan/larastan": "^2.9.14 || ^3.1",
25+
"mll-lab/php-cs-fixer-config": "^5.10",
26+
"orchestra/testbench": "^7.52 || ^8.33 || ^9.11 || ^10",
27+
"phpstan/extension-installer": "^1.4.3",
28+
"phpstan/phpstan": "^1.12.20 || ^2.1.7"
3129
},
3230
"minimum-stability": "dev",
3331
"prefer-stable": true,

phpstan.neon

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@ parameters:
88
# Install https://plugins.jetbrains.com/plugin/7677-awesome-console to make those links clickable
99
editorUrl: '%%relFile%%:%%line%%'
1010
editorUrlTitle: '%%relFile%%:%%line%%'
11+
# As long as we support multiple Laravel versions at once, there will be some dead spots
12+
reportUnmatchedIgnoredErrors: false
1113
ignoreErrors:
1214
# Lumen does not support Laravel 11
13-
- '#Laravel\\Lumen#'
14-
15+
- message: '#Laravel\\Lumen#'
16+
# Allows assert() calls to assist IDE autocompletion
17+
- message: '#Call to function assert\(\) with true will always evaluate to true\.#'
18+
# This file actually is a config file
19+
- message: "#Called 'env' outside of the config directory which returns null when the config is cached, use 'config'.#"
20+
path: src/graphiql.php

src/GraphiQLController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ public function __invoke(ConfigRepository $config, Request $request): View
2424
assert(is_array($routeConfig));
2525

2626
return $this->viewFactory->make('graphiql::index', [
27-
'url' => $this->maybeURL($routeConfig['endpoint'] ?? null),
28-
'subscriptionUrl' => $this->maybeURL($routeConfig['subscription-endpoint'] ?? null),
27+
'url' => $this->maybeURL($routeConfig['endpoint'] ?? null), // @phpstan-ignore argument.type (mixed)
28+
'subscriptionUrl' => $this->maybeURL($routeConfig['subscription-endpoint'] ?? null), // @phpstan-ignore argument.type (mixed)
2929
]);
3030
}
3131

src/routes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
$app = Container::getInstance();
88

99
$config = $app->make(ConfigRepository::class);
10-
assert($config instanceof ConfigRepository);
10+
assert($config instanceof ConfigRepository); // @phpstan-ignore instanceof.alwaysTrue (aids IDE)
1111

1212
/** @var \Illuminate\Contracts\Routing\Registrar|\Laravel\Lumen\Routing\Router $router */
1313
$router = $app->make('router');

0 commit comments

Comments
 (0)