Skip to content

Commit

Permalink
get rid of binding for CallProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-rubel committed May 23, 2022
1 parent cafa899 commit 56ebec1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 20 deletions.
3 changes: 2 additions & 1 deletion src/Helpers/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use MichaelRubel\EnhancedContainer\Call;
use MichaelRubel\EnhancedContainer\Core\BindingBuilder;
use MichaelRubel\EnhancedContainer\Core\CallProxy;

if (! function_exists('call')) {
/**
Expand All @@ -15,7 +16,7 @@
*/
function call(string|object $class, array $parameters = [], ?string $context = null): mixed
{
return app(Call::class, [$class, $parameters, $context]);
return new CallProxy($class, $parameters, $context);
}
}

Expand Down
19 changes: 0 additions & 19 deletions src/LecServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace MichaelRubel\EnhancedContainer;

use MichaelRubel\EnhancedContainer\Core\CallProxy;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;

Expand All @@ -23,22 +22,4 @@ public function configurePackage(Package $package): void
->name('laravel-enhanced-container')
->hasConfigFile();
}

/**
* Register any package services.
*
* @return void
*/
public function packageBooted(): void
{
$this->app->bind(
Call::class,
fn ($app, $params)
=> new CallProxy(
current($params),
next($params),
end($params)
)
);
}
}

0 comments on commit 56ebec1

Please # to comment.