<commit_before># CfdiUtils Changelog file

## Backward compatibility breaks (not released yet), plan for version 3.0

- Remove deprecated classes:
    - `\CfdiUtils\CadenaOrigen\CadenaOrigenBuilder`
    - `\CfdiUtils\CadenaOrigen\DefaultLocations`
    - `\CfdiUtils\CadenaOrigen\CadenaOrigenLocations`
- Remove `\CfdiUtils\PemPrivateKey\PemPrivateKey::isOpened` to `\CfdiUtils\PemPrivateKey\PemPrivateKey::isOpen`
- Remove `CfdiUtils\ConsultaCfdiSat\Config::getWsdlUrl()`
- Remove `static` methods from `\CfdiUtils\CfdiVersion`, instead create an instance of the class
- Remove `static` methods from `\CfdiUtils\TimbreFiscalDigital\TfdVersion`, instead create an instance of the class
- Remove `trigger_error` on `\CfdiUtils\Elements\Cfdi33\Comprobante::getCfdiRelacionados` when called with arguments.
- Change signature of `CfdiUtils\Elements\Cfdi33\CfdiRelacionados::multiCfdiRelacionado` to receive as paremers
  `array ...$elementAttributes` instead of `array $elementAttributes`.
- Refactor `\CfdiUtils\Certificado\SerialNumber` to be immutable, this change will remove `loadHexadecimal`,
  `loadDecimal` and `loadAscii`.
- Remove `CfdiUtils\Certificado\SerialNumber::baseConvert` method. Should be private or not exists at all.
- Add a method `NodeInderface::exists` as an alias of `NodeInderface::offsetExists`. Replace usages in code.
- Remove static `CfdiUtils\PemPrivateKey\PemPrivateKey::isPEM` method.
- Add a method to execute `CfdiUtils\ConsultaCfdiSat\StatusResponse` using an expression instead of `RequestParameters`.
- Make `CfdiUtils\ConsultaCfdiSat\StatusResponse::__constructor()` third and fourth arguments non-optional.
  Now they are optional to avoid incompatibility changes.
- Remove `CfdiUtils\ConsultaCfdiSat\Config::DEFAULT_SERVICE_URL`
- Remove `CfdiUtils\ConsultaCfdiSat\Config::getWsdlLocation()`, `CfdiUtils\ConsultaCfdiSat\Config::getWsdlLocation()`
  and fix `CfdiUtils\ConsultaCfdiSat\Config::__construct()`.
- Remove file `ConsultaCFDIServiceSAT.svc.xml`.
- Change visibility of `CfdiUtils\Cleaner\Cleaner#removeIncompleteSchemaLocation()` to private.


## UNRELEASED

The following changes apply only to development and has been applied to main branch.


## Version 2.18.3 2022-01-15

Fix *Carta Porte 1.0* add missing element `Notificado`. Thanks @celli33.


## Version 2.18.2 2021-12-17

Fix *Carta Porte 2.0* XML Namespace.


## Version 2.18.1 2021-12-17

Remove `development/` from distribution package.


## Version 2.18.0 2021-12-17
<commit_msg>Document changes for read and validate<commit_after># CfdiUtils Changelog file

## Backward compatibility breaks (not released yet), plan for version 3.0

- Remove deprecated classes:
    - `\CfdiUtils\CadenaOrigen\CadenaOrigenBuilder`
    - `\CfdiUtils\CadenaOrigen\DefaultLocations`
    - `\CfdiUtils\CadenaOrigen\CadenaOrigenLocations`
- Remove `\CfdiUtils\PemPrivateKey\PemPrivateKey::isOpened` to `\CfdiUtils\PemPrivateKey\PemPrivateKey::isOpen`
- Remove `CfdiUtils\ConsultaCfdiSat\Config::getWsdlUrl()`
- Remove `static` methods from `\CfdiUtils\CfdiVersion`, instead create an instance of the class
- Remove `static` methods from `\CfdiUtils\TimbreFiscalDigital\TfdVersion`, instead create an instance of the class
- Remove `trigger_error` on `\CfdiUtils\Elements\Cfdi33\Comprobante::getCfdiRelacionados` when called with arguments.
- Change signature of `CfdiUtils\Elements\Cfdi33\CfdiRelacionados::multiCfdiRelacionado` to receive as paremers
  `array ...$elementAttributes` instead of `array $elementAttributes`.
- Refactor `\CfdiUtils\Certificado\SerialNumber` to be immutable, this change will remove `loadHexadecimal`,
  `loadDecimal` and `loadAscii`.
- Remove `CfdiUtils\Certificado\SerialNumber::baseConvert` method. Should be private or not exists at all.
- Add a method `NodeInderface::exists` as an alias of `NodeInderface::offsetExists`. Replace usages in code.
- Remove static `CfdiUtils\PemPrivateKey\PemPrivateKey::isPEM` method.
- Add a method to execute `CfdiUtils\ConsultaCfdiSat\StatusResponse` using an expression instead of `RequestParameters`.
- Make `CfdiUtils\ConsultaCfdiSat\StatusResponse::__constructor()` third and fourth arguments non-optional.
  Now they are optional to avoid incompatibility changes.
- Remove `CfdiUtils\ConsultaCfdiSat\Config::DEFAULT_SERVICE_URL`
- Remove `CfdiUtils\ConsultaCfdiSat\Config::getWsdlLocation()`, `CfdiUtils\ConsultaCfdiSat\Config::getWsdlLocation()`
  and fix `CfdiUtils\ConsultaCfdiSat\Config::__construct()`.
- Remove file `ConsultaCFDIServiceSAT.svc.xml`.
- Change visibility of `CfdiUtils\Cleaner\Cleaner#removeIncompleteSchemaLocation()` to private.
- Remove deprecated constant `CfdiUtils\Cfdi::CFDI_NAMESPACE`.
- Remove `CfdiUtils\Validate\Cfdi33\Xml\XmlFollowSchema`.


## UNRELEASED

The following changes apply only to development and has been applied to main branch.


## Version 2.19.0 2022-01-??

Add CFDI 4.0 compatibility: read, validate and create:

- `CfdiUtils\Cfdi` object now can read CFDI 4.0.
- `CfdiUtils\CfdiValidator40` object was introduced to validate CFDI 4.0 with only the following validations:
    - The document follows de CFDI 4.0 specification (namespace, root element prefix and name).
    - The document follows de CFDI 4.0 schema.
    - The document has a valid `NoCertificado`, `Certificado` and `Sello`.
    - The document has a valid `TimbreFiscalDigital` and information matches with `cfdi:Comprobante@Sello`.

The following are development details:

- Created `\CfdiUtils\Validate\Xml\XmlFollowSchema` as a standard validator, it does not depend on the type of CFDI.
- The validator `CfdiUtils\Validate\Cfdi33\Xml\XmlFollowSchema` is now an extended class
  of `\CfdiUtils\Validate\Xml\XmlFollowSchema`. The class is also deprecated.
- Add `CfdiUtils\Certificado::getPemContentsOneLine()`.
- Add CFDI 4.0 information to:
    - `CfdiUtils\CadenaOrigen\CfdiDefaultLocations`.
    - `CfdiUtils\Certificado\NodeCertificado`.
    - `CfdiUtils\CfdiVersion`.
- Deprecate `CfdiUtils\Cfdi::CFDI_NAMESPACE`.
- Add `CfdiUtils\CfdiCreateObjectException` that contains all the failures when try to construct a `CfdiUtils\Cfdi` object.
- Extract and share logic for several objects that are CFDI 3.3 and CFDI 4.0 compatible:
    - `CfdiUtils\CfdiValidator33` to `CfdiUtils\Validate\CfdiValidatorTrait`.
    - `CfdiUtils\Validate\Cfdi33\Standard\SelloDigitalCertificado` to `CfdiUtils\Validate\Common\SelloDigitalCertificadoValidatorTrait`.
    - `CfdiUtils\Validate\Cfdi33\Standard\TimbreFiscalDigitalSello` to `CfdiUtils\Validate\Common\TimbreFiscalDigitalSelloValidatorTrait`.
    - `CfdiUtils\Validate\Cfdi33\Standard\TimbreFiscalDigitalVersion` to `CfdiUtils\Validate\Common\TimbreFiscalDigitalVersionValidatorTrait`.
- The certificate PAC used for testing `30001000000400002495` is included.
- The class `CfdiUtilsTests\Validate\ValidateTestCase` was renamed to `CfdiUtilsTests\Validate\Validate33TestCase` and
  extracted to `CfdiUtilsTests\Validate\ValidateBaseTestCase` because it share a lot of logic with `CfdiUtilsTests\Validate\Validate40TestCase`.


## Version 2.18.3 2022-01-15

Fix *Carta Porte 1.0* add missing element `Notificado`. Thanks @celli33.


## Version 2.18.2 2021-12-17

Fix *Carta Porte 2.0* XML Namespace.


## Version 2.18.1 2021-12-17

Remove `development/` from distribution package.


## Version 2.18.0 2021-12-17

{'fraction_non_alphanumeric': 0.09813275180591523, 'fraction_numerical': 0.025078369905956112, 'mean_word_length': 5.320413436692506, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '302548', 'n_tokens_mistral': 2565, 'n_tokens_neox': 2427, 'n_words': 609}