mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Type hints for callable
This commit is contained in:
@ -55,7 +55,7 @@ final class HigherOrderMessage
|
|||||||
/**
|
/**
|
||||||
* An optional condition that will determine if the message will be executed.
|
* An optional condition that will determine if the message will be executed.
|
||||||
*
|
*
|
||||||
* @var callable|null
|
* @var callable(): bool|null
|
||||||
*/
|
*/
|
||||||
public $condition = null;
|
public $condition = null;
|
||||||
|
|
||||||
@ -102,6 +102,11 @@ final class HigherOrderMessage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Indicates that this message should only be called when the given condition is true.
|
||||||
|
*
|
||||||
|
* @param callable(): bool $condition
|
||||||
|
*/
|
||||||
public function when(callable $condition): self
|
public function when(callable $condition): self
|
||||||
{
|
{
|
||||||
$this->condition = $condition;
|
$this->condition = $condition;
|
||||||
|
|||||||
Reference in New Issue
Block a user