Skip to content

Commit

Permalink
[5.2] Avoid introducing breaking backward compatibility on patch
Browse files Browse the repository at this point in the history
release.

Closes laravel#14396

Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Jul 21, 2016
1 parent 29ba2e3 commit b90ca2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Illuminate/Support/MessageBag.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@ protected function isUnique($key, $message)
*/
public function has($key = null)
{
if (is_null($key)) {
return $this->any();
}

$keys = is_array($key) ? $key : func_get_args();

foreach ($keys as $key) {
Expand Down
1 change: 1 addition & 0 deletions tests/Support/SupportMessageBagTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public function testHasIndicatesExistence()
$container->add('foo', 'bar');
$this->assertTrue($container->has('foo'));
$this->assertFalse($container->has('bar'));
$this->assertTrue($container->has());
}

public function testHasAnyIndicatesExistence()
Expand Down

0 comments on commit b90ca2e

Please sign in to comment.