Skip to content

Commit

Permalink
Type hints for callable
Browse files Browse the repository at this point in the history
  • Loading branch information
lukeraymonddowning committed Jul 8, 2021
1 parent b97e206 commit fa3959d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Support/HigherOrderMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ final class HigherOrderMessage
/**
* An optional condition that will determine if the message will be executed.
*
* @var callable|null
* @var callable(): bool|null
*/
public $condition = null;

Expand Down Expand Up @@ -102,6 +102,11 @@ public function call(object $target)
}
}

/**
* Indicates that this message should only be called when the given condition is true.
*
* @param callable(): bool $condition
*/
public function when(callable $condition): self
{
$this->condition = $condition;
Expand Down

0 comments on commit fa3959d

Please sign in to comment.