Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Capsule/Manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Manager
* @param \Illuminate\Container\Container|null $container
* @return void
*/
public function __construct(Container $container = null)
public function __construct(?Container $container = null)
{
$this->setupContainer($container ?: new Container);

Expand Down
2 changes: 1 addition & 1 deletion Console/DatabaseInspectionCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ abstract class DatabaseInspectionCommand extends Command
* @param \Illuminate\Support\Composer|null $composer
* @return void
*/
public function __construct(Composer $composer = null)
public function __construct(?Composer $composer = null)
{
parent::__construct();

Expand Down
6 changes: 3 additions & 3 deletions Eloquent/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,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);
Expand Down Expand Up @@ -518,7 +518,7 @@ public function findOrNew($id, $columns = ['*'])
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|static[]|static|mixed
*/
public function findOr($id, $columns = ['*'], Closure $callback = null)
public function findOr($id, $columns = ['*'], ?Closure $callback = null)
{
if ($columns instanceof Closure) {
$callback = $columns;
Expand Down Expand Up @@ -605,7 +605,7 @@ public function firstOrFail($columns = ['*'])
* @param \Closure|null $callback
* @return \Illuminate\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;
Expand Down
4 changes: 2 additions & 2 deletions Eloquent/Casts/Attribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,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;
Expand All @@ -52,7 +52,7 @@ public function __construct(callable $get = null, callable $set = null)
* @param callable|null $set
* @return static
*/
public static function make(callable $get = null, callable $set = null): static
public static function make(?callable $get = null, ?callable $set = null): static
{
return new static($get, $set);
}
Expand Down
26 changes: 13 additions & 13 deletions Eloquent/Concerns/QueriesRelationships.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,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 (str_contains($relation, '.')) {
Expand Down Expand Up @@ -122,7 +122,7 @@ public function orHas($relation, $operator = '>=', $count = 1)
* @param \Closure|null $callback
* @return \Illuminate\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);
}
Expand All @@ -147,7 +147,7 @@ public function orDoesntHave($relation)
* @param int $count
* @return \Illuminate\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);
}
Expand All @@ -163,7 +163,7 @@ public function whereHas($relation, Closure $callback = null, $operator = '>=',
* @param int $count
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function withWhereHas($relation, Closure $callback = null, $operator = '>=', $count = 1)
public function withWhereHas($relation, ?Closure $callback = null, $operator = '>=', $count = 1)
{
return $this->whereHas(Str::before($relation, ':'), $callback, $operator, $count)
->with($callback ? [$relation => fn ($query) => $callback($query)] : $relation);
Expand All @@ -178,7 +178,7 @@ public function withWhereHas($relation, Closure $callback = null, $operator = '>
* @param int $count
* @return \Illuminate\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);
}
Expand All @@ -190,7 +190,7 @@ public function orWhereHas($relation, Closure $callback = null, $operator = '>='
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function whereDoesntHave($relation, Closure $callback = null)
public function whereDoesntHave($relation, ?Closure $callback = null)
{
return $this->doesntHave($relation, 'and', $callback);
}
Expand All @@ -202,7 +202,7 @@ public function whereDoesntHave($relation, Closure $callback = null)
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Builder|static
*/
public function orWhereDoesntHave($relation, Closure $callback = null)
public function orWhereDoesntHave($relation, ?Closure $callback = null)
{
return $this->doesntHave($relation, 'or', $callback);
}
Expand All @@ -218,7 +218,7 @@ public function orWhereDoesntHave($relation, Closure $callback = null)
* @param \Closure|null $callback
* @return \Illuminate\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);
Expand Down Expand Up @@ -297,7 +297,7 @@ public function orHasMorph($relation, $types, $operator = '>=', $count = 1)
* @param \Closure|null $callback
* @return \Illuminate\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);
}
Expand All @@ -324,7 +324,7 @@ public function orDoesntHaveMorph($relation, $types)
* @param int $count
* @return \Illuminate\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);
}
Expand All @@ -339,7 +339,7 @@ public function whereHasMorph($relation, $types, Closure $callback = null, $oper
* @param int $count
* @return \Illuminate\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);
}
Expand All @@ -352,7 +352,7 @@ public function orWhereHasMorph($relation, $types, Closure $callback = null, $op
* @param \Closure|null $callback
* @return \Illuminate\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);
}
Expand All @@ -365,7 +365,7 @@ public function whereDoesntHaveMorph($relation, $types, Closure $callback = null
* @param \Closure|null $callback
* @return \Illuminate\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);
}
Expand Down
4 changes: 2 additions & 2 deletions Eloquent/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ public function refresh()
* @param array|null $except
* @return static
*/
public function replicate(array $except = null)
public function replicate(?array $except = null)
{
$defaults = array_values(array_filter([
$this->getKeyName(),
Expand All @@ -1741,7 +1741,7 @@ public function replicate(array $except = null)
* @param array|null $except
* @return static
*/
public function replicateQuietly(array $except = null)
public function replicateQuietly(?array $except = null)
{
return static::withoutEvents(fn () => $this->replicate($except));
}
Expand Down
4 changes: 2 additions & 2 deletions Eloquent/Relations/BelongsToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ public function findOrFail($id, $columns = ['*'])
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|mixed
*/
public function findOr($id, $columns = ['*'], Closure $callback = null)
public function findOr($id, $columns = ['*'], ?Closure $callback = null)
{
if ($columns instanceof Closure) {
$callback = $columns;
Expand Down Expand Up @@ -801,7 +801,7 @@ public function firstOrFail($columns = ['*'])
* @param \Closure|null $callback
* @return \Illuminate\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;
Expand Down
6 changes: 3 additions & 3 deletions Eloquent/Relations/HasManyThrough.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function addConstraints()
* @param \Illuminate\Database\Eloquent\Builder|null $query
* @return void
*/
protected function performJoin(Builder $query = null)
protected function performJoin(?Builder $query = null)
{
$query = $query ?: $this->query;

Expand Down Expand Up @@ -309,7 +309,7 @@ public function firstOrFail($columns = ['*'])
* @param \Closure|null $callback
* @return \Illuminate\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;
Expand Down Expand Up @@ -396,7 +396,7 @@ public function findOrFail($id, $columns = ['*'])
* @param \Closure|null $callback
* @return \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Collection|mixed
*/
public function findOr($id, $columns = ['*'], Closure $callback = null)
public function findOr($id, $columns = ['*'], ?Closure $callback = null)
{
if ($columns instanceof Closure) {
$callback = $columns;
Expand Down
4 changes: 2 additions & 2 deletions Eloquent/Relations/Relation.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,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);

Expand All @@ -453,7 +453,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;
Expand Down
2 changes: 1 addition & 1 deletion Migrations/Migrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Migrator
public function __construct(MigrationRepositoryInterface $repository,
Resolver $resolver,
Filesystem $files,
Dispatcher $dispatcher = null)
?Dispatcher $dispatcher = null)
{
$this->files = $files;
$this->events = $dispatcher;
Expand Down
2 changes: 1 addition & 1 deletion MySqlConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ protected function getDefaultSchemaGrammar()
* @param callable|null $processFactory
* @return \Illuminate\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);
}
Expand Down
2 changes: 1 addition & 1 deletion PostgresConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected function getDefaultSchemaGrammar()
* @param callable|null $processFactory
* @return \Illuminate\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);
}
Expand Down
6 changes: 3 additions & 3 deletions Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,8 @@ class Builder implements BuilderContract
* @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();
Expand Down Expand Up @@ -2624,7 +2624,7 @@ public function find($id, $columns = ['*'])
* @param \Closure|null $callback
* @return mixed|static
*/
public function findOr($id, $columns = ['*'], Closure $callback = null)
public function findOr($id, $columns = ['*'], ?Closure $callback = null)
{
if ($columns instanceof Closure) {
$callback = $columns;
Expand Down
2 changes: 1 addition & 1 deletion SQLiteConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,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);
}
Expand Down
2 changes: 1 addition & 1 deletion Schema/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Schema/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ protected function build(Blueprint $blueprint)
* @param \Closure|null $callback
* @return \Illuminate\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')
Expand Down
2 changes: 1 addition & 1 deletion Schema/SchemaState.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion SqlServerConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,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.');
}
Expand Down
Loading