Passed
Push — master ( ddbf8b...086098 )
by Robbie
11:17
created

CompositeFlushDiscoverer   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 9
rs 10
c 0
b 0
f 0
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A shouldFlush() 0 7 3
1
<?php
2
3
namespace SilverStripe\Core\Startup;
4
5
/**
6
 * Implements the composite over flush discoverers
7
 *
8
 * @see https://en.wikipedia.org/wiki/Composite_pattern composite design pattern for more information
9
 */
10
class CompositeFlushDiscoverer extends \ArrayIterator implements FlushDiscoverer
11
{
12
    public function shouldFlush()
13
    {
14
        foreach ($this as $discoverer) {
15
            $flush = $discoverer->shouldFlush();
16
17
            if (!is_null($flush)) {
18
                return $flush;
19
            }
20
        }
21
    }
22
}
23