Skip to content

Commit

Permalink
Refactor: Reduce indent and improve code using ternary instead of 'if…
Browse files Browse the repository at this point in the history
…-else' structure (#47478)
  • Loading branch information
saMahmoudzadeh authored Jun 18, 2023
1 parent f85a857 commit ddc2627
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -791,11 +791,9 @@ protected function resolve($abstract, $parameters = [], $raiseEvents = true)
// We're ready to instantiate an instance of the concrete type registered for
// the binding. This will instantiate the types, as well as resolve any of
// its "nested" dependencies recursively until all have gotten resolved.
if ($this->isBuildable($concrete, $abstract)) {
$object = $this->build($concrete);
} else {
$object = $this->make($concrete);
}
$object = $this->isBuildable($concrete, $abstract)
? $this->build($concrete)
: $this->make($concrete);

// If we defined any extenders for this type, we'll need to spin through them
// and apply them to the object being built. This allows for the extension
Expand Down

0 comments on commit ddc2627

Please sign in to comment.