Skip to content

Commit aea162a

Browse files
committed
Added check on Drupal core version before performing leniency tweaks.
1 parent 907cc0e commit aea162a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/ComposerCoreVersionsLeniency.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,21 @@ class ComposerCoreVersionsLeniency {
2929
* The event.
3030
*/
3131
public static function prePoolCreate(PrePoolCreateEvent $event) {
32-
// @todo Only act if the current branch of drupal/core is 11.x
32+
$packages = $event->getPackages();
33+
34+
// Only act if the current branch of drupal/core is 11.x
35+
/** @var \Composer\Package\BasePackage $package */
36+
foreach ($packages as $package) {
37+
if ($package->getName() == 'drupal/core') {
38+
if ($package->getPrettyVersion() != '11.x-dev') {
39+
return;
40+
}
41+
}
42+
}
3343

3444
$version_parser = new VersionParser();
3545

36-
$packages = $event->getPackages();
46+
/** @var \Composer\Package\BasePackage $package */
3747
foreach ($packages as $package) {
3848
$type = $package->getType();
3949
if ($type === 'drupal-core') {

0 commit comments

Comments
 (0)