summaryrefslogtreecommitdiffstatshomepage
path: root/core/lib/Drupal/Core/Recipe/RecipeAppliedEvent.php
blob: 3e3078d23ca21b7d404651aab79aeff0fff203a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

declare(strict_types=1);

namespace Drupal\Core\Recipe;

use Symfony\Contracts\EventDispatcher\Event;

/**
 * Event dispatched after a recipe has been applied.
 *
 * Subscribers to this event should avoid modifying config or content, because
 * it is very likely that the recipe was applied as part of a chain of recipes,
 * so config and content are probably about to change again. This event is best
 * used for tasks like notifications, logging or updating a value in state.
 */
final class RecipeAppliedEvent extends Event {

  /**
   * Constructs a RecipeAppliedEvent object.
   *
   * @param \Drupal\Core\Recipe\Recipe $recipe
   *   The recipe that was applied.
   */
  public function __construct(public readonly Recipe $recipe) {
  }

}