ExtensionIterator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 25
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A accept() 0 3 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: matthew
5
 * Date: 12/1/15
6
 * Time: 11:40 AM
7
 */
8
9
namespace Fyuze\File\Iterators;
10
11
12
class ExtensionIterator extends \FilterIterator
13
{
14
    /**
15
     * @var string
16
     */
17
    protected $extension;
18
19
    /**
20
     * ExtensionIterator constructor.
21
     * @param \Iterator $iterator
22
     * @param $extension
23
     */
24 1
    public function __construct($iterator, $extension)
25
    {
26 1
        parent::__construct($iterator);
27 1
        $this->extension = $extension;
28
29
    }
30
31
    /**
32
     * @return boolean
33
     */
34 1
    public function accept()
35
    {
36 1
        return $this->getInnerIterator()->current()->getExtension() === $this->extension;
37
    }
38
}
39