Skip to content

Commit 86348d1

Browse files
authored
Merge pull request #21 from eclipxe13/compat-php84
Make it compatible with PHP 8.4 (version 0.4.3)
2 parents 61288f8 + 3948d71 commit 86348d1

File tree

11 files changed

+43
-22
lines changed

11 files changed

+43
-22
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ jobs:
2323
- name: Setup PHP
2424
uses: shivammathur/setup-php@v2
2525
with:
26-
php-version: '8.3'
26+
php-version: '8.4'
2727
coverage: none
2828
tools: composer-normalize
2929
env:
3030
fail-fast: true
3131
- name: Composer normalize
32-
run: composer-normalize
32+
run: composer-normalize --dry-run
3333

3434
phpcs:
3535
name: Code style (phpcs)
@@ -40,7 +40,7 @@ jobs:
4040
- name: Setup PHP
4141
uses: shivammathur/setup-php@v2
4242
with:
43-
php-version: '8.3'
43+
php-version: '8.4'
4444
coverage: none
4545
tools: cs2pr, phpcs
4646
env:
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup PHP
5858
uses: shivammathur/setup-php@v2
5959
with:
60-
php-version: '8.3'
60+
php-version: '8.4'
6161
coverage: none
6262
tools: cs2pr, php-cs-fixer
6363
env:
@@ -74,10 +74,10 @@ jobs:
7474
- name: Setup PHP
7575
uses: shivammathur/setup-php@v2
7676
with:
77-
php-version: '8.3'
77+
php-version: '8.4'
78+
extensions: soap, gd
7879
coverage: none
7980
tools: composer:v2, phpstan
80-
extensions: soap, gd
8181
env:
8282
fail-fast: true
8383
- name: Get composer cache directory
@@ -99,7 +99,7 @@ jobs:
9999
runs-on: "ubuntu-latest"
100100
strategy:
101101
matrix:
102-
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3']
102+
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
103103
steps:
104104
- name: Checkout
105105
uses: actions/checkout@v4
@@ -113,9 +113,9 @@ jobs:
113113
uses: shivammathur/setup-php@v2
114114
with:
115115
php-version: ${{ matrix.php-version }}
116+
extensions: soap, gd
116117
coverage: xdebug
117118
tools: composer:v2
118-
extensions: soap, gd
119119
env:
120120
fail-fast: true
121121
- name: Install SAT XML resources

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
uses: shivammathur/setup-php@v2
2323
with:
2424
php-version: '7.3' # use minimal version
25+
extensions: soap, gd
2526
coverage: none
2627
tools: composer:v2
27-
extensions: soap, gd
2828
env:
2929
fail-fast: true
3030
- name: "Get composer cache directory"

.phive/phars.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="composer-normalize" version="^2.43.0" installed="2.43.0" location="./tools/composer-normalize" copy="false"/>
4-
<phar name="php-cs-fixer" version="^3.64.2" installed="3.64.0" location="./tools/php-cs-fixer" copy="false"/>
5-
<phar name="phpcs" version="^3.10.2" installed="3.10.2" location="./tools/phpcs" copy="false"/>
6-
<phar name="phpcbf" version="^3.10.2" installed="3.10.2" location="./tools/phpcbf" copy="false"/>
7-
<phar name="phpstan" version="^1.12.0" installed="1.12.0" location="./tools/phpstan" copy="false"/>
3+
<phar name="composer-normalize" version="^2.48.2" installed="2.48.2" location="./tools/composer-normalize" copy="false"/>
4+
<phar name="php-cs-fixer" version="^3.89.2" installed="3.89.2" location="./tools/php-cs-fixer" copy="false"/>
5+
<phar name="phpcs" version="^3.13.5" installed="3.13.5" location="./tools/phpcs" copy="false"/>
6+
<phar name="phpcbf" version="^3.13.5" installed="3.13.5" location="./tools/phpcbf" copy="false"/>
7+
<phar name="phpstan" version="^2.1.31" installed="2.1.31" location="./tools/phpstan" copy="false"/>
88
</phive>

.php-cs-fixer.dist.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
->setRules([
1616
'@PSR12' => true,
1717
'@PSR12:risky' => true,
18-
'@PHP71Migration:risky' => true,
19-
'@PHP73Migration' => true,
18+
'@PHP7x1Migration:risky' => true,
19+
'@PHP7x3Migration' => true,
2020
// basic
2121
'statement_indentation' => false, // invalid indentation
2222
// symfony

.scrutinizer.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ filter:
66
# see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/
77
build:
88
dependencies:
9+
before:
10+
- php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
11+
- php composer-setup.php --install-dir=$HOME/bin --filename=composer
12+
- php -r "unlink('composer-setup.php');"
13+
- $HOME/bin/composer --version
914
override:
1015
- composer update --no-interaction
1116
nodes:

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2018 - 2024 PhpCfdi https://www.phpcfdi.com/
3+
Copyright (c) 2018 - 2025 PhpCfdi https://www.phpcfdi.com/
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
},
2424
"require": {
2525
"php": ">=7.3",
26-
"eclipxe/cfdiutils": "^2.29",
26+
"eclipxe/cfdiutils": "^2.31 || ^3.0",
2727
"league/plates": "^3.5",
2828
"phpcfdi/cfdi-cleaner": "^1.3.3",
2929
"spipu/html2pdf": "^5.2.8"

docs/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# `phpcfdi/cfditopdf` Changelog
22

3+
## Version 0.4.3 2024-11-08
4+
5+
- Fix compatibility with PHP 8.4.
6+
- Allow dependence of `eclipxe/cfdiutils` to match versions `^2.31` and `^3.0`.
7+
- Update license year to 2025.
8+
9+
These changes apply to the development environment:
10+
11+
- Update code standards for `phpcs` and `php-cs-fixer`.
12+
- Add PHP 8.4 to test matrix.
13+
- Run workflows jobs using PHP 8.4.
14+
- Fix workflow job `composer-normalize`. It didn't fail on `composer.json` errors.
15+
- Update development tools.
16+
317
## Version 0.4.2 2024-09-02
418

519
- Fix issue on CFDI 4.0 generate only the first block of information for `cfdi:CfdiRelacionados`.

phpcs.xml.dist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
<rule ref="Generic.CodeAnalysis.UnnecessaryFinalModifier"/>
2222
<rule ref="Generic.CodeAnalysis.UselessOverridingMethod"/>
2323
<rule ref="Generic.Formatting.SpaceAfterNot"/>
24-
<rule ref="Generic.Functions.CallTimePassByReference"/>
2524
<rule ref="Generic.NamingConventions.ConstructorName"/>
2625
<rule ref="Generic.PHP.DeprecatedFunctions"/>
2726
<rule ref="Squiz.PHP.DisallowSizeFunctionsInLoops"/>

src/Builders/Html2PdfBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Html2PdfBuilder implements BuilderInterface
2020
*
2121
* @param HtmlTranslatorInterface|null $htmlTranslator If NULL will use a generic translator
2222
*/
23-
public function __construct(HtmlTranslatorInterface $htmlTranslator = null)
23+
public function __construct(?HtmlTranslatorInterface $htmlTranslator = null)
2424
{
2525
if (null === $htmlTranslator) {
2626
$htmlTranslator = new HtmlTranslators\PlatesHtmlTranslator(

0 commit comments

Comments
 (0)