Skip to content

Commit be90639

Browse files
authored
Merge pull request #93 from eclipxe13/version-2.20.2
Genkgo/Xsl version 1.1.0 (Version 2.20.2)
2 parents 86cc8bd + f30f2c9 commit be90639

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@
4242
"genkgo/xsl": "Allows usage of Genkgo/Xsl transformations"
4343
},
4444
"require-dev": {
45-
"genkgo/xsl": "dev-master",
45+
"genkgo/xsl": "^1.0.8|^1.1.0",
4646
"phpunit/phpunit": "^9.5",
4747
"squizlabs/php_codesniffer": "^3.6",
4848
"friendsofphp/php-cs-fixer": "^3.0",
49-
"phpstan/phpstan": "^0.12"
49+
"phpstan/phpstan": "^1.5"
5050
},
5151
"autoload": {
5252
"psr-4": {

docs/CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,15 @@
3131
- Remove classes `CfdiUtils\Elements\Cfdi33\Helpers\SumasConceptosWriter` and `CfdiUtils\Elements\Cfdi40\Helpers\SumasConceptosWriter`.
3232

3333

34-
## Unreleased 2022-03-18
34+
## Version 2.20.2 2022-04-05
35+
36+
Allow installing Genkgo/Xsl version 1.1.0; used for PHP >= 7.4.
37+
38+
Test: Fix test that was overriding `retenciones/sample-before-tfd.xml` file.
39+
40+
Include the following unreleased changes
41+
42+
### 2022-03-18
3543

3644
Fix build since GitHub Action `sudo-bot/action-scrutinizer` is failing.
3745
Use `scrutinizer/ocular` package instead.

src/CfdiUtils/Utils/Xml.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public static function newDocumentContent(string $content): DOMDocument
5353
// this error silenced call is intentional, no need to alter libxml_use_internal_errors
5454
if (false === @$document->loadXML($content)) {
5555
throw new \UnexpectedValueException(
56-
trim('Cannot create a DOM Document from xml string' . PHP_EOL . static::castLibXmlLastErrorAsString())
56+
trim('Cannot create a DOM Document from xml string' . PHP_EOL . self::castLibXmlLastErrorAsString())
5757
);
5858
}
5959
return $document;
@@ -106,7 +106,7 @@ public static function isValidXmlName(string $name): bool
106106
*/
107107
public static function createElement(DOMDocument $document, string $name, string $content = ''): DOMElement
108108
{
109-
return static::createDOMElement(
109+
return self::createDOMElement(
110110
function () use ($document, $name) {
111111
return $document->createElement($name);
112112
},
@@ -131,7 +131,7 @@ public static function createElementNS(
131131
string $name,
132132
string $content = ''
133133
): DOMElement {
134-
return static::createDOMElement(
134+
return self::createDOMElement(
135135
function () use ($document, $namespaceURI, $name) {
136136
return $document->createElementNS($namespaceURI, $name);
137137
},

tests/CfdiUtilsTests/CadenaOrigen/GenkgoXslBuilderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
use CfdiUtils\CadenaOrigen\GenkgoXslBuilder;
66
use CfdiUtils\CadenaOrigen\XsltBuilderInterface;
7+
use Genkgo\Xsl\XsltProcessor;
78

8-
/** @requires PHP < 8.1 */
99
final class GenkgoXslBuilderTest extends GenericBuilderTestCase
1010
{
1111
protected function setUp(): void
1212
{
13-
if (! class_exists(\Genkgo\Xsl\XsltProcessor::class)) {
13+
if (! class_exists(XsltProcessor::class)) {
1414
$this->markTestSkipped('Genkgo/Xsl is not installed');
1515
}
1616
}

tests/CfdiUtilsTests/Retenciones/RetencionesCreator10Test.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ public function testCreatePreCfdiWithAllCorrectValues()
8080
$this->assertFalse($asserts->hasErrors());
8181

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

0 commit comments

Comments
 (0)