Completed
Push — master ( 119a25...af28eb )
by Shcherbak
04:15
created

FilesCollection::getIterator()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
ccs 0
cts 3
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
  namespace Funivan\Cs\Fs;
4
5
  /**
6
   * @author Ivan Shcherbak <[email protected]> 2016
7
   */
8
  class FilesCollection implements \IteratorAggregate, \Countable {
9
10
    /**
11
     * @var File[]
12
     */
13
    private $files = [];
14
15
16
    /**
17
     * @param File $file
18
     */
19
    public function add(File $file) {
20
      $this->files[] = $file;
21
    }
22
23
24
    /**
25
     * @return File[]
26
     */
27
    public function getIterator() {
28
      return new \ArrayIterator($this->files);
29
    }
30
31
32
    /**
33
     * @return int
34
     */
35
    public function count() {
36
      return count($this->files);
37
    }
38
39
  }