| 1 | <?php |
||
| 22 | class Translations implements \Iterator, \Countable |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * The collection. |
||
| 26 | * |
||
| 27 | * @var Translation[] |
||
| 28 | */ |
||
| 29 | private $translations = []; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * The current item pointer. |
||
| 33 | * |
||
| 34 | * @var int |
||
| 35 | */ |
||
| 36 | private $pointer = 0; |
||
| 37 | |||
| 38 | |||
| 39 | /** |
||
| 40 | * Construct the translations collection from the info file. |
||
| 41 | * |
||
| 42 | * @param FileInterface $file |
||
| 43 | * The Response file object. |
||
| 44 | */ |
||
| 45 | 12 | public function __construct(FileInterface $file) |
|
| 52 | |||
| 53 | /** |
||
| 54 | * Get the current translation. |
||
| 55 | */ |
||
| 56 | 3 | public function current() |
|
| 60 | |||
| 61 | /** |
||
| 62 | * @inheritDoc |
||
| 63 | */ |
||
| 64 | 3 | public function next() |
|
| 68 | |||
| 69 | /** |
||
| 70 | * @inheritDoc |
||
| 71 | */ |
||
| 72 | 3 | public function key() |
|
| 76 | |||
| 77 | /** |
||
| 78 | * @inheritDoc |
||
| 79 | */ |
||
| 80 | 3 | public function valid() |
|
| 84 | |||
| 85 | /** |
||
| 86 | * @inheritDoc |
||
| 87 | */ |
||
| 88 | 3 | public function rewind() |
|
| 92 | |||
| 93 | /** |
||
| 94 | * @inheritDoc |
||
| 95 | */ |
||
| 96 | 9 | public function count() |
|
| 100 | } |
||
| 101 |