Skip to content

Commit a1fb067

Browse files
authored
update phpstan to version 2 (#2046)
* use deprecation rules to prepare for phpstan 2 * replace deprecated strftime * remove obsolete statement * remove wrong deprecation The class XSLTProcessor is available in the PHP XSL extension * ignore internal deprecations * update phpstan to version 2 * regenerate phpstan baseline
1 parent b1afeaf commit a1fb067

13 files changed

+318
-108
lines changed

composer.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,13 @@
3131
"ext-json": "*",
3232
"ext-xml": "*",
3333
"monolog/monolog": "^1.3 || ^2.3 || ^3.0",
34-
"phpstan/phpstan": "^1.2",
34+
"phpstan/phpstan": "^2.0",
3535
"phpunit/phpunit": "^9.5.0",
3636
"spryker/code-sniffer": "^0.17.2",
3737
"psalm/phar": "^4.23",
38-
"mikey179/vfsstream": "^1.6"
38+
"mikey179/vfsstream": "^1.6",
39+
"phpstan/phpstan-deprecation-rules": "^2.0",
40+
"phpstan/extension-installer": "^1.4"
3941
},
4042
"suggest": {
4143
"monolog/monolog": "The recommended logging library to use with Propel."
@@ -72,7 +74,8 @@
7274
"config": {
7375
"process-timeout": 0,
7476
"allow-plugins": {
75-
"dealerdirect/phpcodesniffer-composer-installer": true
77+
"dealerdirect/phpcodesniffer-composer-installer": true,
78+
"phpstan/extension-installer": true
7679
}
7780
}
7881
}

phpstan-baseline.neon

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

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ parameters:
1010
- '#Call to an undefined method object::.+\(\)#'
1111
-
1212
identifier: missingType.iterableValue
13-
13+
- '#Call to deprecated method .* of class Propel\\#'

src/Propel/Generator/Builder/Om/ExtensionObjectBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function addClassOpen(string &$script): void
5050
* $tableDesc
5151
*";
5252
if ($this->getBuildProperty('generator.objectModel.addTimeStamp')) {
53-
$now = strftime('%c');
53+
$now = gmdate('c');
5454
$script .= "
5555
* This class was autogenerated by Propel " . $this->getBuildProperty('general.version') . " on:
5656
*

src/Propel/Generator/Builder/Om/ExtensionQueryBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected function addClassOpen(string &$script): void
5151
* $tableDesc
5252
*";
5353
if ($this->getBuildProperty('generator.objectModel.addTimeStamp')) {
54-
$now = strftime('%c');
54+
$now = gmdate('c');
5555
$script .= "
5656
* This class was autogenerated by Propel " . $this->getBuildProperty('general.version') . " on:
5757
*

src/Propel/Generator/Builder/Om/ExtensionQueryInheritanceBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ protected function addClassOpen(string &$script): void
101101
* $tableDesc
102102
*";
103103
if ($this->getBuildProperty('generator.objectModel.addTimeStamp')) {
104-
$now = strftime('%c');
104+
$now = gmdate('c');
105105
$script .= "
106106
* This class was autogenerated by Propel " . $this->getBuildProperty('general.version') . " on:
107107
*

src/Propel/Generator/Builder/Om/InterfaceBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function addClassOpen(string &$script): void
4848
* $tableDesc
4949
*";
5050
if ($this->getBuildProperty('generator.objectModel.addTimeStamp')) {
51-
$now = strftime('%c');
51+
$now = gmdate('c');
5252
$script .= "
5353
* This class was autogenerated by Propel " . $this->getBuildProperty('general.version') . " on:
5454
*

src/Propel/Generator/Builder/Om/MultiExtendObjectBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ protected function addClassOpen(string &$script): void
133133
* $tableDesc
134134
*";
135135
if ($this->getBuildProperty('generator.objectModel.addTimeStamp')) {
136-
$now = strftime('%c');
136+
$now = gmdate('c');
137137
$script .= "
138138
* This class was autogenerated by Propel " . $this->getBuildProperty('general.version') . " on:
139139
*

src/Propel/Generator/Builder/Om/ObjectBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ protected function addClassOpen(string &$script): void
256256
* $tableDesc
257257
*";
258258
if ($this->getBuildProperty('generator.objectModel.addTimeStamp')) {
259-
$now = strftime('%c');
259+
$now = gmdate('c');
260260
$script .= "
261261
* This class was autogenerated by Propel " . $this->getBuildProperty('general.version') . " on:
262262
*

src/Propel/Generator/Builder/Om/QueryInheritanceBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ protected function addClassOpen(string &$script): void
142142
* $tableDesc
143143
*";
144144
if ($this->getBuildProperty('generator.objectModel.addTimeStamp')) {
145-
$now = strftime('%c');
145+
$now = gmdate('c');
146146
$script .= "
147147
* This class was autogenerated by Propel " . $this->getBuildProperty('general.version') . " on:
148148
*

0 commit comments

Comments
 (0)