Skip to content
Merged
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
16 changes: 4 additions & 12 deletions src/Illuminate/Container/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,7 @@ protected function getReboundCallbacks($abstract)
*/
public function wrap(Closure $callback, array $parameters = [])
{
return function () use ($callback, $parameters) {
return $this->call($callback, $parameters);
};
return fn () => $this->call($callback, $parameters);
}

/**
Expand Down Expand Up @@ -677,9 +675,7 @@ public function call($callback, array $parameters = [], $defaultMethod = null)
*/
public function factory($abstract)
{
return function () use ($abstract) {
return $this->make($abstract);
};
return fn () => $this->make($abstract);
}

/**
Expand Down Expand Up @@ -1083,9 +1079,7 @@ protected function resolveVariadicClass(ReflectionParameter $parameter)
return $this->make($className);
}

return array_map(function ($abstract) {
return $this->resolve($abstract);
}, $concrete);
return array_map(fn ($abstract) => $this->resolve($abstract), $concrete);
}

/**
Expand Down Expand Up @@ -1446,9 +1440,7 @@ public function offsetGet($key): mixed
*/
public function offsetSet($key, $value): void
{
$this->bind($key, $value instanceof Closure ? $value : function () use ($value) {
return $value;
});
$this->bind($key, $value instanceof Closure ? $value : fn () => $value);
}

/**
Expand Down