From e35e414779f19313aa5e5188fe8de0fb3c08e4ec Mon Sep 17 00:00:00 2001 From: Melek REBAI Date: Mon, 10 Jun 2024 14:34:02 +0100 Subject: [PATCH] Update README (#136) Replace the wrong method name `calculate()` with `execute()` --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d446dbc..8ed00a7 100644 --- a/README.md +++ b/README.md @@ -110,14 +110,14 @@ $executor->addFunction('concat', function($arg1, $arg2) {return $arg1 . $arg2;}) Optional parameters: ```php $executor->addFunction('round', function($num, int $precision = 0) {return round($num, $precision);}); -$executor->calculate('round(17.119)'); // 17 -$executor->calculate('round(17.119, 2)'); // 17.12 +$executor->execute('round(17.119)'); // 17 +$executor->execute('round(17.119, 2)'); // 17.12 ``` Variable number of parameters: ```php $executor->addFunction('average', function(...$args) {return array_sum($args) / count($args);}); -$executor->calculate('average(1,3)'); // 2 -$executor->calculate('average(1, 3, 4, 8)'); // 4 +$executor->execute('average(1,3)'); // 2 +$executor->execute('average(1, 3, 4, 8)'); // 4 ``` ## Operators: