Skip to content

Commit 99214c6

Browse files
authored
Merge pull request #407 from pacoorozco/upgrade-to-laravel-10
Upgrade to Laravel 10
2 parents 704d952 + 1f054aa commit 99214c6

File tree

67 files changed

+1529
-1362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1529
-1362
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* text=auto
1+
* text=auto eol=lf
22
*.css linguist-vendored
33
*.scss linguist-vendored
44
*.js linguist-vendored

.github/workflows/phpstan.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup PHP
2424
uses: shivammathur/setup-php@v2
2525
with:
26-
php-version: '8.0'
26+
php-version: '8.1'
2727
coverage: none
2828

2929
- name: Install composer dependencies

.github/workflows/run-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
strategy:
4545
fail-fast: false
4646
matrix:
47-
php-versions: [ '8.0' ]
47+
php-versions: [ '8.1' ]
4848
steps:
4949
- name: Checkout
5050
uses: actions/checkout@v3
@@ -70,7 +70,7 @@ jobs:
7070

7171
- name: Run PHPUnit
7272
run: |
73-
php artisan test --parallel --runner WrapperRunner --stop-on-failure --coverage-text --coverage-clover=clover.xml
73+
vendor/bin/phpunit
7474
env:
7575
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
7676
REDIS_PORT: ${{ job.services.redis.ports['6379'] }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package-lock.json
1717
.env
1818
.env.backup
1919
.phpunit.result.cache
20+
/.phpunit.cache
2021

2122
# Homestead deployment. https://laravel.com/docs/master/homestead
2223
Homestead.yaml

app/Console/Kernel.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,17 @@ class Kernel extends ConsoleKernel
4242

4343
/**
4444
* Define the application's command schedule.
45-
*
46-
* @param \Illuminate\Console\Scheduling\Schedule $schedule
47-
* @return void
4845
*/
49-
protected function schedule(Schedule $schedule)
46+
protected function schedule(Schedule $schedule): void
5047
{
5148
$schedule->command(PublishScheduledQuestions::class)->hourly();
49+
$schedule->command('cache:prune-stale-tags')->hourly();
5250
}
5351

5452
/**
5553
* Register the commands for the application.
56-
*
57-
* @return void
5854
*/
59-
protected function commands()
55+
protected function commands(): void
6056
{
6157
$this->load(__DIR__.'/Commands');
6258

app/Exceptions/Handler.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,8 @@ class Handler extends ExceptionHandler
5151

5252
/**
5353
* Register the exception handling callbacks for the application.
54-
*
55-
* @return void
5654
*/
57-
public function register()
55+
public function register(): void
5856
{
5957
//
6058
}

app/Http/Controllers/Auth/SocialAccountController.php

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,14 @@ class SocialAccountController extends Controller
3535
{
3636
/**
3737
* Redirect the user to the Provider authentication page.
38-
*
39-
* @param string $provider
40-
* @return \Illuminate\Http\RedirectResponse
4138
*/
42-
public function redirectToProvider(string $provider): RedirectResponse
39+
public function redirectToProvider(string $provider): \Symfony\Component\HttpFoundation\RedirectResponse|RedirectResponse
4340
{
4441
return Socialite::driver($provider)->redirect();
4542
}
4643

4744
/**
4845
* Obtain the user information.
49-
*
50-
* @param \Gamify\Services\SocialAccountService $accountRepository
51-
* @param string $provider
52-
* @return \Illuminate\Http\RedirectResponse
5346
*/
5447
public function handleProviderCallback(SocialAccountService $accountRepository, string $provider): RedirectResponse
5548
{

app/Http/Kernel.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Kernel extends HttpKernel
3434
*
3535
* These middleware are run during every request to your application.
3636
*
37-
* @var array
37+
* @var array<int, class-string|string>
3838
*/
3939
protected $middleware = [
4040
// \Gamify\Http\Middleware\TrustHosts::class,
@@ -49,7 +49,7 @@ class Kernel extends HttpKernel
4949
/**
5050
* The application's route middleware groups.
5151
*
52-
* @var array
52+
* @var array<string, array<int, class-string|string>>
5353
*/
5454
protected $middlewareGroups = [
5555
'web' => [
@@ -62,19 +62,19 @@ class Kernel extends HttpKernel
6262
],
6363

6464
'api' => [
65-
'throttle:api',
65+
\Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
6666
\Illuminate\Routing\Middleware\SubstituteBindings::class,
6767
],
6868
];
6969

7070
/**
71-
* The application's route middleware.
71+
* The application's middleware aliases.
7272
*
7373
* These middleware may be assigned to groups or used individually.
7474
*
75-
* @var array
75+
* @var array<string, class-string|string>
7676
*/
77-
protected $routeMiddleware = [
77+
protected $middlewareAliases = [
7878
'auth' => \Gamify\Http\Middleware\Authenticate::class,
7979
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
8080
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,

app/Http/Middleware/Authenticate.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,15 @@
2626
namespace Gamify\Http\Middleware;
2727

2828
use Illuminate\Auth\Middleware\Authenticate as Middleware;
29+
use Illuminate\Http\Request;
2930

3031
class Authenticate extends Middleware
3132
{
3233
/**
3334
* Get the path the user should be redirected to when they are not authenticated.
34-
*
35-
* @param \Illuminate\Http\Request $request
36-
* @return string|null
3735
*/
38-
protected function redirectTo($request): ?string
36+
protected function redirectTo(Request $request): ?string
3937
{
40-
if (! $request->expectsJson()) {
41-
return route('login');
42-
}
43-
44-
return null;
38+
return $request->expectsJson() ? null : route('login');
4539
}
4640
}

app/Http/Middleware/EncryptCookies.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class EncryptCookies extends Middleware
3232
/**
3333
* The names of the cookies that should not be encrypted.
3434
*
35-
* @var array
35+
* @var array<int, string>
3636
*/
3737
protected $except = [
3838
//

0 commit comments

Comments
 (0)