From d06e5c14346815c7baaf0fc5bc93b1b1cf76d428 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Thu, 27 Jun 2024 08:29:07 +1000 Subject: [PATCH] Update docs --- readme.md | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/readme.md b/readme.md index 573a03e..1df5982 100644 --- a/readme.md +++ b/readme.md @@ -19,8 +19,6 @@ composer require timacdonald/callable-fake --dev This packge requires you to be testing a pretty specfic type of API / interaction to be useful. Imagine you are developing a package that ships with the following interface... ```php -assertCalled(function (Dependency $dependency): bool { return Str::startsWith($dependency->name, 'spatie/'); }); @@ -98,8 +90,6 @@ $callable->assertCalled(function (Dependency $dependency): bool { ### assertNotCalled(callable $callback): self ```php -assertNotCalled(function (Dependency $dependency): bool { return Str::startsWith($dependency->name, 'timacdonald/'); }); @@ -109,8 +99,6 @@ $callable->assertNotCalled(function (Dependency $dependency): bool { Ensure the callable was called in an explicit order, i.e. it was called as the 0th and 5th invocation. ```php -assertCalledIndex(function (Dependency $dependency): bool { return Str::startsWith($dependency, 'spatie/'); }, [0, 5]); @@ -119,8 +107,6 @@ $callable->assertCalledIndex(function (Dependency $dependency): bool { ### assertCalledTimes(callable $callback, int $times): self ```php -assertCalledTimes(function (Dependency $dependency): bool { return Str::startsWith($dependency, 'spatie/'); }, 999); @@ -129,24 +115,18 @@ $callable->assertCalledTimes(function (Dependency $dependency): bool { ### assertTimesInvoked(int $times): self ```php -assertTimesInvoked(2); ``` ### assertInvoked(): self ```php -assertInvoked(); ``` ### assertNotInvoked(): self ```php -assertNotInvoked(); ``` @@ -157,8 +137,6 @@ $callable->assertNotInvoked(); If the method is type-hinted with `\Closure` instead of callable, you can use this method to transform the callable to an instance of `\Closure`. ```php -closureTypeHintedMethod($callable->asClosure()); @@ -169,8 +147,6 @@ $callable->assertInvoked(); ### wasInvoked(): bool ```php -wasInvoked()) { // } @@ -179,8 +155,6 @@ if ($callable->wasInvoked()) { ### wasNotInvoked(): bool ```php -wasNotInvoked()) { // } @@ -189,8 +163,6 @@ if ($callable->wasNotInvoked()) { ### called(callable $callback): array ```php -called(function (Dependency $dependency): bool { return Str::startsWith($dependency->name, 'spatie/') }); @@ -201,8 +173,6 @@ $invocationArguments = $callable->called(function (Dependency $dependency): bool If you need to specify return values, this _could_ be an indicator that this is not the right tool for the job. But there are some cases where return values determine control flow, so it can be handy, in which case you can pass a "return resolver" to the named constructor `withReturnResolver`. ```php -version === '*') { return '🤠';