src/CFDIReader/CFDIFactory.php
public function newCFDIReader(
        string $content,
        array &$errors = [],
        array &$warnings = [],
        bool $requireTimbre = true
    ): CFDIReader {
        // before creation
        $schemaValidator = $this->newSchemasValidator();
        $schemaValidator->validate($content);

        // creation
        $cfdireader = new CFDIReader($content, $requireTimbre);

        // after creation
        $postValidator = $this->newPostValidator();
        $postValidator->validate($cfdireader);
        $errors = $postValidator->issues->messages(PostValidations\IssuesTypes::ERROR)->all();
        $warnings = $postValidator->issues->messages(PostValidations\IssuesTypes::WARNING)->all();
        return $cfdireader;
    }
public function newCFDIReader(
        string $content,
        array &$errors = [],
        array &$warnings = [],
        bool $requireTimbre = true
    ): CFDIReader {
        // before creation
        $schemaValidator = $this->newSchemasValidator();
        $schemaValidator->validate($content);

        // creation
        $cfdireader = new CFDIReader($content, $requireTimbre);

        // after creation
        $postValidator = $this->newPostValidator();
        $postValidator->validate($cfdireader);
        $errors = $postValidator->issues->messages(PostValidations\IssuesTypes::ERROR)->all();
        $warnings = $postValidator->issues->messages(PostValidations\IssuesTypes::WARNING)->all();
        return $cfdireader;
    }
Create a CFDI Reader, it has to be valid otherwise a exception will be thrown
@param string $content
@param array $errors
@param array $warnings
@param bool $requireTimbre
@return CFDIReader