MathPHP\SetTheory\Set::clear PHP Method

clear() public method

Results in an empty set.
public clear ( ) : Set
return Set (this set)
    public function clear() : Set
    {
        $this->A = [];
        return $this;
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @dataProvider dataProviderForSingleSet
  */
 public function testClear(array $members)
 {
     $set = new Set($members);
     $set->clear();
     $this->assertTrue($set->isEmpty());
     $this->assertEmpty($set->asArray());
     $this->assertEquals($set, new Set());
 }