Skip to content

Commit 8c55631

Browse files
committed
Merge branch 'release/2.0.3'
2 parents a4da82e + e0c9cc2 commit 8c55631

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# CHANGELOG
22

3+
## 2.0.3 - 2021/02/01
4+
- issue #3 - getAttributes returns an empty array
5+
36
## 2.0.2 - 2021/01/30
47
- issue #2 - DOMXPath::query(): Node From Wrong Document
58

src/AbstractNodeHandler.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,9 @@ private function getHandlers(?Traversable $nodes): array
9999
}
100100

101101
$handlers = array();
102-
foreach ($nodes as $index => $node) {
103-
if (!is_int($index)) {
104-
continue;
105-
}
106-
107-
$handlers[] = $this->getDomDocumentHandler()->getHandler($node, $index);
102+
$index = 0;
103+
foreach ($nodes as $node) {
104+
$handlers[] = $this->getDomDocumentHandler()->getHandler($node, $index++);
108105
}
109106

110107
return $handlers;

tests/NodeHandlerTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace WsdlToPhp\DomHandler\Tests;
66

7+
use WsdlToPhp\DomHandler\AbstractAttributeHandler;
78
use WsdlToPhp\DomHandler\AbstractNodeHandler;
89

910
class NodeHandlerTest extends TestCase
@@ -57,6 +58,7 @@ public function testGetAttributes()
5758
$this->assertContainsOnlyInstancesOf(AbstractAttributeHandler::class, $schema->getAttributes());
5859
$this->assertContainsOnlyInstancesOf(AbstractAttributeHandler::class, $element->getAttributes());
5960
$this->assertEmpty($sequence->getAttributes());
61+
$this->assertCount(2, $schema->getAttributes());
6062
}
6163

6264
public function testHasChildren()

0 commit comments

Comments
 (0)