Skip to content
Snippets Groups Projects
Commit 4b11c748 authored by Adam G-H's avatar Adam G-H Committed by Ted Bowman
Browse files

Issue #3317267 by phenaproxima: Deprecate the overridability of...

Issue #3317267 by phenaproxima: Deprecate the overridability of Stage::TEMPSTORE_LOCK_KEY and Stage::TEMPSTORE_METADATA_KEY
parent ae43ceee
No related branches found
No related tags found
No related merge requests found
......@@ -240,6 +240,12 @@ class Stage implements LoggerAwareInterface {
}
$this->failureMarker = $failure_marker;
$this->setLogger(new NullLogger());
if (self::TEMPSTORE_METADATA_KEY !== static::TEMPSTORE_METADATA_KEY) {
@trigger_error('Overriding ' . __CLASS__ . '::TEMPSTORE_METADATA_KEY is deprecated in automatic_updates:8.x-2.5 and will not be possible in automatic_updates:3.0.0. There is no replacement. See https://www.drupal.org/node/3317450.', E_USER_DEPRECATED);
}
if (self::TEMPSTORE_LOCK_KEY !== static::TEMPSTORE_LOCK_KEY) {
@trigger_error('Overriding ' . __CLASS__ . '::TEMPSTORE_LOCK_KEY is deprecated in automatic_updates:8.x-2.5 and will not be possible in automatic_updates:3.0.0. There is no replacement. See https://www.drupal.org/node/3317450.', E_USER_DEPRECATED);
}
}
/**
......
......@@ -395,7 +395,9 @@ class StageTest extends PackageManagerKernelTestBase {
public function testConstructorDeprecations(): void {
$this->expectDeprecation('Calling Drupal\package_manager\Stage::__construct() without the $path_factory argument is deprecated in automatic_updates:8.x-2.3 and will be required before automatic_updates:3.0.0. See https://www.drupal.org/node/3310706.');
$this->expectDeprecation('Calling Drupal\package_manager\Stage::__construct() without the $failure_marker argument is deprecated in automatic_updates:8.x-2.3 and will be required before automatic_updates:3.0.0. See https://www.drupal.org/node/3311257.');
new Stage(
$this->expectDeprecation('Overriding Drupal\package_manager\Stage::TEMPSTORE_METADATA_KEY is deprecated in automatic_updates:8.x-2.5 and will not be possible in automatic_updates:3.0.0. There is no replacement. See https://www.drupal.org/node/3317450.');
$this->expectDeprecation('Overriding Drupal\package_manager\Stage::TEMPSTORE_LOCK_KEY is deprecated in automatic_updates:8.x-2.5 and will not be possible in automatic_updates:3.0.0. There is no replacement. See https://www.drupal.org/node/3317450.');
new TestStageOverriddenConstants(
$this->container->get('config.factory'),
$this->container->get('package_manager.path_locator'),
$this->container->get('package_manager.beginner'),
......@@ -496,3 +498,17 @@ class TestTime extends Time {
}
}
class TestStageOverriddenConstants extends Stage {
/**
* {@inheritdoc}
*/
protected const TEMPSTORE_LOCK_KEY = 'overridden_lock';
/**
* {@inheritdoc}
*/
protected const TEMPSTORE_METADATA_KEY = 'overridden_metadata';
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment