Skip to content

Commit 734a450

Browse files
authored
Reduce meaningless intermediate variables. (#56265)
1 parent 04e60d7 commit 734a450

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Illuminate/Database/Eloquent/Model.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -737,11 +737,7 @@ public static function on($connection = null)
737737
// First we will just create a fresh instance of this model, and then we can set the
738738
// connection on the model so that it is used for the queries we execute, as well
739739
// as being set on every relation we retrieve without a custom connection name.
740-
$instance = new static;
741-
742-
$instance->setConnection($connection);
743-
744-
return $instance->newQuery();
740+
return (new static)->setConnection($connection)->newQuery();
745741
}
746742

747743
/**

0 commit comments

Comments
 (0)