Skip to content

Commit

Permalink
Use composer/package-versions-deprecated instead of ocramius/package-…
Browse files Browse the repository at this point in the history
…versions (#3846)

It allows wider range of PHP versions in addition to supporting both
Composer v1 and v2

Fixes #3844
  • Loading branch information
weirdan authored Jul 20, 2020
1 parent 1524b62 commit 56047dd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"felixfbecker/language-server-protocol": "^1.4",
"netresearch/jsonmapper": "^1.0 || ^2.0 || ^3.0",
"nikic/php-parser": "^4.3",
"ocramius/package-versions": "^1.2",
"composer/package-versions-deprecated": "^1.8.0",
"openlss/lib-array2xml": "^1.0",
"sebastian/diff": "^3.0 || ^4.0",
"symfony/console": "^3.4.17 || ^4.1.6 || ^5.0",
Expand Down
5 changes: 5 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<referencedMethod name="PhpParser\Comment::getLine" />
</errorLevel>
</DeprecatedMethod>
<DeprecatedClass>
<errorLevel type="suppress">
<referencedClass name="PackageVersions\Versions"/>
</errorLevel>
</DeprecatedClass>

<UnusedParam>
<errorLevel type="suppress">
Expand Down
4 changes: 4 additions & 0 deletions tests/fixtures/SuicidalAutoloader/autoloader.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
<?php

use React\Promise\PromiseInterface as ReactPromise;
use ResourceBundle;
use Transliterator;
use Composer\InstalledVersions;

spl_autoload_register(function (string $className) {
$knownBadClasses = [
ReactPromise::class, // amphp/amp
ResourceBundle::class, // symfony/polyfill-php73
Transliterator::class, // symfony/string
InstalledVersions::class, // composer v2
// it's unclear why Psalm tries to autoload parent
'parent',
];
Expand Down

0 comments on commit 56047dd

Please sign in to comment.