mirror of
https://github.com/pestphp/pest.git
synced 2026-03-06 07:47:22 +01:00
Specify closure this for extend
This commit is contained in:
@ -8,6 +8,8 @@ use Closure;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
|
*
|
||||||
|
* @template T of object
|
||||||
*/
|
*/
|
||||||
trait Extendable
|
trait Extendable
|
||||||
{
|
{
|
||||||
@ -20,6 +22,8 @@ trait Extendable
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Register a new extend.
|
* Register a new extend.
|
||||||
|
*
|
||||||
|
* @param-closure-this T $extend
|
||||||
*/
|
*/
|
||||||
public function extend(string $name, Closure $extend): void
|
public function extend(string $name, Closure $extend): void
|
||||||
{
|
{
|
||||||
|
|||||||
@ -52,7 +52,9 @@ use ReflectionProperty;
|
|||||||
*/
|
*/
|
||||||
final class Expectation
|
final class Expectation
|
||||||
{
|
{
|
||||||
|
/** @use Extendable<self<TValue>> */
|
||||||
use Extendable;
|
use Extendable;
|
||||||
|
|
||||||
use Pipeable;
|
use Pipeable;
|
||||||
use Retrievable;
|
use Retrievable;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user