Skip to content

Commit

Permalink
document Transaction::add
Browse files Browse the repository at this point in the history
  • Loading branch information
meadsteve committed Apr 18, 2019
1 parent 276b697 commit 2745d91
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/StepBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class StepBuilder
{

/**
* @param mixed[] ...$args
* @param mixed ...$args
* @return Step
*/
public static function build(...$args): Step
Expand Down
11 changes: 11 additions & 0 deletions src/Transaction.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ public function __construct(LoggerInterface $logger = null)
}


/**
* Adds a step to the transaction. With the following args:
*
* (Step) -> Adds the step to transaction
* (Closure, Closure) -> Creates a step with the first lambda
* as the execute and the second as compensate
* (Closure, Closure, str) -> Same as above but named
*
* @param mixed ...$args
* @return Transaction
*/
public function add(...$args): Transaction
{
$step = StepBuilder::build(...$args);
Expand Down

0 comments on commit 2745d91

Please sign in to comment.