Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php declare(strict_types = 1);
2
/*
3
 * This file is part of PharIo\Manifest.
4
 *
5
 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace PharIo\Manifest;
11
 
12
class AuthorCollection implements \Countable, \IteratorAggregate {
13
    /** @var Author[] */
14
    private $authors = [];
15
 
16
    public function add(Author $author): void {
17
        $this->authors[] = $author;
18
    }
19
 
20
    /**
21
     * @return Author[]
22
     */
23
    public function getAuthors(): array {
24
        return $this->authors;
25
    }
26
 
27
    public function count(): int {
28
        return \count($this->authors);
29
    }
30
 
31
    public function getIterator(): AuthorCollectionIterator {
32
        return new AuthorCollectionIterator($this);
33
    }
34
}