Skip to content

Commit 6fd8495

Browse files
committed
Undo; don't know how to fix this one
1 parent e260ede commit 6fd8495

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

tests/PhpWordTests/XmlDocument.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
use DOMDocument;
2222
use DOMElement;
23-
use DOMNameSpaceNode;
2423
use DOMNode;
2524
use DOMNodeList;
2625
use DOMXPath;
@@ -142,7 +141,7 @@ public function getFileDom(string $file = ''): DOMDocument
142141
/**
143142
* Get node list.
144143
*
145-
* @return DOMNodeList<DOMNameSpaceNode|DOMNode>|false
144+
* @return DOMNodeList<DOMNode>
146145
*/
147146
public function getNodeList(string $path, string $file = ''): DOMNodeList
148147
{
@@ -158,23 +157,15 @@ public function getNodeList(string $path, string $file = ''): DOMNodeList
158157
$this->xpath->registerNamespace('w14', 'http://schemas.microsoft.com/office/word/2010/wordml');
159158
}
160159

161-
$query = $this->xpath->query($path);
162-
163-
return $query;
160+
return $this->xpath->query($path);
164161
}
165162

166163
/**
167164
* Get element.
168165
*/
169166
public function getElement(string $path, string $file = ''): ?DOMElement
170167
{
171-
$element = $this->getNodeList($path, $file)->item(0);
172-
173-
if ($element === false) {
174-
return null;
175-
}
176-
177-
return $element;
168+
return $this->getNodeList($path, $file)->item(0);
178169
}
179170

180171
/**

0 commit comments

Comments
 (0)