Skip to content

Commit

Permalink
doc
Browse files Browse the repository at this point in the history
  • Loading branch information
dakujem committed Jan 18, 2024
1 parent 03ef5a1 commit 69161a7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ Oliva provides _tree builders_, classes that construct structured trees from uns
The data is usually in form of iterable collections, typically a result of SQL queries, API calls, and such.

```php
$tree = (new TreeBuilder)->build(
input: $anyDataCollection,
node: fn(mixed $data) => new Node($data), // This is a node factory.
$tree = (new TreeBuilder(
node: fn(mixed $data) => new Node($data), // A node factory.
))->build(
input: $anyDataCollection, // An iterable collection to build a tree from.
);
```

Expand Down

0 comments on commit 69161a7

Please sign in to comment.