Skip to content

Commit

Permalink
Fix youth player last match
Browse files Browse the repository at this point in the history
  • Loading branch information
jetwitaussi committed Mar 25, 2019
1 parent 41cca7a commit 233f350
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions PHT/Xml/Player/Youth.php
Original file line number Diff line number Diff line change
Expand Up @@ -566,9 +566,10 @@ public function getScoutCall()
*/
public function getLastMatch()
{
if ($this->getXml()->getElementsByTagName('LastMatch')->length) {
$node = $this->getXml()->getElementsByTagName('LastMatch')->item(0);
if ($node !== null && $node->hasChildNodes()) {
$match = new \DOMDocument('1.0', 'UTF-8');
$match->appendChild($match->importNode($this->getXml()->getElementsByTagName('LastMatch')->item(0), true));
$match->appendChild($match->importNode($node, true));
return new LastMatch($match, Config\Config::MATCH_YOUTH);
}
return null;
Expand Down

0 comments on commit 233f350

Please sign in to comment.