Security update to Drupal 8.4.6
[yaffs-website] / web / core / modules / migrate_drupal_ui / src / Batch / MigrateMessageCapture.php
1 <?php
2
3 namespace Drupal\migrate_drupal_ui\Batch;
4
5 use Drupal\migrate\MigrateMessageInterface;
6
7 /**
8  * Allows capturing messages rather than displaying them directly.
9  */
10 class MigrateMessageCapture implements MigrateMessageInterface {
11
12   /**
13    * Array of recorded messages.
14    *
15    * @var array
16    */
17   protected $messages = [];
18
19   /**
20    * {@inheritdoc}
21    */
22   public function display($message, $type = 'status') {
23     $this->messages[] = $message;
24   }
25
26   /**
27    * Clears out any captured messages.
28    */
29   public function clear() {
30     $this->messages = [];
31   }
32
33   /**
34    * Returns any captured messages.
35    *
36    * @return array
37    *   The captured messages.
38    */
39   public function getMessages() {
40     return $this->messages;
41   }
42
43 }