Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee committed Oct 30, 2023
1 parent a425c77 commit e0a25de
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/reader.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ Matcher\all(
);
```

ℹ️ If you specify no matchers internally, it will act as a "wildcard" matcher that always returns true.

#### any

One of the provided matchers need to match in order for this matcher to succeed:
Expand All @@ -170,6 +172,8 @@ Matcher\any(
);
```

ℹ️ If you specify no matchers internally, it will act as a "never" matcher that always returns false.

#### attribute_local_name

Matches current element based on attribute exists: `locale`.
Expand Down Expand Up @@ -334,13 +338,11 @@ This matcher will grab the `user` element with `locale="nl"`
```php
use \VeeWee\Xml\Reader\Matcher;

Matcher\not(
Matcher\sequence(
// Level 0: <root />
Matcher\document_element(),
// Level 1: <users />
// all() Acts as a wildcard to grab any element under document element.
// You could also go for the more exact element_name('users')
Matcher\all(),
Matcher\element_name('users'),
// Level 2: <user locale="nl">Jos</user>
// Searches for all elements that matches `<user />` and attribute `locale="nl"`
Matcher\all(
Expand Down

0 comments on commit e0a25de

Please sign in to comment.