Skip to content

Commit d27d1ca

Browse files
author
akos
committed
add method to determine composer version
1 parent 312906b commit d27d1ca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Domain/Insights/Composer/ComposerMustBeValid.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
namespace NunoMaduro\PhpInsights\Domain\Insights\Composer;
66

7+
use Composer\Composer;
78
use Composer\IO\NullIO;
8-
use Composer\Util\ConfigValidator;
99
use Composer\Package\Loader\ValidatingArrayLoader;
10+
use Composer\Util\ConfigValidator;
1011
use NunoMaduro\PhpInsights\Domain\ComposerFinder;
1112
use NunoMaduro\PhpInsights\Domain\Contracts\HasDetails;
1213
use NunoMaduro\PhpInsights\Domain\Details;
@@ -59,4 +60,9 @@ private function process(): void
5960

6061
$this->analyzed = true;
6162
}
63+
64+
private function isComposerV2(): bool
65+
{
66+
return str_starts_with(Composer::getVersion(), '2');
67+
}
6268
}

0 commit comments

Comments
 (0)