Pinq\Iterators\ISet::add PHP Метод

add() публичный Метод

Attempts to add the value to the set, will fail if the value is already contained in the set.
public add ( mixed $value ) : boolean
$value mixed
Результат boolean Whether the value was successfully added
    public function add($value);

Usage Example

Пример #1
0
 /**
  * @dataProvider sets
  */
 public function testThatSetCanRemoveAddedElements(ISet $set)
 {
     $set->add(0);
     $set->add(1);
     $this->assertCount(2, $set);
     $set->remove('0');
     $this->assertCount(2, $set);
     $set->remove(0);
     $this->assertCount(1, $set);
     $set->remove(1);
     $this->assertCount(0, $set);
 }