input = $input; } /** * Every time getNext() is called, a new object will be parsed, until we * hit the end of the stream. * * When the end is reached, null will be returned. * * @return OldSabre\VObject\Component|null */ public function getNext() { $vcard = ''; do { if (feof($this->input)) { return false; } $line = fgets($this->input); $vcard .= $line; } while(strtoupper(substr($line,0,4))!=="END:"); $object = VObject\Reader::read($vcard); if($object->name !== 'VCARD') { throw new \InvalidArgumentException("Thats no vCard!", 1); } return $object; } }