contains() public method

Returns whether the supplied value is contained within the aggregate
public contains ( mixed $value ) : boolean
$value mixed The value to check for
return boolean
Esempio n. 1
0
 /**
  * @dataProvider assocOneToTen
  */
 public function testThatContainsReturnsWhetherItContainsAnIdenticalElement(\Pinq\ITraversable $traversable, array $data)
 {
     $this->assertTrue($traversable->contains(1));
     $this->assertFalse($traversable->contains('1'));
     $this->assertTrue($traversable->contains(10));
     $this->assertFalse($traversable->contains('10'));
     $this->assertFalse($traversable->contains(-1));
     $this->assertFalse($traversable->contains(0));
     $this->assertFalse($traversable->contains(11));
 }
Esempio n. 2
0
 public function visitContains(Requests\Contains $request)
 {
     return $this->traversable->contains($this->resolvedParameters[$request->getValueId()]);
 }