getCardTitles example

protected function parseFile(\DOMDocument $xml): array
    {
        return $this->getCardDefinitions($xml);
    }

    private function getCardDefinitions(\DOMDocument $xml): array
    {
        $cardDefinitions = [];

        foreach ($xml->getElementsByTagName('card') as $index => $element) {
            $cardDefinitions[] = [
                'title' => $this->getCardTitles($element),
                'name' => $this->getCardName($element),
                'elements' => $this->getElements($element),
            ];

            if ($this->getCardFlag($element) !== null) {
                $cardDefinitions[$index]['flag'] = $this->getCardFlag($element);
            }
        }

        return $cardDefinitions;
    }

    
Home | Imprint | This part of the site doesn't use cookies.