Browse Source

Use PHPStan v2

pull/9819/head
Aleksander Machniak 3 months ago
parent
commit
9afeb0174e
  1. 1
      .github/workflows/ci.yml
  2. 6
      composer.json
  3. 2
      installer/check.php
  4. 2
      phpstan.neon.dist
  5. 1
      program/include/iniset.php
  6. 2
      program/lib/Roundcube/rcube_washtml.php

1
.github/workflows/ci.yml

@ -78,5 +78,4 @@ jobs:
- name: Run Static Analysis
run: |
rm -r public_html # remove once https://github.com/phpstan/phpstan/issues/10321 is fixed
mkdir node_modules # remove once https://github.com/phpstan/phpstan/issues/11436 is fixed
vendor/bin/phpstan analyse -v

6
composer.json

@ -22,9 +22,9 @@
"ergebnis/phpunit-slow-test-detector": "^2.11",
"friendsofphp/php-cs-fixer": "^3.0",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.2",
"phpstan/phpstan-deprecation-rules": "^1.2",
"phpstan/phpstan-strict-rules": "^1.3",
"phpstan/phpstan": "^2.0",
"phpstan/phpstan-deprecation-rules": "^2.0",
"phpstan/phpstan-strict-rules": "^2.0",
"phpunit/phpunit": "^9.6.20 || ^10.0 || ^11.0",
"roundcube/acl": "*",
"roundcube/additional_message_headers": "*",

2
installer/check.php

@ -108,7 +108,7 @@ echo '<input type="hidden" name="_step" value="' . ($RCI->configured ? 3 : 2) .
<h3>Checking PHP version</h3>
<?php
define('MIN_PHP_VERSION', '7.3.0');
define('MIN_PHP_VERSION', '8.1.0');
if (version_compare(\PHP_VERSION, MIN_PHP_VERSION, '>=')) {
$RCI->pass('Version', 'PHP ' . \PHP_VERSION . ' detected');
} else {

2
phpstan.neon.dist

@ -7,7 +7,7 @@ parameters:
paths:
- .
excludePaths:
- node_modules
- node_modules (?)
- vendor
ignoreErrors:

1
program/include/iniset.php

@ -19,6 +19,7 @@
+-----------------------------------------------------------------------+
*/
// @phpstan-ignore-next-line
if (\PHP_VERSION_ID < 80100) {
exit('Unsupported PHP version. Required PHP >= 8.1.');
}

2
program/lib/Roundcube/rcube_washtml.php

@ -593,7 +593,7 @@ class rcube_washtml
}
foreach ($ns_nodes as $ns) {
if (isset($ns->nodeName) && isset($ns->nodeValue) // @phpstan-ignore property.notFound
if (isset($ns->nodeName) && isset($ns->nodeValue)
&& $ns->nodeName != 'xmlns:xml'
&& preg_match('/^[a-zA-Z:-]+$/', $ns->nodeName)
&& strpos($ns->nodeValue, '://')

Loading…
Cancel
Save