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 BundledComponentCollectionIterator implements \Iterator {
13
    /** @var BundledComponent[] */
14
    private $bundledComponents;
15
 
16
    /** @var int */
17
    private $position = 0;
18
 
19
    public function __construct(BundledComponentCollection $bundledComponents) {
20
        $this->bundledComponents = $bundledComponents->getBundledComponents();
21
    }
22
 
23
    public function rewind(): void {
24
        $this->position = 0;
25
    }
26
 
27
    public function valid(): bool {
28
        return $this->position < \count($this->bundledComponents);
29
    }
30
 
31
    public function key(): int {
32
        return $this->position;
33
    }
34
 
35
    public function current(): BundledComponent {
36
        return $this->bundledComponents[$this->position];
37
    }
38
 
39
    public function next(): void {
40
        $this->position++;
41
    }
42
}