Chris@2: , Sebastian Heuer , Sebastian Bergmann Chris@2: * Chris@2: * For the full copyright and license information, please view the LICENSE Chris@2: * file that was distributed with this source code. Chris@2: */ Chris@2: Chris@2: namespace PharIo\Manifest; Chris@2: Chris@2: class AuthorCollection implements \Countable, \IteratorAggregate { Chris@2: /** Chris@2: * @var Author[] Chris@2: */ Chris@2: private $authors = []; Chris@2: Chris@2: public function add(Author $author) { Chris@2: $this->authors[] = $author; Chris@2: } Chris@2: Chris@2: /** Chris@2: * @return Author[] Chris@2: */ Chris@2: public function getAuthors() { Chris@2: return $this->authors; Chris@2: } Chris@2: Chris@2: /** Chris@2: * @return int Chris@2: */ Chris@2: public function count() { Chris@2: return count($this->authors); Chris@2: } Chris@2: Chris@2: /** Chris@2: * @return AuthorCollectionIterator Chris@2: */ Chris@2: public function getIterator() { Chris@2: return new AuthorCollectionIterator($this); Chris@2: } Chris@2: }