Skip to content

Commit f4cb362

Browse files
[10.x] PHP 8.4 Code Compatibility (#53612)
* [10.x] PHP 8.4 Code Compatibility Signed-off-by: Mior Muhammad Zaki <[email protected]> * Apply fixes from StyleCI * wip Signed-off-by: Mior Muhammad Zaki <[email protected]> --------- Signed-off-by: Mior Muhammad Zaki <[email protected]> Co-authored-by: StyleCI Bot <[email protected]>
1 parent a0da1ea commit f4cb362

File tree

111 files changed

+207
-205
lines changed

Some content is hidden

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

111 files changed

+207
-205
lines changed

.styleci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
php:
22
preset: laravel
33
version: 8.1
4+
enabled:
5+
- nullable_type_declarations
46
finder:
57
not-name:
68
- bad-syntax-strategy.php

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
"nyholm/psr7": "^1.2",
108108
"orchestra/testbench-core": "^8.23.4",
109109
"pda/pheanstalk": "^4.0",
110-
"phpstan/phpstan": "^1.4.7",
110+
"phpstan/phpstan": "~1.11.11",
111111
"phpunit/phpunit": "^10.0.7",
112112
"predis/predis": "^2.0.2",
113113
"symfony/cache": "^6.2",

src/Illuminate/Auth/Access/AuthorizationException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class AuthorizationException extends Exception
2929
* @param \Throwable|null $previous
3030
* @return void
3131
*/
32-
public function __construct($message = null, $code = null, Throwable $previous = null)
32+
public function __construct($message = null, $code = null, ?Throwable $previous = null)
3333
{
3434
parent::__construct($message ?? 'This action is unauthorized.', 0, $previous);
3535

src/Illuminate/Auth/Access/Gate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function __construct(Container $container,
100100
array $policies = [],
101101
array $beforeCallbacks = [],
102102
array $afterCallbacks = [],
103-
callable $guessPolicyNamesUsingCallback = null)
103+
?callable $guessPolicyNamesUsingCallback = null)
104104
{
105105
$this->policies = $policies;
106106
$this->container = $container;
@@ -224,7 +224,7 @@ public function define($ability, $callback)
224224
* @param array|null $abilities
225225
* @return $this
226226
*/
227-
public function resource($name, $class, array $abilities = null)
227+
public function resource($name, $class, ?array $abilities = null)
228228
{
229229
$abilities = $abilities ?: [
230230
'viewAny' => 'viewAny',

src/Illuminate/Auth/Passwords/PasswordBroker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct(TokenRepositoryInterface $tokens, UserProvider $user
4545
* @param \Closure|null $callback
4646
* @return string
4747
*/
48-
public function sendResetLink(array $credentials, Closure $callback = null)
48+
public function sendResetLink(array $credentials, ?Closure $callback = null)
4949
{
5050
// First we will check to see if we found a user at the given credentials and
5151
// if we did not we will redirect back to this current URI with a piece of

src/Illuminate/Auth/RequestGuard.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class RequestGuard implements Guard
3333
* @param \Illuminate\Contracts\Auth\UserProvider|null $provider
3434
* @return void
3535
*/
36-
public function __construct(callable $callback, Request $request, UserProvider $provider = null)
36+
public function __construct(callable $callback, Request $request, ?UserProvider $provider = null)
3737
{
3838
$this->request = $request;
3939
$this->callback = $callback;

src/Illuminate/Auth/SessionGuard.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ class SessionGuard implements StatefulGuard, SupportsBasicAuth
123123
public function __construct($name,
124124
UserProvider $provider,
125125
Session $session,
126-
Request $request = null,
127-
Timebox $timebox = null)
126+
?Request $request = null,
127+
?Timebox $timebox = null)
128128
{
129129
$this->name = $name;
130130
$this->session = $session;

src/Illuminate/Broadcasting/BroadcastManager.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function __construct($app)
6464
* @param array|null $attributes
6565
* @return void
6666
*/
67-
public function routes(array $attributes = null)
67+
public function routes(?array $attributes = null)
6868
{
6969
if ($this->app instanceof CachesRoutes && $this->app->routesAreCached()) {
7070
return;
@@ -86,7 +86,7 @@ public function routes(array $attributes = null)
8686
* @param array|null $attributes
8787
* @return void
8888
*/
89-
public function userRoutes(array $attributes = null)
89+
public function userRoutes(?array $attributes = null)
9090
{
9191
if ($this->app instanceof CachesRoutes && $this->app->routesAreCached()) {
9292
return;
@@ -110,7 +110,7 @@ public function userRoutes(array $attributes = null)
110110
* @param array|null $attributes
111111
* @return void
112112
*/
113-
public function channelRoutes(array $attributes = null)
113+
public function channelRoutes(?array $attributes = null)
114114
{
115115
$this->routes($attributes);
116116
}

src/Illuminate/Bus/Batch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ public function delete()
450450
* @param \Throwable|null $e
451451
* @return void
452452
*/
453-
protected function invokeHandlerCallback($handler, Batch $batch, Throwable $e = null)
453+
protected function invokeHandlerCallback($handler, Batch $batch, ?Throwable $e = null)
454454
{
455455
try {
456456
return $handler($batch, $e);

src/Illuminate/Bus/Dispatcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Dispatcher implements QueueingDispatcher
5858
* @param \Closure|null $queueResolver
5959
* @return void
6060
*/
61-
public function __construct(Container $container, Closure $queueResolver = null)
61+
public function __construct(Container $container, ?Closure $queueResolver = null)
6262
{
6363
$this->container = $container;
6464
$this->queueResolver = $queueResolver;

0 commit comments

Comments
 (0)