Skip to content

Commit

Permalink
Drop deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee committed Jan 14, 2024
1 parent 1770824 commit c08f534
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 162 deletions.
12 changes: 6 additions & 6 deletions docs/reader.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ use VeeWee\Xml\Reader\Matcher;
$reader = Reader::fromXmlFile('large-data.xml');
$provider = $reader->provide(
$matcher = Matcher\all(
Matcher\node_name('item'),
Matcher\node_attribute('locale', 'nl-BE')
Matcher\element_name('item'),
Matcher\attribute_value('locale', 'nl-BE')
),
// Optionally, you can provide a signal to stop reading at a given point:
$signal = new Signal()
Expand Down Expand Up @@ -220,8 +220,8 @@ All provided matchers need to match in order for this matcher to succeed:
use \VeeWee\Xml\Reader\Matcher;

Matcher\all(
Matcher\node_name('item'),
Matcher\node_attribute('locale', 'nl-BE')
Matcher\element_name('item'),
Matcher\attribute_value('locale', 'nl-BE')
);
```

Expand All @@ -235,8 +235,8 @@ One of the provided matchers need to match in order for this matcher to succeed:
use \VeeWee\Xml\Reader\Matcher;

Matcher\any(
Matcher\node_name('item'),
Matcher\node_name('product'),
Matcher\element_name('item'),
Matcher\element_name('product'),
);
```

Expand Down
76 changes: 0 additions & 76 deletions tests/Xml/Reader/Matcher/NodeAttributeTest.php

This file was deleted.

69 changes: 0 additions & 69 deletions tests/Xml/Reader/Matcher/NodeNameTest.php

This file was deleted.

21 changes: 10 additions & 11 deletions tests/Xml/Reader/ReaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@
use function Psl\Vec\map;
use function VeeWee\Xml\Reader\Loader\xml_string_loader;
use function VeeWee\Xml\Reader\Matcher\all;
use function VeeWee\Xml\Reader\Matcher\attribute_value;
use function VeeWee\Xml\Reader\Matcher\element_name;
use function VeeWee\Xml\Reader\Matcher\node_attribute;
use function VeeWee\Xml\Reader\Matcher\node_name;

final class ReaderTest extends TestCase
{
Expand Down Expand Up @@ -101,7 +100,7 @@ public function provideXmlExpectations()
<user>Mos</user>
</root>
EOXML,
node_name('user'),
element_name('user'),
[
'<user>Jos</user>',
'<user>Bos</user>',
Expand All @@ -118,8 +117,8 @@ public function provideXmlExpectations()
</root>
EOXML,
all(
node_name('user'),
node_attribute('locale', 'nl')
element_name('user'),
attribute_value('locale', 'nl')
),
[
'<user locale="nl">Jos</user>',
Expand All @@ -137,9 +136,9 @@ public function provideXmlExpectations()
</root>
EOXML,
all(
node_name('user'),
node_attribute('locale', 'nl'),
node_attribute('dialect', 'kempisch'),
element_name('user'),
attribute_value('locale', 'nl'),
attribute_value('dialect', 'kempisch'),
),
[
'<user locale="nl" dialect="kempisch">Jos</user>',
Expand All @@ -156,7 +155,7 @@ public function provideXmlExpectations()
</root>
EOXML,
all(
node_name('user'),
element_name('user'),
static fn (NodeSequence $sequence): bool => ($sequence->current()->position() % 2 === 0),
),
[
Expand All @@ -177,7 +176,7 @@ public function provideXmlExpectations()
</root>
EOXML,
all(
node_name('user'),
element_name('user'),
static fn (NodeSequence $sequence): bool => ($sequence->current()->position() % 2 === 0),
),
[
Expand All @@ -200,7 +199,7 @@ public function provideXmlExpectations()
</root>
EOXML,
all(
node_name('item'),
element_name('item'),
),
[
'<item>
Expand Down

0 comments on commit c08f534

Please sign in to comment.