Skip to content

Commit

Permalink
Merge pull request #76 from tarfin-labs/WEB-4823-event-machine-mockab…
Browse files Browse the repository at this point in the history
…le-actions

Web 4823 event machine mockable actions
  • Loading branch information
deligoez authored Feb 20, 2024
2 parents eea942b + fdb4496 commit 63f98aa
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Behavior/InvokableBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,22 @@ public static function injectInvokableBehaviorParameters(

return $invocableBehaviorParameters;
}

/**
* This method is used to create an instance of the invoking class.
*/
public static function make(): mixed
{
return app(static::class);
}

/**
* This method creates an instance of the invoking class and calls it as a callable, passing any provided arguments.
*
* @param mixed ...$arguments
*/
public static function run(...$arguments): mixed
{
return static::make()(...$arguments);
}
}

0 comments on commit 63f98aa

Please sign in to comment.