Skip to content

Commit 1d4e3aa

Browse files
author
DKravtsov
committed
PHP 8.1 and Laravel 9
1 parent 28ec9d7 commit 1d4e3aa

Some content is hidden

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

69 files changed

+3841
-5364
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ trim_trailing_whitespace = true
1111
[*.md]
1212
trim_trailing_whitespace = false
1313

14-
[*.yml]
14+
[*.{yml,yaml}]
1515
indent_size = 2
1616

1717
[{composer.json,Makefile}]

.env.dev

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ APP_DEBUG=true
55
APP_URL=http://localhost
66

77
LOG_CHANNEL=stack
8+
LOG_DEPRECATIONS_CHANNEL=null
89
LOG_LEVEL=debug
910

1011
DB_CONNECTION=mysql
@@ -16,7 +17,7 @@ DB_PASSWORD=secret
1617

1718
BROADCAST_DRIVER=log
1819
CACHE_DRIVER=file
19-
FILESYSTEM_DRIVER=local
20+
FILESYSTEM_DISK=local
2021
QUEUE_CONNECTION=sync
2122
SESSION_DRIVER=file
2223
SESSION_LIFETIME=120
@@ -33,7 +34,7 @@ MAIL_PORT=1025
3334
MAIL_USERNAME=null
3435
MAIL_PASSWORD=null
3536
MAIL_ENCRYPTION=null
36-
MAIL_FROM_ADDRESS=null
37+
MAIL_FROM_ADDRESS="[email protected]"
3738
MAIL_FROM_NAME="${APP_NAME}"
3839

3940
AWS_ACCESS_KEY_ID=

.php-cs-fixer.dist.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@
1919
'blank_line_before_statement' => ['statements' => ['continue', 'declare', 'return', 'throw', 'try']],
2020
'single_blank_line_before_namespace' => true,
2121
'blank_line_after_namespace' => true,
22-
'blank_line_after_opening_tag' => true,
22+
'phpdoc_align' => ['align' => 'left'],
23+
'types_spaces' => 'single',
2324

2425
// skip list (see ecs.php)
2526
'no_multiline_whitespace_around_double_arrow' => false,
2627
'phpdoc_no_package' => false,
2728
'phpdoc_summary' => false,
2829
'phpdoc_separation' => false,
30+
'blank_line_after_opening_tag' => false,
2931
'class_attributes_separation' => false,
3032
'no_blank_lines_before_namespace' => false,
3133
'not_operator_with_successor_space' => false,
3234
'single_line_throw' => false,
33-
34-
])->setFinder($finder);
35+
'no_extra_blank_lines' => ['tokens' => ['break']],
36+
])
37+
->setFinder($finder);

.styleci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
php:
22
preset: laravel
3-
version: 8
43
disabled:
54
- no_unused_imports
65
finder:
76
not-name:
87
- index.php
9-
- server.php
108
js:
119
finder:
1210
not-name:

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.0-fpm
1+
FROM php:8.1-fpm
22

33
# set main params
44
ARG BUILD_ARGUMENT_DEBUG_ENABLED=false

app/Exceptions/Handler.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99

1010
class Handler extends ExceptionHandler
1111
{
12+
/**
13+
* A list of exception types with their corresponding custom log levels.
14+
*
15+
* @var array<class-string<Throwable>, \Psr\Log\LogLevel::*>
16+
*/
17+
protected $levels = [];
18+
1219
/**
1320
* A list of the exception types that are not reported.
1421
*

app/Http/Kernel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Kernel extends HttpKernel
1818
protected $middleware = [
1919
// \App\Http\Middleware\TrustHosts::class,
2020
\App\Http\Middleware\TrustProxies::class,
21-
\Fruitcake\Cors\HandleCors::class,
21+
\Illuminate\Http\Middleware\HandleCors::class,
2222
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
2323
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
2424
\App\Http\Middleware\TrimStrings::class,
@@ -35,7 +35,6 @@ class Kernel extends HttpKernel
3535
\App\Http\Middleware\EncryptCookies::class,
3636
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
3737
\Illuminate\Session\Middleware\StartSession::class,
38-
// \Illuminate\Session\Middleware\AuthenticateSession::class,
3938
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
4039
\App\Http\Middleware\VerifyCsrfToken::class,
4140
\Illuminate\Routing\Middleware\SubstituteBindings::class,
@@ -58,6 +57,7 @@ class Kernel extends HttpKernel
5857
protected $routeMiddleware = [
5958
'auth' => \App\Http\Middleware\Authenticate::class,
6059
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
60+
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
6161
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
6262
'can' => \Illuminate\Auth\Middleware\Authorize::class,
6363
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,

app/Http/Middleware/RedirectIfAuthenticated.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ class RedirectIfAuthenticated
1414
/**
1515
* Handle an incoming request.
1616
*
17+
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
1718
* @param string|null ...$guards
18-
* @return mixed
19+
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
1920
*/
2021
public function handle(Request $request, Closure $next, ...$guards)
2122
{

app/Http/Middleware/TrustHosts.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ class TrustHosts extends Middleware
1010
{
1111
/**
1212
* Get the host patterns that should be trusted.
13+
*
14+
* @return array<int, string|null>
1315
*/
1416
public function hosts(): array
1517
{

app/Providers/EventServiceProvider.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,12 @@ class EventServiceProvider extends ServiceProvider
2929
public function boot(): void
3030
{
3131
}
32+
33+
/**
34+
* Determine if events and listeners should be automatically discovered.
35+
*/
36+
public function shouldDiscoverEvents(): bool
37+
{
38+
return false;
39+
}
3240
}

0 commit comments

Comments
 (0)