Skip to content

Commit

Permalink
Add "contains" to higher order function proxy (#17000)
Browse files Browse the repository at this point in the history
  • Loading branch information
JosephSilber authored and taylorotwell committed Dec 27, 2016
1 parent fdeb01e commit 2093ed9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Support/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ class Collection implements ArrayAccess, Arrayable, Countable, IteratorAggregate
* @var array
*/
protected static $proxies = [
'each', 'every', 'filter', 'first', 'map', 'partition',
'reject', 'sortBy', 'sortByDesc', 'sum',
'contains', 'each', 'every', 'filter', 'first', 'map',
'partition', 'reject', 'sortBy', 'sortByDesc', 'sum',
];

/**
Expand Down
5 changes: 5 additions & 0 deletions tests/Support/SupportCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1268,6 +1268,11 @@ public function testContains()
$this->assertTrue($c->contains('date'));
$this->assertTrue($c->contains('class'));
$this->assertFalse($c->contains('foo'));

$c = new Collection([['a' => false, 'b' => false], ['a' => true, 'b' => false]]);

$this->assertTrue($c->contains->a);
$this->assertFalse($c->contains->b);
}

public function testContainsStrict()
Expand Down

0 comments on commit 2093ed9

Please sign in to comment.