Skip to content
Snippets Groups Projects

Issue #3328765: Throw an exception in setStageManipulator if it is already set

@@ -37,6 +37,9 @@ class Beginner extends BypassedStagerServiceBase implements BeginnerInterface {
@@ -37,6 +37,9 @@ class Beginner extends BypassedStagerServiceBase implements BeginnerInterface {
* The manipulator.
* The manipulator.
*/
*/
public static function setStageManipulator(StageFixtureManipulator $manipulator): void {
public static function setStageManipulator(StageFixtureManipulator $manipulator): void {
 
if (\Drupal::state()->get(__CLASS__ . '-stage-manipulator')) {
 
throw new \Exception('Stage manipulator already set.');
 
}
\Drupal::state()->set(__CLASS__ . '-stage-manipulator', $manipulator);
\Drupal::state()->set(__CLASS__ . '-stage-manipulator', $manipulator);
}
}
Loading