src/CfdiUtils/Cfdi.php
public static function newFromString(string $content): self
    {
        $document = Xml::newDocumentContent($content);
        // populate source since it is already available
        // in this way we avoid the conversion from document to string
        $cfdi = new self($document);
        $cfdi->source = $content;
        return $cfdi;
    }
public static function newFromString(string $content): self
    {
        $document = Xml::newDocumentContent($content);
        // populate source since it is already available
        // in this way we avoid the conversion from document to string
        $cfdi = new self($document);
        $cfdi->source = $content;
        return $cfdi;
    }
public static function newFromString ( string $ content ) : self { $ document = Xml :: newDocumentContent ( $ content ) ; // populate source since it is already available // in this way we avoid the conversion from document to string $ cfdi = new self ( $ document ) ; $ cfdi -> source = $ content ; return $ cfdi ; }
Create a Cfdi object from a xml string

@param string $content

@return static
Create a Cfdi object from a xml string