Skip to content

Commit

Permalink
Minor code style update.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Jan 10, 2020
1 parent fc62742 commit 633b10a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 95 deletions.
6 changes: 5 additions & 1 deletion src/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ final public function __construct($data = [], ...$parameters)
{
switch (true) {
case $data instanceof Closure:
$this->source = $data;
$this->source = static function () use ($data, $parameters) {
return (static function ($data, $parameters) {
return $data(...$parameters);
})($data, $parameters);
};

break;
case is_iterable($data):
Expand Down

0 comments on commit 633b10a

Please sign in to comment.