diff --git a/src/WpStarter/Auth/Access/AuthorizationException.php b/src/WpStarter/Auth/Access/AuthorizationException.php index b3088ef..0c37693 100644 --- a/src/WpStarter/Auth/Access/AuthorizationException.php +++ b/src/WpStarter/Auth/Access/AuthorizationException.php @@ -22,7 +22,7 @@ class AuthorizationException extends Exception * @param \Throwable|null $previous * @return void */ - public function __construct($message = null, $code = null, Throwable $previous = null) + public function __construct($message = null, $code = null, ?Throwable $previous = null) { parent::__construct($message ?? 'This action is unauthorized.', 0, $previous); diff --git a/src/WpStarter/Auth/Access/Gate.php b/src/WpStarter/Auth/Access/Gate.php index c7aebce..d8a4569 100644 --- a/src/WpStarter/Auth/Access/Gate.php +++ b/src/WpStarter/Auth/Access/Gate.php @@ -88,7 +88,7 @@ class Gate implements GateContract */ public function __construct(Container $container, callable $userResolver, array $abilities = [], array $policies = [], array $beforeCallbacks = [], array $afterCallbacks = [], - callable $guessPolicyNamesUsingCallback = null) + ?callable $guessPolicyNamesUsingCallback = null) { $this->policies = $policies; $this->container = $container; @@ -212,7 +212,7 @@ public function define($ability, $callback) * @param array|null $abilities * @return $this */ - public function resource($name, $class, array $abilities = null) + public function resource($name, $class, ?array $abilities = null) { $abilities = $abilities ?: [ 'viewAny' => 'viewAny', diff --git a/src/WpStarter/Auth/Passwords/PasswordBroker.php b/src/WpStarter/Auth/Passwords/PasswordBroker.php index fea1b1b..2999f5c 100644 --- a/src/WpStarter/Auth/Passwords/PasswordBroker.php +++ b/src/WpStarter/Auth/Passwords/PasswordBroker.php @@ -45,7 +45,7 @@ public function __construct(TokenRepositoryInterface $tokens, UserProvider $user * @param \Closure|null $callback * @return string */ - public function sendResetLink(array $credentials, Closure $callback = null) + public function sendResetLink(array $credentials, ?Closure $callback = null) { // First we will check to see if we found a user at the given credentials and // if we did not we will redirect back to this current URI with a piece of diff --git a/src/WpStarter/Auth/RequestGuard.php b/src/WpStarter/Auth/RequestGuard.php index 258e161..a863155 100644 --- a/src/WpStarter/Auth/RequestGuard.php +++ b/src/WpStarter/Auth/RequestGuard.php @@ -33,7 +33,7 @@ class RequestGuard implements Guard * @param \WpStarter\Contracts\Auth\UserProvider|null $provider * @return void */ - public function __construct(callable $callback, Request $request, UserProvider $provider = null) + public function __construct(callable $callback, Request $request, ?UserProvider $provider = null) { $this->request = $request; $this->callback = $callback; diff --git a/src/WpStarter/Auth/SessionGuard.php b/src/WpStarter/Auth/SessionGuard.php index ac3c9de..606798c 100644 --- a/src/WpStarter/Auth/SessionGuard.php +++ b/src/WpStarter/Auth/SessionGuard.php @@ -123,8 +123,8 @@ class SessionGuard implements StatefulGuard, SupportsBasicAuth public function __construct($name, UserProvider $provider, Session $session, - Request $request = null, - Timebox $timebox = null) + ?Request $request = null, + ?Timebox $timebox = null) { $this->name = $name; $this->session = $session; diff --git a/src/WpStarter/Broadcasting/BroadcastManager.php b/src/WpStarter/Broadcasting/BroadcastManager.php index 2a980f0..8dd435b 100644 --- a/src/WpStarter/Broadcasting/BroadcastManager.php +++ b/src/WpStarter/Broadcasting/BroadcastManager.php @@ -60,7 +60,7 @@ public function __construct($app) * @param array|null $attributes * @return void */ - public function routes(array $attributes = null) + public function routes(?array $attributes = null) { if ($this->app instanceof CachesRoutes && $this->app->routesAreCached()) { return; diff --git a/src/WpStarter/Bus/Batch.php b/src/WpStarter/Bus/Batch.php index c889981..4d91fbf 100644 --- a/src/WpStarter/Bus/Batch.php +++ b/src/WpStarter/Bus/Batch.php @@ -424,7 +424,7 @@ public function delete() * @param \Throwable|null $e * @return void */ - protected function invokeHandlerCallback($handler, Batch $batch, Throwable $e = null) + protected function invokeHandlerCallback($handler, Batch $batch, ?Throwable $e = null) { try { return $handler($batch, $e); diff --git a/src/WpStarter/Bus/Dispatcher.php b/src/WpStarter/Bus/Dispatcher.php index 8afad3e..3e57eda 100644 --- a/src/WpStarter/Bus/Dispatcher.php +++ b/src/WpStarter/Bus/Dispatcher.php @@ -58,7 +58,7 @@ class Dispatcher implements QueueingDispatcher * @param \Closure|null $queueResolver * @return void */ - public function __construct(Container $container, Closure $queueResolver = null) + public function __construct(Container $container, ?Closure $queueResolver = null) { $this->container = $container; $this->queueResolver = $queueResolver; diff --git a/src/WpStarter/Collections/Arr.php b/src/WpStarter/Collections/Arr.php index 59ef08c..b61222e 100644 --- a/src/WpStarter/Collections/Arr.php +++ b/src/WpStarter/Collections/Arr.php @@ -180,7 +180,7 @@ public static function exists($array, $key) * @param mixed $default * @return mixed */ - public static function first($array, callable $callback = null, $default = null) + public static function first($array, ?callable $callback = null, $default = null) { if (is_null($callback)) { if (empty($array)) { @@ -209,7 +209,7 @@ public static function first($array, callable $callback = null, $default = null) * @param mixed $default * @return mixed */ - public static function last($array, callable $callback = null, $default = null) + public static function last($array, ?callable $callback = null, $default = null) { if (is_null($callback)) { return empty($array) ? ws_value($default) : end($array); diff --git a/src/WpStarter/Collections/Collection.php b/src/WpStarter/Collections/Collection.php index c5b1ac6..22a7ab1 100644 --- a/src/WpStarter/Collections/Collection.php +++ b/src/WpStarter/Collections/Collection.php @@ -352,7 +352,7 @@ public function except($keys) * @param callable|null $callback * @return static */ - public function filter(callable $callback = null) + public function filter(?callable $callback = null) { if ($callback) { return new static(Arr::where($this->items, $callback)); @@ -368,7 +368,7 @@ public function filter(callable $callback = null) * @param mixed $default * @return mixed */ - public function first(callable $callback = null, $default = null) + public function first(?callable $callback = null, $default = null) { return Arr::first($this->items, $callback, $default); } @@ -665,7 +665,7 @@ public function keys() * @param mixed $default * @return mixed */ - public function last(callable $callback = null, $default = null) + public function last(?callable $callback = null, $default = null) { return Arr::last($this->items, $callback, $default); } diff --git a/src/WpStarter/Collections/Enumerable.php b/src/WpStarter/Collections/Enumerable.php index a2a04ed..e11d7da 100644 --- a/src/WpStarter/Collections/Enumerable.php +++ b/src/WpStarter/Collections/Enumerable.php @@ -25,7 +25,7 @@ public static function make($items = []); * @param callable|null $callback * @return static */ - public static function times($number, callable $callback = null); + public static function times($number, ?callable $callback = null); /** * Create a collection with the given range. @@ -265,7 +265,7 @@ public function except($keys); * @param callable|null $callback * @return static */ - public function filter(callable $callback = null); + public function filter(?callable $callback = null); /** * Apply the callback if the value is truthy. @@ -275,7 +275,7 @@ public function filter(callable $callback = null); * @param callable|null $default * @return static|mixed */ - public function when($value, callable $callback, callable $default = null); + public function when($value, callable $callback, ?callable $default = null); /** * Apply the callback if the collection is empty. @@ -284,7 +284,7 @@ public function when($value, callable $callback, callable $default = null); * @param callable|null $default * @return static|mixed */ - public function whenEmpty(callable $callback, callable $default = null); + public function whenEmpty(callable $callback, ?callable $default = null); /** * Apply the callback if the collection is not empty. @@ -293,7 +293,7 @@ public function whenEmpty(callable $callback, callable $default = null); * @param callable|null $default * @return static|mixed */ - public function whenNotEmpty(callable $callback, callable $default = null); + public function whenNotEmpty(callable $callback, ?callable $default = null); /** * Apply the callback if the value is falsy. @@ -303,7 +303,7 @@ public function whenNotEmpty(callable $callback, callable $default = null); * @param callable|null $default * @return static|mixed */ - public function unless($value, callable $callback, callable $default = null); + public function unless($value, callable $callback, ?callable $default = null); /** * Apply the callback unless the collection is empty. @@ -312,7 +312,7 @@ public function unless($value, callable $callback, callable $default = null); * @param callable|null $default * @return static|mixed */ - public function unlessEmpty(callable $callback, callable $default = null); + public function unlessEmpty(callable $callback, ?callable $default = null); /** * Apply the callback unless the collection is not empty. @@ -321,7 +321,7 @@ public function unlessEmpty(callable $callback, callable $default = null); * @param callable|null $default * @return static|mixed */ - public function unlessNotEmpty(callable $callback, callable $default = null); + public function unlessNotEmpty(callable $callback, ?callable $default = null); /** * Filter items by the given key value pair. @@ -429,7 +429,7 @@ public function whereInstanceOf($type); * @param mixed $default * @return mixed */ - public function first(callable $callback = null, $default = null); + public function first(?callable $callback = null, $default = null); /** * Get the first item by the given key value pair. @@ -552,7 +552,7 @@ public function keys(); * @param mixed $default * @return mixed */ - public function last(callable $callback = null, $default = null); + public function last(?callable $callback = null, $default = null); /** * Run a map over each of the items. diff --git a/src/WpStarter/Collections/LazyCollection.php b/src/WpStarter/Collections/LazyCollection.php index fb3f71c..56ad2ab 100644 --- a/src/WpStarter/Collections/LazyCollection.php +++ b/src/WpStarter/Collections/LazyCollection.php @@ -367,7 +367,7 @@ public function except($keys) * @param callable|null $callback * @return static */ - public function filter(callable $callback = null) + public function filter(?callable $callback = null) { if (is_null($callback)) { $callback = function ($value) { @@ -391,7 +391,7 @@ public function filter(callable $callback = null) * @param mixed $default * @return mixed */ - public function first(callable $callback = null, $default = null) + public function first(?callable $callback = null, $default = null) { $iterator = $this->getIterator(); @@ -632,7 +632,7 @@ public function keys() * @param mixed $default * @return mixed */ - public function last(callable $callback = null, $default = null) + public function last(?callable $callback = null, $default = null) { $needle = $placeholder = new stdClass; diff --git a/src/WpStarter/Collections/Traits/EnumeratesValues.php b/src/WpStarter/Collections/Traits/EnumeratesValues.php index 229006c..a1c9dbe 100644 --- a/src/WpStarter/Collections/Traits/EnumeratesValues.php +++ b/src/WpStarter/Collections/Traits/EnumeratesValues.php @@ -141,7 +141,7 @@ public static function empty() * @param callable|null $callback * @return static */ - public static function times($number, callable $callback = null) + public static function times($number, ?callable $callback = null) { if ($number < 1) { return new static; @@ -472,7 +472,7 @@ public function sum($callback = null) * @param callable|null $default * @return static|mixed */ - public function when($value, callable $callback = null, callable $default = null) + public function when($value, ?callable $callback = null, ?callable $default = null) { if (! $callback) { return new HigherOrderWhenProxy($this, $value); @@ -494,7 +494,7 @@ public function when($value, callable $callback = null, callable $default = null * @param callable|null $default * @return static|mixed */ - public function whenEmpty(callable $callback, callable $default = null) + public function whenEmpty(callable $callback, ?callable $default = null) { return $this->when($this->isEmpty(), $callback, $default); } @@ -506,7 +506,7 @@ public function whenEmpty(callable $callback, callable $default = null) * @param callable|null $default * @return static|mixed */ - public function whenNotEmpty(callable $callback, callable $default = null) + public function whenNotEmpty(callable $callback, ?callable $default = null) { return $this->when($this->isNotEmpty(), $callback, $default); } @@ -519,7 +519,7 @@ public function whenNotEmpty(callable $callback, callable $default = null) * @param callable|null $default * @return static|mixed */ - public function unless($value, callable $callback, callable $default = null) + public function unless($value, callable $callback, ?callable $default = null) { return $this->when(! $value, $callback, $default); } @@ -531,7 +531,7 @@ public function unless($value, callable $callback, callable $default = null) * @param callable|null $default * @return static|mixed */ - public function unlessEmpty(callable $callback, callable $default = null) + public function unlessEmpty(callable $callback, ?callable $default = null) { return $this->whenNotEmpty($callback, $default); } @@ -543,7 +543,7 @@ public function unlessEmpty(callable $callback, callable $default = null) * @param callable|null $default * @return static|mixed */ - public function unlessNotEmpty(callable $callback, callable $default = null) + public function unlessNotEmpty(callable $callback, ?callable $default = null) { return $this->whenEmpty($callback, $default); } diff --git a/src/WpStarter/Console/Application.php b/src/WpStarter/Console/Application.php index f5460fb..1c966a8 100644 --- a/src/WpStarter/Console/Application.php +++ b/src/WpStarter/Console/Application.php @@ -79,7 +79,7 @@ public function __construct(Container $laravel, Dispatcher $events, $version) * * @return int */ - public function run(InputInterface $input = null, OutputInterface $output = null) + public function run(?InputInterface $input = null, ?OutputInterface $output = null) { $commandName = $this->getCommandName( $input = $input ?: new ArgvInput diff --git a/src/WpStarter/Container/Container.php b/src/WpStarter/Container/Container.php index 81391a5..1c1e2da 100644 --- a/src/WpStarter/Container/Container.php +++ b/src/WpStarter/Container/Container.php @@ -1111,7 +1111,7 @@ protected function unresolvablePrimitive(ReflectionParameter $parameter) * @param \Closure|null $callback * @return void */ - public function beforeResolving($abstract, Closure $callback = null) + public function beforeResolving($abstract, ?Closure $callback = null) { if (is_string($abstract)) { $abstract = $this->getAlias($abstract); @@ -1131,7 +1131,7 @@ public function beforeResolving($abstract, Closure $callback = null) * @param \Closure|null $callback * @return void */ - public function resolving($abstract, Closure $callback = null) + public function resolving($abstract, ?Closure $callback = null) { if (is_string($abstract)) { $abstract = $this->getAlias($abstract); @@ -1151,7 +1151,7 @@ public function resolving($abstract, Closure $callback = null) * @param \Closure|null $callback * @return void */ - public function afterResolving($abstract, Closure $callback = null) + public function afterResolving($abstract, ?Closure $callback = null) { if (is_string($abstract)) { $abstract = $this->getAlias($abstract); @@ -1390,7 +1390,7 @@ public static function getInstance() * @param \WpStarter\Contracts\Container\Container|null $container * @return \WpStarter\Contracts\Container\Container|static */ - public static function setInstance(ContainerContract $container = null) + public static function setInstance(?ContainerContract $container = null) { return static::$instance = $container; } diff --git a/src/WpStarter/Contracts/Auth/Access/Gate.php b/src/WpStarter/Contracts/Auth/Access/Gate.php index 8c80d88..a28d97a 100644 --- a/src/WpStarter/Contracts/Auth/Access/Gate.php +++ b/src/WpStarter/Contracts/Auth/Access/Gate.php @@ -29,7 +29,7 @@ public function define($ability, $callback); * @param array|null $abilities * @return $this */ - public function resource($name, $class, array $abilities = null); + public function resource($name, $class, ?array $abilities = null); /** * Define a policy class for a given class type. diff --git a/src/WpStarter/Contracts/Auth/PasswordBroker.php b/src/WpStarter/Contracts/Auth/PasswordBroker.php index 7c57816..330a0fc 100644 --- a/src/WpStarter/Contracts/Auth/PasswordBroker.php +++ b/src/WpStarter/Contracts/Auth/PasswordBroker.php @@ -48,7 +48,7 @@ interface PasswordBroker * @param \Closure|null $callback * @return string */ - public function sendResetLink(array $credentials, Closure $callback = null); + public function sendResetLink(array $credentials, ?Closure $callback = null); /** * Reset the password for the given token. diff --git a/src/WpStarter/Contracts/Container/Container.php b/src/WpStarter/Contracts/Container/Container.php index e56ba98..8e89f1e 100644 --- a/src/WpStarter/Contracts/Container/Container.php +++ b/src/WpStarter/Contracts/Container/Container.php @@ -170,7 +170,7 @@ public function resolved($abstract); * @param \Closure|null $callback * @return void */ - public function resolving($abstract, Closure $callback = null); + public function resolving($abstract, ?Closure $callback = null); /** * Register a new after resolving callback. @@ -179,5 +179,5 @@ public function resolving($abstract, Closure $callback = null); * @param \Closure|null $callback * @return void */ - public function afterResolving($abstract, Closure $callback = null); + public function afterResolving($abstract, ?Closure $callback = null); } diff --git a/src/WpStarter/Database/Capsule/Manager.php b/src/WpStarter/Database/Capsule/Manager.php index 0ad211d..8e4a5ce 100644 --- a/src/WpStarter/Database/Capsule/Manager.php +++ b/src/WpStarter/Database/Capsule/Manager.php @@ -27,7 +27,7 @@ class Manager * @param \WpStarter\Container\Container|null $container * @return void */ - public function __construct(Container $container = null) + public function __construct(?Container $container = null) { $this->setupContainer($container ?: new Container); diff --git a/src/WpStarter/Database/Eloquent/Builder.php b/src/WpStarter/Database/Eloquent/Builder.php index 55a6335..9e32c43 100644 --- a/src/WpStarter/Database/Eloquent/Builder.php +++ b/src/WpStarter/Database/Eloquent/Builder.php @@ -191,7 +191,7 @@ public function withoutGlobalScope($scope) * @param array|null $scopes * @return $this */ - public function withoutGlobalScopes(array $scopes = null) + public function withoutGlobalScopes(?array $scopes = null) { if (! is_array($scopes)) { $scopes = array_keys($this->scopes); @@ -536,7 +536,7 @@ public function firstOrFail($columns = ['*']) * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Model|static|mixed */ - public function firstOr($columns = ['*'], Closure $callback = null) + public function firstOr($columns = ['*'], ?Closure $callback = null) { if ($columns instanceof Closure) { $callback = $columns; diff --git a/src/WpStarter/Database/Eloquent/Casts/Attribute.php b/src/WpStarter/Database/Eloquent/Casts/Attribute.php index a4e2839..5935851 100644 --- a/src/WpStarter/Database/Eloquent/Casts/Attribute.php +++ b/src/WpStarter/Database/Eloquent/Casts/Attribute.php @@ -32,7 +32,7 @@ class Attribute * @param callable|null $set * @return void */ - public function __construct(callable $get = null, callable $set = null) + public function __construct(?callable $get = null, ?callable $set = null) { $this->get = $get; $this->set = $set; diff --git a/src/WpStarter/Database/Eloquent/Concerns/HasGlobalScopes.php b/src/WpStarter/Database/Eloquent/Concerns/HasGlobalScopes.php index 552c1dd..9ef8c1a 100644 --- a/src/WpStarter/Database/Eloquent/Concerns/HasGlobalScopes.php +++ b/src/WpStarter/Database/Eloquent/Concerns/HasGlobalScopes.php @@ -18,7 +18,7 @@ trait HasGlobalScopes * * @throws \InvalidArgumentException */ - public static function addGlobalScope($scope, Closure $implementation = null) + public static function addGlobalScope($scope, ?Closure $implementation = null) { if (is_string($scope) && ! is_null($implementation)) { return static::$globalScopes[static::class][$scope] = $implementation; diff --git a/src/WpStarter/Database/Eloquent/Concerns/QueriesRelationships.php b/src/WpStarter/Database/Eloquent/Concerns/QueriesRelationships.php index 67dc1cc..408c337 100644 --- a/src/WpStarter/Database/Eloquent/Concerns/QueriesRelationships.php +++ b/src/WpStarter/Database/Eloquent/Concerns/QueriesRelationships.php @@ -27,7 +27,7 @@ trait QueriesRelationships * * @throws \RuntimeException */ - public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null) + public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', ?Closure $callback = null) { if (is_string($relation)) { if (strpos($relation, '.') !== false) { @@ -120,7 +120,7 @@ public function orHas($relation, $operator = '>=', $count = 1) * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function doesntHave($relation, $boolean = 'and', Closure $callback = null) + public function doesntHave($relation, $boolean = 'and', ?Closure $callback = null) { return $this->has($relation, '<', 1, $boolean, $callback); } @@ -145,7 +145,7 @@ public function orDoesntHave($relation) * @param int $count * @return \WpStarter\Database\Eloquent\Builder|static */ - public function whereHas($relation, Closure $callback = null, $operator = '>=', $count = 1) + public function whereHas($relation, ?Closure $callback = null, $operator = '>=', $count = 1) { return $this->has($relation, $operator, $count, 'and', $callback); } @@ -159,7 +159,7 @@ public function whereHas($relation, Closure $callback = null, $operator = '>=', * @param int $count * @return \WpStarter\Database\Eloquent\Builder|static */ - public function orWhereHas($relation, Closure $callback = null, $operator = '>=', $count = 1) + public function orWhereHas($relation, ?Closure $callback = null, $operator = '>=', $count = 1) { return $this->has($relation, $operator, $count, 'or', $callback); } @@ -171,7 +171,7 @@ public function orWhereHas($relation, Closure $callback = null, $operator = '>=' * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function whereDoesntHave($relation, Closure $callback = null) + public function whereDoesntHave($relation, ?Closure $callback = null) { return $this->doesntHave($relation, 'and', $callback); } @@ -183,7 +183,7 @@ public function whereDoesntHave($relation, Closure $callback = null) * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function orWhereDoesntHave($relation, Closure $callback = null) + public function orWhereDoesntHave($relation, ?Closure $callback = null) { return $this->doesntHave($relation, 'or', $callback); } @@ -199,7 +199,7 @@ public function orWhereDoesntHave($relation, Closure $callback = null) * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function hasMorph($relation, $types, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null) + public function hasMorph($relation, $types, $operator = '>=', $count = 1, $boolean = 'and', ?Closure $callback = null) { if (is_string($relation)) { $relation = $this->getRelationWithoutConstraints($relation); @@ -278,7 +278,7 @@ public function orHasMorph($relation, $types, $operator = '>=', $count = 1) * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function doesntHaveMorph($relation, $types, $boolean = 'and', Closure $callback = null) + public function doesntHaveMorph($relation, $types, $boolean = 'and', ?Closure $callback = null) { return $this->hasMorph($relation, $types, '<', 1, $boolean, $callback); } @@ -305,7 +305,7 @@ public function orDoesntHaveMorph($relation, $types) * @param int $count * @return \WpStarter\Database\Eloquent\Builder|static */ - public function whereHasMorph($relation, $types, Closure $callback = null, $operator = '>=', $count = 1) + public function whereHasMorph($relation, $types, ?Closure $callback = null, $operator = '>=', $count = 1) { return $this->hasMorph($relation, $types, $operator, $count, 'and', $callback); } @@ -320,7 +320,7 @@ public function whereHasMorph($relation, $types, Closure $callback = null, $oper * @param int $count * @return \WpStarter\Database\Eloquent\Builder|static */ - public function orWhereHasMorph($relation, $types, Closure $callback = null, $operator = '>=', $count = 1) + public function orWhereHasMorph($relation, $types, ?Closure $callback = null, $operator = '>=', $count = 1) { return $this->hasMorph($relation, $types, $operator, $count, 'or', $callback); } @@ -333,7 +333,7 @@ public function orWhereHasMorph($relation, $types, Closure $callback = null, $op * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function whereDoesntHaveMorph($relation, $types, Closure $callback = null) + public function whereDoesntHaveMorph($relation, $types, ?Closure $callback = null) { return $this->doesntHaveMorph($relation, $types, 'and', $callback); } @@ -346,7 +346,7 @@ public function whereDoesntHaveMorph($relation, $types, Closure $callback = null * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function orWhereDoesntHaveMorph($relation, $types, Closure $callback = null) + public function orWhereDoesntHaveMorph($relation, $types, ?Closure $callback = null) { return $this->doesntHaveMorph($relation, $types, 'or', $callback); } diff --git a/src/WpStarter/Database/Eloquent/Model.php b/src/WpStarter/Database/Eloquent/Model.php index ee2e6a7..fd44417 100644 --- a/src/WpStarter/Database/Eloquent/Model.php +++ b/src/WpStarter/Database/Eloquent/Model.php @@ -1564,7 +1564,7 @@ public function refresh() * @param array|null $except * @return static */ - public function replicate(array $except = null) + public function replicate(?array $except = null) { $defaults = [ $this->getKeyName(), diff --git a/src/WpStarter/Database/Eloquent/Relations/BelongsToMany.php b/src/WpStarter/Database/Eloquent/Relations/BelongsToMany.php index a749f40..5fa494c 100644 --- a/src/WpStarter/Database/Eloquent/Relations/BelongsToMany.php +++ b/src/WpStarter/Database/Eloquent/Relations/BelongsToMany.php @@ -760,7 +760,7 @@ public function firstOrFail($columns = ['*']) * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Model|static|mixed */ - public function firstOr($columns = ['*'], Closure $callback = null) + public function firstOr($columns = ['*'], ?Closure $callback = null) { if ($columns instanceof Closure) { $callback = $columns; diff --git a/src/WpStarter/Database/Eloquent/Relations/HasManyThrough.php b/src/WpStarter/Database/Eloquent/Relations/HasManyThrough.php index f0e5077..65502e8 100644 --- a/src/WpStarter/Database/Eloquent/Relations/HasManyThrough.php +++ b/src/WpStarter/Database/Eloquent/Relations/HasManyThrough.php @@ -102,7 +102,7 @@ public function addConstraints() * @param \WpStarter\Database\Eloquent\Builder|null $query * @return void */ - protected function performJoin(Builder $query = null) + protected function performJoin(?Builder $query = null) { $query = $query ?: $this->query; diff --git a/src/WpStarter/Database/Eloquent/Relations/Relation.php b/src/WpStarter/Database/Eloquent/Relations/Relation.php index e71206d..2a77678 100644 --- a/src/WpStarter/Database/Eloquent/Relations/Relation.php +++ b/src/WpStarter/Database/Eloquent/Relations/Relation.php @@ -425,7 +425,7 @@ public static function enforceMorphMap(array $map, $merge = true) * @param bool $merge * @return array */ - public static function morphMap(array $map = null, $merge = true) + public static function morphMap(?array $map = null, $merge = true) { $map = static::buildMorphMapFromModels($map); @@ -443,7 +443,7 @@ public static function morphMap(array $map = null, $merge = true) * @param string[]|null $models * @return array|null */ - protected static function buildMorphMapFromModels(array $models = null) + protected static function buildMorphMapFromModels(?array $models = null) { if (is_null($models) || Arr::isAssoc($models)) { return $models; diff --git a/src/WpStarter/Database/Migrations/Migrator.php b/src/WpStarter/Database/Migrations/Migrator.php index ce43a3c..62898de 100644 --- a/src/WpStarter/Database/Migrations/Migrator.php +++ b/src/WpStarter/Database/Migrations/Migrator.php @@ -80,7 +80,7 @@ class Migrator public function __construct(MigrationRepositoryInterface $repository, Resolver $resolver, Filesystem $files, - Dispatcher $dispatcher = null) + ?Dispatcher $dispatcher = null) { $this->files = $files; $this->events = $dispatcher; diff --git a/src/WpStarter/Database/MySqlConnection.php b/src/WpStarter/Database/MySqlConnection.php index aa10333..63289bb 100644 --- a/src/WpStarter/Database/MySqlConnection.php +++ b/src/WpStarter/Database/MySqlConnection.php @@ -66,7 +66,7 @@ protected function getDefaultSchemaGrammar() * @param callable|null $processFactory * @return \WpStarter\Database\Schema\MySqlSchemaState */ - public function getSchemaState(Filesystem $files = null, callable $processFactory = null) + public function getSchemaState(?Filesystem $files = null, ?callable $processFactory = null) { return new MySqlSchemaState($this, $files, $processFactory); } diff --git a/src/WpStarter/Database/PostgresConnection.php b/src/WpStarter/Database/PostgresConnection.php index ee1983b..7b73156 100644 --- a/src/WpStarter/Database/PostgresConnection.php +++ b/src/WpStarter/Database/PostgresConnection.php @@ -82,7 +82,7 @@ protected function getDefaultSchemaGrammar() * @param callable|null $processFactory * @return \WpStarter\Database\Schema\PostgresSchemaState */ - public function getSchemaState(Filesystem $files = null, callable $processFactory = null) + public function getSchemaState(?Filesystem $files = null, ?callable $processFactory = null) { return new PostgresSchemaState($this, $files, $processFactory); } diff --git a/src/WpStarter/Database/Query/Builder.php b/src/WpStarter/Database/Query/Builder.php index 53807ea..c201691 100644 --- a/src/WpStarter/Database/Query/Builder.php +++ b/src/WpStarter/Database/Query/Builder.php @@ -228,8 +228,8 @@ class Builder * @return void */ public function __construct(ConnectionInterface $connection, - Grammar $grammar = null, - Processor $processor = null) + ?Grammar $grammar = null, + ?Processor $processor = null) { $this->connection = $connection; $this->grammar = $grammar ?: $connection->getQueryGrammar(); diff --git a/src/WpStarter/Database/SQLiteConnection.php b/src/WpStarter/Database/SQLiteConnection.php index 84db126..a0381db 100644 --- a/src/WpStarter/Database/SQLiteConnection.php +++ b/src/WpStarter/Database/SQLiteConnection.php @@ -80,7 +80,7 @@ protected function getDefaultSchemaGrammar() * * @throws \RuntimeException */ - public function getSchemaState(Filesystem $files = null, callable $processFactory = null) + public function getSchemaState(?Filesystem $files = null, ?callable $processFactory = null) { return new SqliteSchemaState($this, $files, $processFactory); } diff --git a/src/WpStarter/Database/Schema/Blueprint.php b/src/WpStarter/Database/Schema/Blueprint.php index 387fc0d..0af2dd6 100644 --- a/src/WpStarter/Database/Schema/Blueprint.php +++ b/src/WpStarter/Database/Schema/Blueprint.php @@ -86,7 +86,7 @@ class Blueprint * @param string $prefix * @return void */ - public function __construct($table, Closure $callback = null, $prefix = '') + public function __construct($table, ?Closure $callback = null, $prefix = '') { $this->table = $table; $this->prefix = $prefix; diff --git a/src/WpStarter/Database/Schema/Builder.php b/src/WpStarter/Database/Schema/Builder.php index 64699aa..f9586db 100644 --- a/src/WpStarter/Database/Schema/Builder.php +++ b/src/WpStarter/Database/Schema/Builder.php @@ -371,7 +371,7 @@ protected function build(Blueprint $blueprint) * @param \Closure|null $callback * @return \WpStarter\Database\Schema\Blueprint */ - protected function createBlueprint($table, Closure $callback = null) + protected function createBlueprint($table, ?Closure $callback = null) { $prefix = $this->connection->getConfig('prefix_indexes') ? $this->connection->getConfig('prefix') diff --git a/src/WpStarter/Database/Schema/SchemaState.php b/src/WpStarter/Database/Schema/SchemaState.php index 9e7ba8f..8352320 100644 --- a/src/WpStarter/Database/Schema/SchemaState.php +++ b/src/WpStarter/Database/Schema/SchemaState.php @@ -51,7 +51,7 @@ abstract class SchemaState * @param callable|null $processFactory * @return void */ - public function __construct(Connection $connection, Filesystem $files = null, callable $processFactory = null) + public function __construct(Connection $connection, ?Filesystem $files = null, ?callable $processFactory = null) { $this->connection = $connection; diff --git a/src/WpStarter/Database/SqlServerConnection.php b/src/WpStarter/Database/SqlServerConnection.php index 2119153..0418e5f 100644 --- a/src/WpStarter/Database/SqlServerConnection.php +++ b/src/WpStarter/Database/SqlServerConnection.php @@ -98,7 +98,7 @@ protected function getDefaultSchemaGrammar() * * @throws \RuntimeException */ - public function getSchemaState(Filesystem $files = null, callable $processFactory = null) + public function getSchemaState(?Filesystem $files = null, ?callable $processFactory = null) { throw new RuntimeException('Schema dumping is not supported when using SQL Server.'); } diff --git a/src/WpStarter/Events/Dispatcher.php b/src/WpStarter/Events/Dispatcher.php index f53ffe8..ff00f5e 100644 --- a/src/WpStarter/Events/Dispatcher.php +++ b/src/WpStarter/Events/Dispatcher.php @@ -62,7 +62,7 @@ class Dispatcher implements DispatcherContract * @param \WpStarter\Contracts\Container\Container|null $container * @return void */ - public function __construct(ContainerContract $container = null) + public function __construct(?ContainerContract $container = null) { $this->container = $container ?: new Container; } diff --git a/src/WpStarter/Foundation/Bootstrap/SetRequestForConsole.php b/src/WpStarter/Foundation/Bootstrap/SetRequestForConsole.php index 55fa031..182ad77 100644 --- a/src/WpStarter/Foundation/Bootstrap/SetRequestForConsole.php +++ b/src/WpStarter/Foundation/Bootstrap/SetRequestForConsole.php @@ -16,7 +16,7 @@ class SetRequestForConsole public function bootstrap(Application $app) { $uri = $app->make('config')->get('app.url', 'http://localhost'); - + $uri = (string) $uri; $components = parse_url($uri); $server = $_SERVER; diff --git a/src/WpStarter/Foundation/Http/Exceptions/MaintenanceModeException.php b/src/WpStarter/Foundation/Http/Exceptions/MaintenanceModeException.php index eea4f26..95aa796 100644 --- a/src/WpStarter/Foundation/Http/Exceptions/MaintenanceModeException.php +++ b/src/WpStarter/Foundation/Http/Exceptions/MaintenanceModeException.php @@ -43,7 +43,7 @@ class MaintenanceModeException extends ServiceUnavailableHttpException * @param int $code * @return void */ - public function __construct($time, $retryAfter = null, $message = null, Throwable $previous = null, $code = 0) + public function __construct($time, $retryAfter = null, $message = null, ?Throwable $previous = null, $code = 0) { parent::__construct($retryAfter, $message, $previous, $code); diff --git a/src/WpStarter/Foundation/Http/FormRequest.php b/src/WpStarter/Foundation/Http/FormRequest.php index 97e9f61..0ea2d85 100644 --- a/src/WpStarter/Foundation/Http/FormRequest.php +++ b/src/WpStarter/Foundation/Http/FormRequest.php @@ -196,7 +196,7 @@ protected function failedAuthorization() * @param array|null $keys * @return \WpStarter\Support\ValidatedInput|array */ - public function safe(array $keys = null) + public function safe(?array $keys = null) { return is_array($keys) ? $this->validator->safe()->only($keys) diff --git a/src/WpStarter/Foundation/Testing/Concerns/InteractsWithContainer.php b/src/WpStarter/Foundation/Testing/Concerns/InteractsWithContainer.php index a2d636d..51b27c6 100644 --- a/src/WpStarter/Foundation/Testing/Concerns/InteractsWithContainer.php +++ b/src/WpStarter/Foundation/Testing/Concerns/InteractsWithContainer.php @@ -48,7 +48,7 @@ protected function instance($abstract, $instance) * @param \Closure|null $mock * @return \Mockery\MockInterface */ - protected function mock($abstract, Closure $mock = null) + protected function mock($abstract, ?Closure $mock = null) { return $this->instance($abstract, Mockery::mock(...array_filter(func_get_args()))); } @@ -60,7 +60,7 @@ protected function mock($abstract, Closure $mock = null) * @param \Closure|null $mock * @return \Mockery\MockInterface */ - protected function partialMock($abstract, Closure $mock = null) + protected function partialMock($abstract, ?Closure $mock = null) { return $this->instance($abstract, Mockery::mock(...array_filter(func_get_args()))->makePartial()); } @@ -72,7 +72,7 @@ protected function partialMock($abstract, Closure $mock = null) * @param \Closure|null $mock * @return \Mockery\MockInterface */ - protected function spy($abstract, Closure $mock = null) + protected function spy($abstract, ?Closure $mock = null) { return $this->instance($abstract, Mockery::spy(...array_filter(func_get_args()))); } diff --git a/src/WpStarter/Foundation/Validation/ValidatesRequests.php b/src/WpStarter/Foundation/Validation/ValidatesRequests.php index 7a26867..6870775 100644 --- a/src/WpStarter/Foundation/Validation/ValidatesRequests.php +++ b/src/WpStarter/Foundation/Validation/ValidatesRequests.php @@ -17,7 +17,7 @@ trait ValidatesRequests * * @throws \WpStarter\Validation\ValidationException */ - public function validateWith($validator, Request $request = null) + public function validateWith($validator, ?Request $request = null) { $request = $request ?: ws_request(); diff --git a/src/WpStarter/Http/Client/Factory.php b/src/WpStarter/Http/Client/Factory.php index cfe35a0..a83bb0c 100644 --- a/src/WpStarter/Http/Client/Factory.php +++ b/src/WpStarter/Http/Client/Factory.php @@ -98,7 +98,7 @@ class Factory * @param \WpStarter\Contracts\Events\Dispatcher|null $dispatcher * @return void */ - public function __construct(Dispatcher $dispatcher = null) + public function __construct(?Dispatcher $dispatcher = null) { $this->dispatcher = $dispatcher; diff --git a/src/WpStarter/Http/Client/PendingRequest.php b/src/WpStarter/Http/Client/PendingRequest.php index 53e07de..6bf5865 100644 --- a/src/WpStarter/Http/Client/PendingRequest.php +++ b/src/WpStarter/Http/Client/PendingRequest.php @@ -170,7 +170,7 @@ class PendingRequest * @param \WpStarter\Http\Client\Factory|null $factory * @return void */ - public function __construct(Factory $factory = null) + public function __construct(?Factory $factory = null) { $this->factory = $factory; $this->middleware = new Collection; diff --git a/src/WpStarter/Http/Client/Pool.php b/src/WpStarter/Http/Client/Pool.php index c919839..acfacb2 100644 --- a/src/WpStarter/Http/Client/Pool.php +++ b/src/WpStarter/Http/Client/Pool.php @@ -36,7 +36,7 @@ class Pool * @param \WpStarter\Http\Client\Factory|null $factory * @return void */ - public function __construct(Factory $factory = null) + public function __construct(?Factory $factory = null) { $this->factory = $factory ?: new Factory(); diff --git a/src/WpStarter/Http/Concerns/InteractsWithInput.php b/src/WpStarter/Http/Concerns/InteractsWithInput.php index 0a777b8..3e3a28a 100644 --- a/src/WpStarter/Http/Concerns/InteractsWithInput.php +++ b/src/WpStarter/Http/Concerns/InteractsWithInput.php @@ -120,7 +120,7 @@ public function hasAny($keys) * @param callable|null $default * @return $this|mixed */ - public function whenHas($key, callable $callback, callable $default = null) + public function whenHas($key, ?callable $callback, ?callable $default = null) { if ($this->has($key)) { return $callback(ws_data_get($this->all(), $key)) ?: $this; @@ -198,7 +198,7 @@ public function anyFilled($keys) * @param callable|null $default * @return $this|mixed */ - public function whenFilled($key, callable $callback, callable $default = null) + public function whenFilled($key, ?callable $callback, ?callable $default = null) { if ($this->filled($key)) { return $callback(ws_data_get($this->all(), $key)) ?: $this; diff --git a/src/WpStarter/Http/Exceptions/PostTooLargeException.php b/src/WpStarter/Http/Exceptions/PostTooLargeException.php index f278428..f22ad8f 100644 --- a/src/WpStarter/Http/Exceptions/PostTooLargeException.php +++ b/src/WpStarter/Http/Exceptions/PostTooLargeException.php @@ -16,7 +16,7 @@ class PostTooLargeException extends HttpException * @param int $code * @return void */ - public function __construct($message = null, Throwable $previous = null, array $headers = [], $code = 0) + public function __construct($message = null, ?Throwable $previous = null, array $headers = [], $code = 0) { parent::__construct(413, $message, $previous, $headers, $code); } diff --git a/src/WpStarter/Http/Exceptions/ThrottleRequestsException.php b/src/WpStarter/Http/Exceptions/ThrottleRequestsException.php index 4e57f2b..81a37f7 100644 --- a/src/WpStarter/Http/Exceptions/ThrottleRequestsException.php +++ b/src/WpStarter/Http/Exceptions/ThrottleRequestsException.php @@ -16,7 +16,7 @@ class ThrottleRequestsException extends TooManyRequestsHttpException * @param int $code * @return void */ - public function __construct($message = null, Throwable $previous = null, array $headers = [], $code = 0) + public function __construct($message = null, ?Throwable $previous = null, array $headers = [], $code = 0) { parent::__construct(null, $message, $previous, $code, $headers); } diff --git a/src/WpStarter/Http/RedirectResponse.php b/src/WpStarter/Http/RedirectResponse.php index 9b42b21..529c8dd 100644 --- a/src/WpStarter/Http/RedirectResponse.php +++ b/src/WpStarter/Http/RedirectResponse.php @@ -71,7 +71,7 @@ public function withCookies(array $cookies) * @param array|null $input * @return $this */ - public function withInput(array $input = null) + public function withInput(?array $input = null) { $this->session->flashInput($this->removeFilesFromInput( ! is_null($input) ? $input : $this->request->input() diff --git a/src/WpStarter/Http/Request.php b/src/WpStarter/Http/Request.php index d1945e1..f4637ad 100644 --- a/src/WpStarter/Http/Request.php +++ b/src/WpStarter/Http/Request.php @@ -502,7 +502,7 @@ public static function createFromBase(SymfonyRequest $request) * * @return static */ - public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null) + public function duplicate(?array $query = null, ?array $request = null, ?array $attributes = null, ?array $cookies = null, ?array $files = null, ?array $server = null) { return parent::duplicate($query, $request, $attributes, $cookies, $this->filterFiles($files), $server); } diff --git a/src/WpStarter/Log/Logger.php b/src/WpStarter/Log/Logger.php index b252990..f1ee49c 100644 --- a/src/WpStarter/Log/Logger.php +++ b/src/WpStarter/Log/Logger.php @@ -40,7 +40,7 @@ class Logger implements LoggerInterface * @param \WpStarter\Contracts\Events\Dispatcher|null $dispatcher * @return void */ - public function __construct(LoggerInterface $logger, Dispatcher $dispatcher = null) + public function __construct(LoggerInterface $logger, ?Dispatcher $dispatcher = null) { $this->logger = $logger; $this->dispatcher = $dispatcher; diff --git a/src/WpStarter/Mail/Mailer.php b/src/WpStarter/Mail/Mailer.php index 7c1128d..893712e 100644 --- a/src/WpStarter/Mail/Mailer.php +++ b/src/WpStarter/Mail/Mailer.php @@ -100,7 +100,7 @@ class Mailer implements MailerContract, MailQueueContract * @param \WpStarter\Contracts\Events\Dispatcher|null $events * @return void */ - public function __construct(string $name, Factory $views, Swift_Mailer $swift, Dispatcher $events = null) + public function __construct(string $name, Factory $views, Swift_Mailer $swift, ?Dispatcher $events = null) { $this->name = $name; $this->views = $views; diff --git a/src/WpStarter/Notifications/ChannelManager.php b/src/WpStarter/Notifications/ChannelManager.php index fd74990..9ff819b 100644 --- a/src/WpStarter/Notifications/ChannelManager.php +++ b/src/WpStarter/Notifications/ChannelManager.php @@ -47,7 +47,7 @@ public function send($notifiables, $notification) * @param array|null $channels * @return void */ - public function sendNow($notifiables, $notification, array $channels = null) + public function sendNow($notifiables, $notification, ?array $channels = null) { (new NotificationSender( $this, $this->container->make(Bus::class), $this->container->make(Dispatcher::class), $this->locale) diff --git a/src/WpStarter/Notifications/NotificationSender.php b/src/WpStarter/Notifications/NotificationSender.php index c5003f5..93e903c 100644 --- a/src/WpStarter/Notifications/NotificationSender.php +++ b/src/WpStarter/Notifications/NotificationSender.php @@ -87,7 +87,7 @@ public function send($notifiables, $notification) * @param array|null $channels * @return void */ - public function sendNow($notifiables, $notification, array $channels = null) + public function sendNow($notifiables, $notification, ?array $channels = null) { $notifiables = $this->formatNotifiables($notifiables); diff --git a/src/WpStarter/Notifications/RoutesNotifications.php b/src/WpStarter/Notifications/RoutesNotifications.php index 4f30e00..0ee9738 100644 --- a/src/WpStarter/Notifications/RoutesNotifications.php +++ b/src/WpStarter/Notifications/RoutesNotifications.php @@ -25,7 +25,7 @@ public function notify($instance) * @param array|null $channels * @return void */ - public function notifyNow($instance, array $channels = null) + public function notifyNow($instance, ?array $channels = null) { ws_app(Dispatcher::class)->sendNow($this, $instance, $channels); } diff --git a/src/WpStarter/Notifications/SendQueuedNotifications.php b/src/WpStarter/Notifications/SendQueuedNotifications.php index 9f81f55..f690791 100644 --- a/src/WpStarter/Notifications/SendQueuedNotifications.php +++ b/src/WpStarter/Notifications/SendQueuedNotifications.php @@ -65,7 +65,7 @@ class SendQueuedNotifications implements ShouldQueue * @param array|null $channels * @return void */ - public function __construct($notifiables, $notification, array $channels = null) + public function __construct($notifiables, $notification, ?array $channels = null) { $this->channels = $channels; $this->notification = $notification; diff --git a/src/WpStarter/Pipeline/Hub.php b/src/WpStarter/Pipeline/Hub.php index 491f524..23f43cb 100644 --- a/src/WpStarter/Pipeline/Hub.php +++ b/src/WpStarter/Pipeline/Hub.php @@ -28,7 +28,7 @@ class Hub implements HubContract * @param \WpStarter\Contracts\Container\Container|null $container * @return void */ - public function __construct(Container $container = null) + public function __construct(?Container $container = null) { $this->container = $container; } diff --git a/src/WpStarter/Pipeline/Pipeline.php b/src/WpStarter/Pipeline/Pipeline.php index d29d0f8..be7b951 100644 --- a/src/WpStarter/Pipeline/Pipeline.php +++ b/src/WpStarter/Pipeline/Pipeline.php @@ -44,7 +44,7 @@ class Pipeline implements PipelineContract * @param \WpStarter\Contracts\Container\Container|null $container * @return void */ - public function __construct(Container $container = null) + public function __construct(?Container $container = null) { $this->container = $container; } diff --git a/src/WpStarter/Queue/Capsule/Manager.php b/src/WpStarter/Queue/Capsule/Manager.php index 6b637be..5f544d7 100644 --- a/src/WpStarter/Queue/Capsule/Manager.php +++ b/src/WpStarter/Queue/Capsule/Manager.php @@ -28,7 +28,7 @@ class Manager * @param \WpStarter\Container\Container|null $container * @return void */ - public function __construct(Container $container = null) + public function __construct(?Container $container = null) { $this->setupContainer($container ?: new Container); diff --git a/src/WpStarter/Queue/Worker.php b/src/WpStarter/Queue/Worker.php index ef2da98..f52c4ac 100644 --- a/src/WpStarter/Queue/Worker.php +++ b/src/WpStarter/Queue/Worker.php @@ -107,7 +107,7 @@ public function __construct(QueueManager $manager, Dispatcher $events, ExceptionHandler $exceptions, callable $isDownForMaintenance, - callable $resetScope = null) + ?callable $resetScope = null) { $this->events = $events; $this->manager = $manager; diff --git a/src/WpStarter/Redis/Connections/PhpRedisConnection.php b/src/WpStarter/Redis/Connections/PhpRedisConnection.php index 8891588..da7f510 100644 --- a/src/WpStarter/Redis/Connections/PhpRedisConnection.php +++ b/src/WpStarter/Redis/Connections/PhpRedisConnection.php @@ -38,7 +38,7 @@ class PhpRedisConnection extends Connection implements ConnectionContract * @param array $config * @return void */ - public function __construct($client, callable $connector = null, array $config = []) + public function __construct($client, ?callable $connector = null, ?array $config = []) { $this->client = $client; $this->config = $config; @@ -398,7 +398,7 @@ public function sscan($key, $cursor, $options = []) * @param callable|null $callback * @return \Redis|array */ - public function pipeline(callable $callback = null) + public function pipeline(?callable $callback = null) { $pipeline = $this->client()->pipeline(); @@ -413,7 +413,7 @@ public function pipeline(callable $callback = null) * @param callable|null $callback * @return \Redis|array */ - public function transaction(callable $callback = null) + public function transaction(?callable $callback = null) { $transaction = $this->client()->multi(); diff --git a/src/WpStarter/Redis/Limiters/ConcurrencyLimiterBuilder.php b/src/WpStarter/Redis/Limiters/ConcurrencyLimiterBuilder.php index 1d7bc28..6bae0f1 100644 --- a/src/WpStarter/Redis/Limiters/ConcurrencyLimiterBuilder.php +++ b/src/WpStarter/Redis/Limiters/ConcurrencyLimiterBuilder.php @@ -105,7 +105,7 @@ public function block($timeout) * * @throws \WpStarter\Contracts\Redis\LimiterTimeoutException */ - public function then(callable $callback, callable $failure = null) + public function then(callable $callback, ?callable $failure = null) { try { return (new ConcurrencyLimiter( diff --git a/src/WpStarter/Redis/Limiters/DurationLimiterBuilder.php b/src/WpStarter/Redis/Limiters/DurationLimiterBuilder.php index 6971f15..a517167 100644 --- a/src/WpStarter/Redis/Limiters/DurationLimiterBuilder.php +++ b/src/WpStarter/Redis/Limiters/DurationLimiterBuilder.php @@ -105,7 +105,7 @@ public function block($timeout) * * @throws \WpStarter\Contracts\Redis\LimiterTimeoutException */ - public function then(callable $callback, callable $failure = null) + public function then(callable $callback, ?callable $failure = null) { try { return (new DurationLimiter( diff --git a/src/WpStarter/Routing/Router.php b/src/WpStarter/Routing/Router.php index 23535a0..3c693a3 100644 --- a/src/WpStarter/Routing/Router.php +++ b/src/WpStarter/Routing/Router.php @@ -128,7 +128,7 @@ class Router implements BindingRegistrar, RegistrarContract * @param \WpStarter\Container\Container|null $container * @return void */ - public function __construct(Dispatcher $events, Container $container = null) + public function __construct(Dispatcher $events, ?Container $container = null) { $this->events = $events; $this->routes = new RouteCollection; @@ -1018,7 +1018,7 @@ public function bind($key, $binder) * @param \Closure|null $callback * @return void */ - public function model($key, $class, Closure $callback = null) + public function model($key, $class, ?Closure $callback = null) { $this->bind($key, RouteBinding::forModel($this->container, $class, $callback)); } diff --git a/src/WpStarter/Session/DatabaseSessionHandler.php b/src/WpStarter/Session/DatabaseSessionHandler.php index 32a4ffc..ba2b9a1 100644 --- a/src/WpStarter/Session/DatabaseSessionHandler.php +++ b/src/WpStarter/Session/DatabaseSessionHandler.php @@ -59,7 +59,7 @@ class DatabaseSessionHandler implements ExistenceAwareInterface, SessionHandlerI * @param \WpStarter\Contracts\Container\Container|null $container * @return void */ - public function __construct(ConnectionInterface $connection, $table, $minutes, Container $container = null) + public function __construct(ConnectionInterface $connection, $table, $minutes, ?Container $container = null) { $this->table = $table; $this->minutes = $minutes; diff --git a/src/WpStarter/Session/Middleware/StartSession.php b/src/WpStarter/Session/Middleware/StartSession.php index 24dd329..8006e9d 100644 --- a/src/WpStarter/Session/Middleware/StartSession.php +++ b/src/WpStarter/Session/Middleware/StartSession.php @@ -35,7 +35,7 @@ class StartSession * @param callable|null $cacheFactoryResolver * @return void */ - public function __construct(SessionManager $manager, callable $cacheFactoryResolver = null) + public function __construct(SessionManager $manager, ?callable $cacheFactoryResolver = null) { $this->manager = $manager; $this->cacheFactoryResolver = $cacheFactoryResolver; @@ -276,7 +276,7 @@ protected function sessionConfigured() * @param array|null $config * @return bool */ - protected function sessionIsPersistent(array $config = null) + protected function sessionIsPersistent(?array $config = null) { $config = $config ?: $this->manager->getSessionConfig(); diff --git a/src/WpStarter/Support/Str.php b/src/WpStarter/Support/Str.php index b282a16..9ef1eec 100644 --- a/src/WpStarter/Support/Str.php +++ b/src/WpStarter/Support/Str.php @@ -1004,7 +1004,7 @@ public static function orderedUuid() * @param callable|null $factory * @return void */ - public static function createUuidsUsing(callable $factory = null) + public static function createUuidsUsing(?callable $factory = null) { static::$uuidFactory = $factory; } diff --git a/src/WpStarter/Support/Testing/Fakes/NotificationFake.php b/src/WpStarter/Support/Testing/Fakes/NotificationFake.php index 092e063..afc193d 100644 --- a/src/WpStarter/Support/Testing/Fakes/NotificationFake.php +++ b/src/WpStarter/Support/Testing/Fakes/NotificationFake.php @@ -262,7 +262,7 @@ public function send($notifiables, $notification) * @param array|null $channels * @return void */ - public function sendNow($notifiables, $notification, array $channels = null) + public function sendNow($notifiables, $notification, ?array $channels = null) { if (! $notifiables instanceof Collection && ! is_array($notifiables)) { $notifiables = [$notifiables]; diff --git a/src/WpStarter/Support/helpers.php b/src/WpStarter/Support/helpers.php index cd0b926..90dad40 100644 --- a/src/WpStarter/Support/helpers.php +++ b/src/WpStarter/Support/helpers.php @@ -181,7 +181,7 @@ function ws_object_get($object, $key, $default = null) * @param callable|null $callback * @return mixed */ - function ws_optional($value = null, callable $callback = null) + function ws_optional($value = null, ?callable $callback = null) { if (is_null($callback)) { return new Optional($value); @@ -372,7 +372,7 @@ function ws_windows_os() * @param callable|null $callback * @return mixed */ - function ws_with($value, callable $callback = null) + function ws_with($value, ?callable $callback = null) { return is_null($callback) ? $value : $callback($value); } diff --git a/src/WpStarter/Testing/AssertableJsonString.php b/src/WpStarter/Testing/AssertableJsonString.php index f6ffd22..11d6d74 100644 --- a/src/WpStarter/Testing/AssertableJsonString.php +++ b/src/WpStarter/Testing/AssertableJsonString.php @@ -231,7 +231,7 @@ public function assertPath($path, $expect) * @param array|null $responseData * @return $this */ - public function assertStructure(array $structure = null, $responseData = null) + public function assertStructure(?array $structure = null, $responseData = null) { if (is_null($structure)) { return $this->assertSimilar($this->decoded); diff --git a/src/WpStarter/Testing/Fluent/AssertableJson.php b/src/WpStarter/Testing/Fluent/AssertableJson.php index 3132bcd..76c44a2 100644 --- a/src/WpStarter/Testing/Fluent/AssertableJson.php +++ b/src/WpStarter/Testing/Fluent/AssertableJson.php @@ -40,7 +40,7 @@ class AssertableJson implements Arrayable * @param string|null $path * @return void */ - protected function __construct(array $props, string $path = null) + protected function __construct(array $props, ?string $path = null) { $this->path = $path; $this->props = $props; @@ -67,7 +67,7 @@ protected function dotPath(string $key = ''): string * @param string|null $key * @return mixed */ - protected function prop(string $key = null) + protected function prop(?string $key = null) { return Arr::get($this->props, $key); } diff --git a/src/WpStarter/Testing/Fluent/Concerns/Debugging.php b/src/WpStarter/Testing/Fluent/Concerns/Debugging.php index 0a31a4d..ac8dc76 100644 --- a/src/WpStarter/Testing/Fluent/Concerns/Debugging.php +++ b/src/WpStarter/Testing/Fluent/Concerns/Debugging.php @@ -10,7 +10,7 @@ trait Debugging * @param string|null $prop * @return $this */ - public function dump(string $prop = null): self + public function dump(?string $prop = null): self { dump($this->prop($prop)); @@ -23,7 +23,7 @@ public function dump(string $prop = null): self * @param string|null $prop * @return void */ - public function dd(string $prop = null): void + public function dd(?string $prop = null): void { dd($this->prop($prop)); } @@ -34,5 +34,5 @@ public function dd(string $prop = null): void * @param string|null $key * @return mixed */ - abstract protected function prop(string $key = null); + abstract protected function prop(?string $key = null); } diff --git a/src/WpStarter/Testing/Fluent/Concerns/Has.php b/src/WpStarter/Testing/Fluent/Concerns/Has.php index 9fc89b6..2e6c2e8 100644 --- a/src/WpStarter/Testing/Fluent/Concerns/Has.php +++ b/src/WpStarter/Testing/Fluent/Concerns/Has.php @@ -15,7 +15,7 @@ trait Has * @param int|null $length * @return $this */ - public function count($key, int $length = null): self + public function count($key, ?int $length = null): self { if (is_null($length)) { $path = $this->dotPath(); @@ -48,7 +48,7 @@ public function count($key, int $length = null): self * @param \Closure|null $callback * @return $this */ - public function has($key, $length = null, Closure $callback = null): self + public function has($key, $length = null, ?Closure $callback = null): self { $prop = $this->prop(); @@ -185,7 +185,7 @@ abstract protected function interactsWith(string $key): void; * @param string|null $key * @return mixed */ - abstract protected function prop(string $key = null); + abstract protected function prop(?string $key = null); /** * Instantiate a new "scope" at the path of the given key. diff --git a/src/WpStarter/Testing/Fluent/Concerns/Interaction.php b/src/WpStarter/Testing/Fluent/Concerns/Interaction.php index 531f282..c3d8cb0 100644 --- a/src/WpStarter/Testing/Fluent/Concerns/Interaction.php +++ b/src/WpStarter/Testing/Fluent/Concerns/Interaction.php @@ -63,5 +63,5 @@ public function etc(): self * @param string|null $key * @return mixed */ - abstract protected function prop(string $key = null); + abstract protected function prop(?string $key = null); } diff --git a/src/WpStarter/Testing/Fluent/Concerns/Matching.php b/src/WpStarter/Testing/Fluent/Concerns/Matching.php index 4afe770..56ddc91 100644 --- a/src/WpStarter/Testing/Fluent/Concerns/Matching.php +++ b/src/WpStarter/Testing/Fluent/Concerns/Matching.php @@ -181,7 +181,7 @@ abstract protected function dotPath(string $key = ''): string; * @param \Closure|null $scope * @return $this */ - abstract public function has(string $key, $value = null, Closure $scope = null); + abstract public function has(string $key, $value = null, ?Closure $scope = null); /** * Retrieve a prop within the current scope using "dot" notation. @@ -189,5 +189,5 @@ abstract public function has(string $key, $value = null, Closure $scope = null); * @param string|null $key * @return mixed */ - abstract protected function prop(string $key = null); + abstract protected function prop(?string $key = null); } diff --git a/src/WpStarter/Testing/TestResponse.php b/src/WpStarter/Testing/TestResponse.php index cbd9023..e981450 100644 --- a/src/WpStarter/Testing/TestResponse.php +++ b/src/WpStarter/Testing/TestResponse.php @@ -793,7 +793,7 @@ public function assertJsonMissingExact(array $data) * @param array|null $responseData * @return $this */ - public function assertJsonStructure(array $structure = null, $responseData = null) + public function assertJsonStructure(?array $structure = null, $responseData = null) { $this->decodeResponseJson()->assertStructure($structure, $responseData); diff --git a/src/WpStarter/Validation/Factory.php b/src/WpStarter/Validation/Factory.php index 7ef84e2..524b6d0 100644 --- a/src/WpStarter/Validation/Factory.php +++ b/src/WpStarter/Validation/Factory.php @@ -87,7 +87,7 @@ class Factory implements FactoryContract * @param \WpStarter\Contracts\Container\Container|null $container * @return void */ - public function __construct(Translator $translator, Container $container = null) + public function __construct(Translator $translator, ?Container $container = null) { $this->container = $container; $this->translator = $translator; diff --git a/src/WpStarter/Validation/Validator.php b/src/WpStarter/Validation/Validator.php index 0eea2f5..1d5ff84 100644 --- a/src/WpStarter/Validation/Validator.php +++ b/src/WpStarter/Validation/Validator.php @@ -516,7 +516,7 @@ public function validateWithBag(string $errorBag) * @param array|null $keys * @return \WpStarter\Support\ValidatedInput|array */ - public function safe(array $keys = null) + public function safe(?array $keys = null) { return is_array($keys) ? (new ValidatedInput($this->validated()))->only($keys) @@ -1353,7 +1353,7 @@ public function addCustomAttributes(array $customAttributes) * @param callable|null $formatter * @return $this */ - public function setImplicitAttributesFormatter(callable $formatter = null) + public function setImplicitAttributesFormatter(?callable $formatter = null) { $this->implicitAttributesFormatter = $formatter; diff --git a/src/WpStarter/View/Engines/CompilerEngine.php b/src/WpStarter/View/Engines/CompilerEngine.php index 920ee19..d9836a0 100644 --- a/src/WpStarter/View/Engines/CompilerEngine.php +++ b/src/WpStarter/View/Engines/CompilerEngine.php @@ -30,7 +30,7 @@ class CompilerEngine extends PhpEngine * @param \WpStarter\Filesystem\Filesystem|null $files * @return void */ - public function __construct(CompilerInterface $compiler, Filesystem $files = null) + public function __construct(CompilerInterface $compiler, ?Filesystem $files = null) { parent::__construct($files ?: new Filesystem); diff --git a/src/WpStarter/View/FileViewFinder.php b/src/WpStarter/View/FileViewFinder.php index 6fe4aac..f9a253e 100644 --- a/src/WpStarter/View/FileViewFinder.php +++ b/src/WpStarter/View/FileViewFinder.php @@ -50,7 +50,7 @@ class FileViewFinder implements ViewFinderInterface * @param array|null $extensions * @return void */ - public function __construct(Filesystem $files, array $paths, array $extensions = null) + public function __construct(Filesystem $files, array $paths, ?array $extensions = null) { $this->files = $files; $this->paths = array_map([$this, 'resolvePath'], $paths); diff --git a/src/WpStarter/View/View.php b/src/WpStarter/View/View.php index 95803bc..4505fab 100644 --- a/src/WpStarter/View/View.php +++ b/src/WpStarter/View/View.php @@ -85,7 +85,7 @@ public function __construct(Factory $factory, Engine $engine, $view, $path, $dat * * @throws \Throwable */ - public function render(callable $callback = null) + public function render(?callable $callback = null) { try { $contents = $this->renderContents(); diff --git a/src/WpStarter/Wordpress/Admin/Routing/Router.php b/src/WpStarter/Wordpress/Admin/Routing/Router.php index 21ec007..9193c87 100644 --- a/src/WpStarter/Wordpress/Admin/Routing/Router.php +++ b/src/WpStarter/Wordpress/Admin/Routing/Router.php @@ -30,7 +30,7 @@ class Router extends \WpStarter\Routing\Router * @param Dispatcher $events * @param Container|null $container */ - public function __construct(Dispatcher $events, Container $container = null) + public function __construct(Dispatcher $events, ?Container $container = null) { parent::__construct($events, $container); $this->routes = new MenuCollection(); diff --git a/src/WpStarter/Wordpress/Application.php b/src/WpStarter/Wordpress/Application.php index cb13a34..2da73a8 100644 --- a/src/WpStarter/Wordpress/Application.php +++ b/src/WpStarter/Wordpress/Application.php @@ -11,7 +11,7 @@ class Application extends \WpStarter\Foundation\Application * * @var string */ - const VERSION = '1.9.10'; + const VERSION = '1.10.0'; /** * Indicates if the application has been early bootstrapped before. * diff --git a/src/WpStarter/Wordpress/Auth/User.php b/src/WpStarter/Wordpress/Auth/User.php index 11f1046..fee36b3 100644 --- a/src/WpStarter/Wordpress/Auth/User.php +++ b/src/WpStarter/Wordpress/Auth/User.php @@ -9,6 +9,7 @@ use WpStarter\Contracts\Auth\Authenticatable as AuthenticatableContract; use WpStarter\Contracts\Auth\CanResetPassword as CanResetPasswordContract; use WpStarter\Foundation\Auth\Access\Authorizable; +use WP_User; class User extends Model implements AuthenticatableContract, @@ -16,10 +17,10 @@ class User extends Model implements { use Authenticatable, Authorizable; /** - * @param \WP_User|null $wp_user + * @param WP_User|null $wp_user * @return static|null */ - public static function fromWpUser(\WP_User $wp_user = null) + public static function fromWpUser(?WP_User $wp_user = null) { if (!$wp_user) { return null; diff --git a/src/WpStarter/Wordpress/Exceptions/WpErrorException.php b/src/WpStarter/Wordpress/Exceptions/WpErrorException.php index faced6c..6221391 100644 --- a/src/WpStarter/Wordpress/Exceptions/WpErrorException.php +++ b/src/WpStarter/Wordpress/Exceptions/WpErrorException.php @@ -10,7 +10,7 @@ class WpErrorException extends Exception { protected $wp_error; - public function __construct(string $message = "", $code = 0, Throwable $previous = null) + public function __construct(string $message = "", $code = 0, ?Throwable $previous = null) { parent::__construct($message, 0, $previous); $this->code = $code; diff --git a/src/WpStarter/Wordpress/Model/Concerns/HasGlobalScopes.php b/src/WpStarter/Wordpress/Model/Concerns/HasGlobalScopes.php index 71dbb16..93b741c 100644 --- a/src/WpStarter/Wordpress/Model/Concerns/HasGlobalScopes.php +++ b/src/WpStarter/Wordpress/Model/Concerns/HasGlobalScopes.php @@ -18,7 +18,7 @@ trait HasGlobalScopes * * @throws \InvalidArgumentException */ - public static function addGlobalScope($scope, Closure $implementation = null) + public static function addGlobalScope($scope, ?Closure $implementation = null) { if (is_string($scope) && !is_null($implementation)) { return static::$globalScopes[static::class][$scope] = $implementation; diff --git a/src/WpStarter/Wordpress/Model/Concerns/QueriesRelationships.php b/src/WpStarter/Wordpress/Model/Concerns/QueriesRelationships.php index 1c1544d..3af7ea0 100644 --- a/src/WpStarter/Wordpress/Model/Concerns/QueriesRelationships.php +++ b/src/WpStarter/Wordpress/Model/Concerns/QueriesRelationships.php @@ -27,7 +27,7 @@ trait QueriesRelationships * * @throws \RuntimeException */ - public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null) + public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', ?Closure $callback = null) { if (is_string($relation)) { if (strpos($relation, '.') !== false) { @@ -120,7 +120,7 @@ public function orHas($relation, $operator = '>=', $count = 1) * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function doesntHave($relation, $boolean = 'and', Closure $callback = null) + public function doesntHave($relation, $boolean = 'and', ?Closure $callback = null) { return $this->has($relation, '<', 1, $boolean, $callback); } @@ -145,7 +145,7 @@ public function orDoesntHave($relation) * @param int $count * @return \WpStarter\Database\Eloquent\Builder|static */ - public function whereHas($relation, Closure $callback = null, $operator = '>=', $count = 1) + public function whereHas($relation, ?Closure $callback = null, $operator = '>=', $count = 1) { return $this->has($relation, $operator, $count, 'and', $callback); } @@ -159,7 +159,7 @@ public function whereHas($relation, Closure $callback = null, $operator = '>=', * @param int $count * @return \WpStarter\Database\Eloquent\Builder|static */ - public function orWhereHas($relation, Closure $callback = null, $operator = '>=', $count = 1) + public function orWhereHas($relation, ?Closure $callback = null, $operator = '>=', $count = 1) { return $this->has($relation, $operator, $count, 'or', $callback); } @@ -171,7 +171,7 @@ public function orWhereHas($relation, Closure $callback = null, $operator = '>=' * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function whereDoesntHave($relation, Closure $callback = null) + public function whereDoesntHave($relation, ?Closure $callback = null) { return $this->doesntHave($relation, 'and', $callback); } @@ -183,7 +183,7 @@ public function whereDoesntHave($relation, Closure $callback = null) * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function orWhereDoesntHave($relation, Closure $callback = null) + public function orWhereDoesntHave($relation, ?Closure $callback = null) { return $this->doesntHave($relation, 'or', $callback); } @@ -199,7 +199,7 @@ public function orWhereDoesntHave($relation, Closure $callback = null) * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function hasMorph($relation, $types, $operator = '>=', $count = 1, $boolean = 'and', Closure $callback = null) + public function hasMorph($relation, $types, $operator = '>=', $count = 1, $boolean = 'and', ?Closure $callback = null) { if (is_string($relation)) { $relation = $this->getRelationWithoutConstraints($relation); @@ -278,7 +278,7 @@ public function orHasMorph($relation, $types, $operator = '>=', $count = 1) * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function doesntHaveMorph($relation, $types, $boolean = 'and', Closure $callback = null) + public function doesntHaveMorph($relation, $types, $boolean = 'and', ?Closure $callback = null) { return $this->hasMorph($relation, $types, '<', 1, $boolean, $callback); } @@ -305,7 +305,7 @@ public function orDoesntHaveMorph($relation, $types) * @param int $count * @return \WpStarter\Database\Eloquent\Builder|static */ - public function whereHasMorph($relation, $types, Closure $callback = null, $operator = '>=', $count = 1) + public function whereHasMorph($relation, $types, ?Closure $callback = null, $operator = '>=', $count = 1) { return $this->hasMorph($relation, $types, $operator, $count, 'and', $callback); } @@ -320,7 +320,7 @@ public function whereHasMorph($relation, $types, Closure $callback = null, $oper * @param int $count * @return \WpStarter\Database\Eloquent\Builder|static */ - public function orWhereHasMorph($relation, $types, Closure $callback = null, $operator = '>=', $count = 1) + public function orWhereHasMorph($relation, $types, ?Closure $callback = null, $operator = '>=', $count = 1) { return $this->hasMorph($relation, $types, $operator, $count, 'or', $callback); } @@ -333,7 +333,7 @@ public function orWhereHasMorph($relation, $types, Closure $callback = null, $op * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function whereDoesntHaveMorph($relation, $types, Closure $callback = null) + public function whereDoesntHaveMorph($relation, $types, ?Closure $callback = null) { return $this->doesntHaveMorph($relation, $types, 'and', $callback); } @@ -346,7 +346,7 @@ public function whereDoesntHaveMorph($relation, $types, Closure $callback = null * @param \Closure|null $callback * @return \WpStarter\Database\Eloquent\Builder|static */ - public function orWhereDoesntHaveMorph($relation, $types, Closure $callback = null) + public function orWhereDoesntHaveMorph($relation, $types, ?Closure $callback = null) { return $this->doesntHaveMorph($relation, $types, 'or', $callback); } diff --git a/src/WpStarter/Wordpress/Routing/Router.php b/src/WpStarter/Wordpress/Routing/Router.php index 1c84b87..1881c6d 100644 --- a/src/WpStarter/Wordpress/Routing/Router.php +++ b/src/WpStarter/Wordpress/Routing/Router.php @@ -19,7 +19,7 @@ class Router extends BaseRouter * @param Dispatcher $events * @param Container|null $container */ - public function __construct(Dispatcher $events, Container $container = null) + public function __construct(Dispatcher $events, ?Container $container = null) { parent::__construct($events, $container); $this->routes = new RouteCollection(); @@ -39,4 +39,4 @@ protected function runRoute(Request $request, BaseRoute $route) return $response; } -} \ No newline at end of file +}