8000 simplify driver initialization using null coalescing assignment (#56210) · laravel/framework@e2fdcd7 · GitHub
[go: up one dir, main page]

Skip to content

Commit e2fdcd7

Browse files
authored
simplify driver initialization using null coalescing assignment (#56210)
1 parent a5eaf42 commit e2fdcd7

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/Illuminate/Support/Manager.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,7 @@ public function driver($driver = null)
7575
// If the given driver has not been created before, we will create the instances
7676
// here and cache it so we can return it next time very quickly. If there is
7777
// already a driver created by this name, we'll just return that instance.
78-
if (! isset($this->drivers[$driver])) {
79-
$this->drivers[$driver] = $this->createDriver($driver);
80-
}
81-
82-
return $this->drivers[$driver];
78+
return $this->drivers[$driver] ??= $this->createDriver($driver);
8379
}
8480

8581
/**

0 commit comments

Comments
 (0)
0