From e2ef1efcf8912855e36107a41977e7165c790d8c Mon Sep 17 00:00:00 2001 From: Posp Date: Thu, 7 Sep 2023 22:18:38 +0200 Subject: [PATCH] Update functions-when.md Callback in "when" has to return a value --- docs/functions-testing-tools/functions-when.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/functions-testing-tools/functions-when.md b/docs/functions-testing-tools/functions-when.md index e5e32d3..ec4d340 100644 --- a/docs/functions-testing-tools/functions-when.md +++ b/docs/functions-testing-tools/functions-when.md @@ -85,7 +85,7 @@ The last of the when-related methods allows to make a function behave just like ```php Functions\when('duplicate')->alias(function($value) { - "Was ".$value.", now is ".($value * 2); + return "Was ".$value.", now is ".($value * 2); }); Functions\when('bigger')->alias('strtoupper');