Skip to content

Commit 47190cc

Browse files
committed
formatting
1 parent 4244bca commit 47190cc

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

src/Illuminate/Contracts/Support/MessageBag.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ public function keys();
2222
*/
2323
public function add($key, $message);
2424

25-
/**
26-
* Remove a message from the bag.
27-
*
28-
* @param string $key
29-
* @return $this
30-
*/
31-
public function remove($key);
32-
3325
/**
3426
* Merge a new array of messages into the bag.
3527
*
@@ -72,6 +64,14 @@ public function get($key, $format = null);
7264
*/
7365
public function all($format = null);
7466

67+
/**
68+
* Remove a message from the bag.
69+
*
70+
* @param string $key
71+
* @return $this
72+
*/
73+
public function forget($key);
74+
7575
/**
7676
* Get the raw messages in the container.
7777
*

src/Illuminate/Support/MessageBag.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,6 @@ public function addIf($boolean, $key, $message)
7878
return $boolean ? $this->add($key, $message) : $this;
7979
}
8080

81-
/**
82-
* Remove a message from the message bag.
83-
*
84-
* @param string $key
85-
* @return $this
86-
*/
87-
public function remove($key)
88-
{
89-
unset($this->messages[$key]);
90-
91-
return $this;
92-
}
93-
9481
/**
9582
* Determine if a key and message combination already exists.
9683
*
@@ -263,6 +250,19 @@ public function unique($format = null)
263250
return array_unique($this->all($format));
264251
}
265252

253+
/**
254+
* Remove a message from the message bag.
255+
*
256+
* @param string $key
257+
* @return $this
258+
*/
259+
public function forget($key)
260+
{
261+
unset($this->messages[$key]);
262+
263+
return $this;
264+
}
265+
266266
/**
267267
* Format an array of messages.
268268
*

tests/Support/SupportMessageBagTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ public function testAddIf()
126126
$this->assertFalse($container->has('bar'));
127127
}
128128

129-
public function testRemove()
129+
public function testForget()
130130
{
131131
$container = new MessageBag(['foo' => 'bar']);
132-
$container->remove('foo');
132+
$container->forget('foo');
133133
$this->assertFalse($container->has('foo'));
134134
}
135135

0 commit comments

Comments
 (0)