Skip to content

Commit

Permalink
Dropped compatibility with composer/composer:<2.0.14
Browse files Browse the repository at this point in the history
As discussed in #700
As noted in #700 (comment)

Since `composer/composer` broke BC in 2.0.14 by adding a runtime side-effect to a
functionally pure API (`InstalledVersions::getRawData()`) it is safest to move away
from it.

Since `composer-runtime-api:2.1.0` is not yet available, the safest approach is to
introduce a conflict with `composer/composer:<2.0.14` for now.

In the next release, we'll drop this `conflict` block and add bump `composer-runtime-api`
instead ( #702 ).
  • Loading branch information
Ocramius committed May 25, 2021
1 parent 5683c46 commit b5ee473
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"webimpress/safe-writer": "^2.2.0"
},
"conflict": {
"composer/composer": "<2.0.14",
"zendframework/zend-stdlib": "<3.2.1",
"laminas/laminas-stdlib": "<3.2.1",
"doctrine/annotations": "<1.6.1",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions src/ProxyManager/Generator/Util/IdentifierSuffixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Composer\InstalledVersions;

use function is_callable;
use function preg_match;
use function serialize;
use function sha1;
Expand Down Expand Up @@ -49,10 +48,6 @@ public static function getIdentifier(string $name): string

private static function loadBaseHashSalt(): string
{
return sha1(serialize(
is_callable([InstalledVersions::class, 'getAllRawData'])
? InstalledVersions::getAllRawData() // Composer >= 2.0.14
: InstalledVersions::getRawData()
));
return sha1(serialize(InstalledVersions::getAllRawData()));
}
}

0 comments on commit b5ee473

Please sign in to comment.