Hal\MutaTesting\Mutation\MutationCollection::push PHP Method

push() public method

public push ( Hal\MutaTesting\Mutation\MutationInterface $mutation )
$mutation Hal\MutaTesting\Mutation\MutationInterface
    public function push(MutationInterface $mutation)
    {
        $this->mutations->attach($mutation);
        return $this;
    }

Usage Example

 public function getSurvivors($file)
 {
     $collection = new MutationCollection();
     foreach ($this->getMutants($file)->getSurvivors() as $mutant) {
         $collection->push($mutant);
     }
     return $collection;
 }