AzuraCast/src/Xml/Reader.php

38 lines
685 B
PHP
Raw Normal View History

<?php
/**
* Extends the Zend Config XML library to allow attribute handling.
*/
2021-07-19 05:53:45 +00:00
declare(strict_types=1);
namespace App\Xml;
use Laminas\Config\Reader\Xml;
2019-09-04 18:00:51 +00:00
/**
* XML config reader.
*/
2019-09-04 18:00:51 +00:00
class Reader extends Xml
{
/**
* Get all attributes on the current node.
*
* @return string[]
*/
protected function getAttributes(): array
{
$attributes = [];
if ($this->reader->hasAttributes) {
while ($this->reader->moveToNextAttribute()) {
$attributes['@' . $this->reader->localName] = $this->reader->value;
}
$this->reader->moveToElement();
}
return $attributes;
}
2019-09-04 18:00:51 +00:00
}