Skip to content

Commit

Permalink
Refactor getInstance method to use null coalescing assignment (#52693)
Browse files Browse the repository at this point in the history
Co-authored-by: Xurshudyan <v.khurshudyan@aico.swiss>
  • Loading branch information
xurshudyan and Xurshudyan authored Sep 9, 2024
1 parent 0891d0f commit 9587bb2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Illuminate/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -1519,11 +1519,7 @@ public function flush()
*/
public static function getInstance()
{
if (is_null(static::$instance)) {
static::$instance = new static;
}

return static::$instance;
return static::$instance ??= new static;
}

/**
Expand Down

0 comments on commit 9587bb2

Please sign in to comment.