private function getTargetLanguageFromFile(DOMDocument $xliffContents): ?string
    {
        foreach ($xliffContents->getElementsByTagName('file')[0]->attributes ?? [] as $attribute) {
            if ($attribute->nodeName === 'target-language') {
                return $attribute->nodeValue;
            }
        }

        return null;
    }
private function getTargetLanguageFromFile(DOMDocument $xliffContents): ?string
    {
        foreach ($xliffContents->getElementsByTagName('file')[0]->attributes ?? [] as $attribute) {
            if ($attribute->nodeName === 'target-language') {
                return $attribute->nodeValue;
            }
        }

        return null;
    }
private function getTargetLanguageFromFile ( DOMDocument $ xliffContents ) : ? string { foreach ( $ xliffContents -> getElementsByTagName ( 'file' ) [ 0 ] -> attributes ?? [ ] as $ attribute ) { if ( $ attribute -> nodeName === 'target-language' ) { return $ attribute -> nodeValue ; } } return null ; }
Get the target language from file.

@param \DOMDocument $xliffContents

@return null|string
Get the target language from file .