<?php

declare(strict_types=1);

namespace app\models\traits;

trait Xml2Array {
    protected static function xml2array($xmlObject, $out = [])
    {
        foreach ((array) $xmlObject as $index => $node)
            $out[$index] = (is_object($node) ||  is_array($node)) ? self::xml2array($node) : $node;

        return $out;
    }
}