Skip to content

Commit

Permalink
add tests and docs for LazyLazy
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikbosch committed May 28, 2024
1 parent 8425c14 commit 43642d9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/lazy.md
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,10 @@ $routeHandler = $container->lazyLazy(
'process'
])
);

$response = $routeHandler($request, $param1, $param2);
```

In the above example `$routeHandler` can be injected in any place that receives a `callable` and can be called freely
because it does not have any parameters when `__invoke` is called. So, in that particular case, a `OrderController` class
is instantiated and the `process` method is called.
is instantiated and the `process` method is called with three given parameters.

0 comments on commit 43642d9

Please sign in to comment.