Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web 4823 event machine mockable actions #76

Merged
merged 8 commits into from
Feb 20, 2024
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);
}
}