Completed
Push — master ( bc8348...7e1aef )
by Barney
02:46
created

RequiresOuterIteratorTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 16
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testOuterIterator() 0 13 2
1
<?php
2
3
namespace Shrikeh\Collection;
4
5
use OuterIterator;
6
use Shrikeh\Collection\Exception\IncorrectInterface;
7
8
trait RequiresOuterIteratorTrait
9
{
10
    private static function testOuterIterator($class)
11
    {
12
        if (!$class instanceof OuterIterator) {
13
            $msg = 'class %s uses trait %s but it is not an %s';
14
            throw new IncorrectInterface(
15
                sprintf($msg,
16
                    __CLASS__,
17
                    __TRAIT__,
18
                    'OuterIterator'
19
                )
20
            );
21
        }
22
    }
23
}
24