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