Debian Codegraph @

lib/3rdParty/composer/illuminate/contracts/Support/MessageBag.php

raw symbols SCIP
1 <?php
2
3 namespace Illuminate\Contracts\Support;
4
5 use Countable;
6
7 interface MessageBag extends Arrayable, Countable
8 {
9 /**
10 * Get the keys present in the message bag.
11 *
12 * @return array
13 */
14 public function keys();
15
16 /**
17 * Add a message to the bag.
18 *
19 * @param string $key
20 * @param string $message
21 * @return $this
22 */
23 public function add($key, $message);
24
25 /**
26 * Merge a new array of messages into the bag.
27 *
28 * @param \Illuminate\Contracts\Support\MessageProvider|array $messages
29 * @return $this
30 */
31 public function merge($messages);
32
33 /**
34 * Determine if messages exist for a given key.
35 *
36 * @param string|array $key
37 * @return bool
38 */
39 public function has($key);
40
41 /**
42 * Get the first message from the bag for a given key.
43 *
44 * @param string|null $key
45 * @param string|null $format
46 * @return string
47 */
48 public function first($key = null, $format = null);
49
50 /**
51 * Get all of the messages from the bag for a given key.
52 *
53 * @param string $key
54 * @param string|null $format
55 * @return array
56 */
57 public function get($key, $format = null);
58
59 /**
60 * Get all of the messages for every key in the bag.
61 *
62 * @param string|null $format
63 * @return array
64 */
65 public function all($format = null);
66
67 /**
68 * Remove a message from the bag.
69 *
70 * @param string $key
71 * @return $this
72 */
73 public function forget($key);
74
75 /**
76 * Get the raw messages in the container.
77 *
78 * @return array
79 */
80 public function getMessages();
81
82 /**
83 * Get the default message format.
84 *
85 * @return string
86 */
87 public function getFormat();
88
89 /**
90 * Set the default message format.
91 *
92 * @param string $format
93 * @return $this
94 */
95 public function setFormat($format = ':message');
96
97 /**
98 * Determine if the message bag has any messages.
99 *
100 * @return bool
101 */
102 public function isEmpty();
103
104 /**
105 * Determine if the message bag has any messages.
106 *
107 * @return bool
108 */
109 public function isNotEmpty();
110 }