src/Xml/XliffFile.php
public function extractTranslationKeys(): \Generator
    {
        /** @var \DOMNodeList $tmp */
        $transUnits = $this->getXPath()->query('/xlf:xliff/xlf:file/xlf:body/xlf:trans-unit');

        if ($transUnits->length > 0) {
            /** @var \DOMElement $element */
            foreach ($transUnits as $element) {
                if ('' === $key = $element->getAttributeNS(self::XLIFF_NS, 'id')) {
                    throw new \RuntimeException('Empty Id: ' . var_export($element, true));
                }
                yield $key;
            }
        }
    }
public function extractTranslationKeys(): \Generator
    {
        /** @var \DOMNodeList $tmp */
        $transUnits = $this->getXPath()->query('/xlf:xliff/xlf:file/xlf:body/xlf:trans-unit');

        if ($transUnits->length > 0) {
            /** @var \DOMElement $element */
            foreach ($transUnits as $element) {
                if ('' === $key = $element->getAttributeNS(self::XLIFF_NS, 'id')) {
                    throw new \RuntimeException('Empty Id: ' . var_export($element, true));
                }
                yield $key;
            }
        }
    }
public function extractTranslationKeys ( ) : \ Generator { /** @var \DOMNodeList $tmp */ $ transUnits = $ this -> getXPath ( ) -> query ( '/xlf:xliff/xlf:file/xlf:body/xlf:trans-unit' ) ; if ( $ transUnits -> length > 0 ) { /** @var \DOMElement $element */ foreach ( $ transUnits as $ element ) { if ( '' === $ key = $ element -> getAttributeNS ( self :: XLIFF_NS , 'id' ) ) { throw new \ RuntimeException ( 'Empty Id: ' . var_export ( $ element , true ) ) ; } yield $ key ; } } }
Obtain all keys within the dictionary.

@return \Generator

@throws \RuntimeException When the id is empty.
Obtain all keys within the dictionary .