Skip to content
This repository was archived by the owner on Oct 9, 2024. It is now read-only.

Commit f499c14

Browse files
committed
docs: Update README.
1 parent 90f92c6 commit f499c14

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ With composer:
4242

4343
declare(strict_types=1);
4444

45+
namespace App;
46+
4547
include 'vendor/autoload.php';
4648

4749
use loophp\memoize\Memoizer;
@@ -52,7 +54,7 @@ $callback = function ($a = 5, $b = 10) {
5254
return \sprintf('Param 1: %s Param 2: %s%s', $a, $b, \PHP_EOL);
5355
};
5456

55-
$memoizer = new Memoizer($callback, 'optional unique ID');
57+
$memoizer = Memoizer::fromClosure($callback);
5658

5759
echo $memoizer('A', 'B') . "\n";
5860
echo $memoizer('C', 'D') . "\n";

0 commit comments

Comments
 (0)