You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Tests/Tests/epv_test_validate_composer.php
+23-2Lines changed: 23 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,7 @@ public function validateFile(FileInterface $file)
47
47
48
48
$this->validateName($file);
49
49
$this->validateLicense($file);
50
+
$this->validateVersion($file);
50
51
}
51
52
52
53
/**
@@ -58,17 +59,37 @@ private function validateLicense(ComposerFileInterface $file)
58
59
{
59
60
$json = $file->getJson();
60
61
$this->addMessageIfBooleanTrue(!isset($json['license']), Output::FATAL, 'The license key is missing');
61
-
$this->addMessageIfBooleanTrue($json['license'] != 'GPL-2.0', Output::ERROR, 'It is required to use the GPL-2.0 as license. MIT is not allowed as per the extension database policies.');
62
+
$this->addMessageIfBooleanTrue(isset($json['license']) && $json['license'] != 'GPL-2.0', Output::ERROR, 'It is required to use the GPL-2.0 as license. MIT is not allowed as per the extension database policies.');
$this->addMessageIfBooleanTrue(!isset($json['name']), Output::FATAL, 'The name key is missing');
68
-
$this->addMessageIfBooleanTrue(strpos($json['name'], '_') !== false, Output::FATAL, 'The namespace should not contain underscores');
69
+
$this->addMessageIfBooleanTrue(isset($json['name']) && strpos($json['name'], '_') !== false, Output::FATAL, 'The namespace should not contain underscores');
$this->addMessageIfBooleanTrue(true, Output::ERROR, sprintf('A invalid version constraint is used in soft-require: phpbb/phpbb. You can\'t combine a <|<=|~|\^|>|>= with a *|x. Please replace %s with %s', $json['extra']['soft-require']['phpbb/phpbb'], $replace));
0 commit comments