Skip to content

Commit 69fc95f

Browse files
committed
Add php85 support
- Drop <= php8.2 - Add php85 related fixes (inspired from upstream) - Perform php83 upgrades using rector
1 parent e8142b3 commit 69fc95f

File tree

16 files changed

+562
-380
lines changed

16 files changed

+562
-380
lines changed

.github/workflows/unittests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
strategy:
1313
matrix:
1414
os: ['ubuntu-latest']
15-
php: ['8.1', '8.2', '8.3', '8.4']
15+
php: ['8.3', '8.4', '8.5']
1616
steps:
1717
- name: Set locales
1818
run: |

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
}
3131
],
3232
"require": {
33-
"php": "~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0",
33+
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
3434
"ext-dom": "*",
3535
"ext-gettext": "*",
3636
"ext-simplexml": "*",
@@ -59,7 +59,7 @@
5959
},
6060
"config": {
6161
"platform": {
62-
"php": "8.1"
62+
"php": "8.3"
6363
},
6464
"bin-dir": "bin",
6565
"sort-packages": true

composer.lock

Lines changed: 502 additions & 322 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,6 @@ parameters:
130130
count: 1
131131
path: src/Php/Attribute/I18N/Translate.php
132132

133-
-
134-
message: "#^PHPDoc tag @var with type PhpTal\\\\Dom\\\\Node is not subtype of native type mixed\\.$#"
135-
count: 1
136-
path: src/Php/Attribute/METAL/FillSlot.php
137-
138133
-
139134
message: "#^Parameter \\#1 \\$condition of method PhpTal\\\\Php\\\\CodeWriter\\:\\:doIf\\(\\) expects string, string\\|null given\\.$#"
140135
count: 1

rector.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Rector\Php74\Rector\LNumber\AddLiteralSeparatorToNumberRector;
99
use Rector\Php80\Rector\FunctionLike\MixedTypeRector;
1010
use Rector\Php81\Rector\Array_\FirstClassCallableRector;
11+
use Rector\Php83\Rector\ClassMethod\AddOverrideAttributeToOverriddenMethodsRector;
1112

1213
return RectorConfig::configure()
1314
->withPaths([
@@ -19,8 +20,9 @@
1920
StringClassNameToClassConstantRector::class,
2021
FirstClassCallableRector::class,
2122
MixedTypeRector::class,
23+
AddOverrideAttributeToOverriddenMethodsRector::class,
2224
])
23-
->withPhpSets(php81: true)
25+
->withPhpSets(php83: true)
2426
->withPreparedSets(deadCode: true)
2527
->withRules([
2628
AddLiteralSeparatorToNumberRector::class,

src/Dom/Attr.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
*/
2222
class Attr
2323
{
24-
final public const HIDDEN = -1;
25-
final public const NOT_REPLACED = 0;
26-
final public const VALUE_REPLACED = 1;
27-
final public const FULLY_REPLACED = 2;
24+
final public const int HIDDEN = -1;
25+
final public const int NOT_REPLACED = 0;
26+
final public const int VALUE_REPLACED = 1;
27+
final public const int FULLY_REPLACED = 2;
2828

2929
/**
3030
* attribute's value can be overriden with a variable

src/Dom/SaxXmlParser.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,24 @@
3838
class SaxXmlParser
3939
{
4040
// available parser states
41-
final public const ST_ROOT = 0;
42-
final public const ST_TEXT = 1;
43-
final public const ST_LT = 2;
44-
final public const ST_TAG_NAME = 3;
45-
final public const ST_TAG_CLOSE = 4;
46-
final public const ST_TAG_SINGLE = 5;
47-
final public const ST_TAG_ATTRIBUTES = 6;
48-
final public const ST_TAG_BETWEEN_ATTRIBUTE = 7;
49-
final public const ST_CDATA = 8;
50-
final public const ST_COMMENT = 9;
51-
final public const ST_DOCTYPE = 10;
52-
final public const ST_XMLDEC = 11;
53-
final public const ST_PREPROC = 12;
54-
final public const ST_ATTR_KEY = 13;
55-
final public const ST_ATTR_EQ = 14;
56-
final public const ST_ATTR_QUOTE = 15;
57-
final public const ST_ATTR_VALUE = 16;
58-
final public const BOM_STR = "\xef\xbb\xbf";
41+
final public const int ST_ROOT = 0;
42+
final public const int ST_TEXT = 1;
43+
final public const int ST_LT = 2;
44+
final public const int ST_TAG_NAME = 3;
45+
final public const int ST_TAG_CLOSE = 4;
46+
final public const int ST_TAG_SINGLE = 5;
47+
final public const int ST_TAG_ATTRIBUTES = 6;
48+
final public const int ST_TAG_BETWEEN_ATTRIBUTE = 7;
49+
final public const int ST_CDATA = 8;
50+
final public const int ST_COMMENT = 9;
51+
final public const int ST_DOCTYPE = 10;
52+
final public const int ST_XMLDEC = 11;
53+
final public const int ST_PREPROC = 12;
54+
final public const int ST_ATTR_KEY = 13;
55+
final public const int ST_ATTR_EQ = 14;
56+
final public const int ST_ATTR_QUOTE = 15;
57+
final public const int ST_ATTR_VALUE = 16;
58+
final public const string BOM_STR = "\xef\xbb\xbf";
5959

6060
/**
6161
* @var array<int, string>

src/PHPTAL.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@
4343
*/
4444
class PHPTAL implements PhpTalInterface
4545
{
46-
final public const PHPTAL_VERSION = '3_0_2';
46+
final public const string PHPTAL_VERSION = '4_2_0';
4747

4848
/**
4949
* constants for output mode
5050
* @see setOutputMode()
5151
*/
52-
final public const XHTML = 11;
53-
final public const XML = 22;
54-
final public const HTML5 = 55;
52+
final public const int XHTML = 11;
53+
final public const int XML = 22;
54+
final public const int HTML5 = 55;
5555

5656
/**
5757
* @see getPreFilters()

src/Php/Attribute/METAL/FillSlot.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
*/
6161
class FillSlot extends Attribute
6262
{
63-
final public const CALLBACK_THRESHOLD = 10000;
63+
final public const int CALLBACK_THRESHOLD = 10000;
6464

6565
private static int $uid = 0;
6666

src/Php/TalesChainExecutor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
*/
2222
class TalesChainExecutor
2323
{
24-
final public const CHAIN_BREAK = 1;
25-
final public const CHAIN_CONT = 2;
24+
final public const int CHAIN_BREAK = 1;
25+
final public const int CHAIN_CONT = 2;
2626

2727
private int $state = 0;
2828

0 commit comments

Comments
 (0)