Skip to content
Snippets Groups Projects

Issue #3285631: Make it impossible to call CronUpdater::begin() directly

Merged Issue #3285631: Make it impossible to call CronUpdater::begin() directly
All threads resolved!
All threads resolved!
1 file
+ 1
7
Compare changes
  • Side-by-side
  • Inline
+ 1
7
@@ -97,13 +97,7 @@ class CronUpdater extends Updater {
* {@inheritdoc}
*/
final public function begin(array $project_versions, ?int $timeout = 300): string {
// Prevent mischievous callers from starting an update even if unattended
// updates are disabled. To start an update programmatically, use
// \Drupal\automatic_updates\Updater::begin().
if ($this->getMode() === static::DISABLED) {
throw new \BadMethodCallException(__METHOD__ . '() cannot be called directly.');
}
return parent::begin($project_versions, $timeout);
throw new \BadMethodCallException($project_versions, $timeout);
}
/**
Loading