Skip to content

Commit

Permalink
Merge pull request #93 from eclipxe13/version-2.20.2
Browse files Browse the repository at this point in the history
Genkgo/Xsl version 1.1.0 (Version 2.20.2)
  • Loading branch information
eclipxe13 authored Apr 5, 2022
2 parents 86cc8bd + f30f2c9 commit be90639
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
"genkgo/xsl": "Allows usage of Genkgo/Xsl transformations"
},
"require-dev": {
"genkgo/xsl": "dev-master",
"genkgo/xsl": "^1.0.8|^1.1.0",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.6",
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/phpstan": "^0.12"
"phpstan/phpstan": "^1.5"
},
"autoload": {
"psr-4": {
Expand Down
10 changes: 9 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@
- Remove classes `CfdiUtils\Elements\Cfdi33\Helpers\SumasConceptosWriter` and `CfdiUtils\Elements\Cfdi40\Helpers\SumasConceptosWriter`.


## Unreleased 2022-03-18
## Version 2.20.2 2022-04-05

Allow installing Genkgo/Xsl version 1.1.0; used for PHP >= 7.4.

Test: Fix test that was overriding `retenciones/sample-before-tfd.xml` file.

Include the following unreleased changes

### 2022-03-18

Fix build since GitHub Action `sudo-bot/action-scrutinizer` is failing.
Use `scrutinizer/ocular` package instead.
Expand Down
6 changes: 3 additions & 3 deletions src/CfdiUtils/Utils/Xml.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public static function newDocumentContent(string $content): DOMDocument
// this error silenced call is intentional, no need to alter libxml_use_internal_errors
if (false === @$document->loadXML($content)) {
throw new \UnexpectedValueException(
trim('Cannot create a DOM Document from xml string' . PHP_EOL . static::castLibXmlLastErrorAsString())
trim('Cannot create a DOM Document from xml string' . PHP_EOL . self::castLibXmlLastErrorAsString())
);
}
return $document;
Expand Down Expand Up @@ -106,7 +106,7 @@ public static function isValidXmlName(string $name): bool
*/
public static function createElement(DOMDocument $document, string $name, string $content = ''): DOMElement
{
return static::createDOMElement(
return self::createDOMElement(
function () use ($document, $name) {
return $document->createElement($name);
},
Expand All @@ -131,7 +131,7 @@ public static function createElementNS(
string $name,
string $content = ''
): DOMElement {
return static::createDOMElement(
return self::createDOMElement(
function () use ($document, $namespaceURI, $name) {
return $document->createElementNS($namespaceURI, $name);
},
Expand Down
4 changes: 2 additions & 2 deletions tests/CfdiUtilsTests/CadenaOrigen/GenkgoXslBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

use CfdiUtils\CadenaOrigen\GenkgoXslBuilder;
use CfdiUtils\CadenaOrigen\XsltBuilderInterface;
use Genkgo\Xsl\XsltProcessor;

/** @requires PHP < 8.1 */
final class GenkgoXslBuilderTest extends GenericBuilderTestCase
{
protected function setUp(): void
{
if (! class_exists(\Genkgo\Xsl\XsltProcessor::class)) {
if (! class_exists(XsltProcessor::class)) {
$this->markTestSkipped('Genkgo/Xsl is not installed');
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ public function testCreatePreCfdiWithAllCorrectValues()
$this->assertFalse($asserts->hasErrors());

// check against known content
file_put_contents($this->utilAsset('retenciones/sample-before-tfd.xml'), $creator->asXml());
$this->assertXmlStringEqualsXmlFile($this->utilAsset('retenciones/sample-before-tfd.xml'), $creator->asXml());
}

Expand Down

0 comments on commit be90639

Please sign in to comment.