Skip to content

Commit 94d1dd6

Browse files
authored
chore: remove package-versions-deprecated dependency (#810)
1 parent 4068e95 commit 94d1dd6

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

composer.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
}
1111
],
1212
"require": {
13+
"composer-runtime-api": "^2.0",
1314
"php": ">=8.2",
1415
"ext-json": "*",
15-
"composer/package-versions-deprecated": "^1.8",
1616
"phpdocumentor/reflection-docblock": "^5.4",
1717
"phpdocumentor/type-resolver": "^1.7",
1818
"psr/container": "^1.1 || ^2",
@@ -64,7 +64,6 @@
6464
},
6565
"config": {
6666
"allow-plugins": {
67-
"composer/package-versions-deprecated": true,
6867
"dealerdirect/phpcodesniffer-composer-installer": true,
6968
"phpstan/extension-installer": true
7069
},

src/SchemaFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
namespace TheCodingMachine\GraphQLite;
66

7+
use Composer\InstalledVersions;
78
use GraphQL\Type\SchemaConfig;
89
use Kcs\ClassFinder\FileFinder\CachedFileFinder;
910
use Kcs\ClassFinder\FileFinder\DefaultFileFinder;
1011
use Kcs\ClassFinder\Finder\ComposerFinder;
1112
use Kcs\ClassFinder\Finder\FinderInterface;
12-
use PackageVersions\Versions;
1313
use Psr\Container\ContainerInterface;
1414
use Psr\SimpleCache\CacheInterface;
1515
use Symfony\Component\Cache\Adapter\ArrayAdapter;
@@ -141,7 +141,7 @@ public function __construct(
141141
private readonly ContainerInterface $container,
142142
private ClassBoundCache|null $classBoundCache = null,
143143
) {
144-
$this->cacheNamespace = substr(md5(Versions::getVersion('thecodingmachine/graphqlite')), 0, 8);
144+
$this->cacheNamespace = substr(md5(InstalledVersions::getVersion('thecodingmachine/graphqlite') ?? ''), 0, 8);
145145
}
146146

147147
/**

src/Utils/NamespacedCache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
namespace TheCodingMachine\GraphQLite\Utils;
66

7+
use Composer\InstalledVersions;
78
use DateInterval;
8-
use PackageVersions\Versions;
99
use Psr\SimpleCache\CacheInterface;
1010
use Psr\SimpleCache\InvalidArgumentException;
1111
use function md5;
@@ -22,7 +22,7 @@ class NamespacedCache implements CacheInterface
2222

2323
public function __construct(private readonly CacheInterface $cache)
2424
{
25-
$this->namespace = substr(md5(Versions::getVersion('thecodingmachine/graphqlite')), 0, 8);
25+
$this->namespace = substr(md5(InstalledVersions::getVersion('thecodingmachine/graphqlite') ?? ''), 0, 8);
2626
}
2727

2828
/**

0 commit comments

Comments
 (0)