Skip to content

Commit

Permalink
Laravel 11
Browse files Browse the repository at this point in the history
  • Loading branch information
jenky committed Apr 15, 2024
1 parent 6dd57f9 commit 8a29461
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 10 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@ jobs:
matrix:
# os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
php: [8.0, 8.1, 8.2]
laravel: [9.*, 10.*]
php: [8.0, 8.1, 8.2, 8.3]
laravel: [9.*, 10.*, 11.*]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 10.*
testbench: 8.*
- laravel: 11.*
testbench: 9.*
exclude:
- laravel: 10.*
php: 8.0
- laravel: 11.*
php: 8.0

name: PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }} - ${{ matrix.os }}

Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
],
"require": {
"php": "^8.0",
"illuminate/contracts": "^9.0|^10.0",
"illuminate/config": "^9.0|^10.0",
"illuminate/support": "^9.0|^10.0"
"illuminate/contracts": "^9.0|^10.0|^11.0",
"illuminate/config": "^9.0|^10.0|^11.0",
"illuminate/support": "^9.0|^10.0|^11.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.10",
"nunomaduro/larastan": "^2.4",
"orchestra/testbench": "^7.0|^8.0",
"orchestra/testbench": "^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.0|^10.0"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ parameters:
- src

# The level 9 is the highest level
level: 7
level: 8

checkMissingIterableValueType: false
4 changes: 2 additions & 2 deletions src/Hades.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ private static function requestIdentifier(): Closure
*/
public static function identify(Request $request): bool
{
return call_user_func(self::requestIdentifier(), $request);
return self::requestIdentifier()($request);
}

/**
* Indicates that the response should always return JSON output.
*
* @param \Closure(Request): bool $when
*/
public static function forceJsonOutput(Closure $when = null): static
public static function forceJsonOutput(Closure $when = null): self
{
if ($when) {
// Set the callback that will be used to identify the current request.
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Middleware/IdentifyRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@ protected function wantsJson(Request $request): bool
{
// We can't use $request->wantsJson() here because it will cache the
// Accept header for subsequent check.
return Str::contains($request->header('Accept'), ['/json', '+json']);
return Str::contains($request->header('Accept') ?? '', ['/json', '+json']);
}
}

0 comments on commit 8a29461

Please sign in to comment.