remove() public method

Removes all occurrences of the supplied value from the collection.
public remove ( mixed $value ) : void
$value mixed The value to remove
return void
Esempio n. 1
0
 /**
  * @dataProvider oneToTenTwice
  */
 public function testThatRemoveWillRemovesIdenticalValuesFromCollectionAndPreserveKeys(\Pinq\ICollection $collection, array $data)
 {
     $collection->remove(1);
     $collection->remove('2');
     foreach ($data as $key => $value) {
         if ($value === 1 || $value === '2') {
             unset($data[$key]);
         }
     }
     $this->assertMatchesValues($collection, $data);
 }