foundation-laravel icon indicating copy to clipboard operation
foundation-laravel copied to clipboard

Allow alternative notation for constructor arguments in ServeFeaturesTrait

Open adiachenko opened this issue 5 years ago • 0 comments

The current implementation of ServeFeaturesTrait doesn't allow for the following:

$output = $this->serve(new GetReachEstimateFeature($adAccount, $accessToken));

which is inconsistent with JobDispatcherTrait that offers 2 alternative styles of passing constructor arguments:

$this->run(GetTotalReachEstimateJob::class, [
    'adAccount' => $adAccount,
    'accessToken' => $accessToken,
]);

and this:

$this->run(new GetTotalReachEstimateJob($adAccount, $accessToken));

The proposed PR is supposed to fix that.

adiachenko avatar Mar 07 '19 10:03 adiachenko