Container   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A makeAssertions() 0 7 2
A push() 0 4 1
A flush() 0 4 1
1
<?php
2
3
namespace Muzzle;
4
5
class Container
6
{
7
8
    /**
9
     * @var Muzzle[]
10
     */
11
    protected static $container = [];
12
13
    public static function push(Muzzle $muzzle) : void
14
    {
15
16
        static::$container[] = $muzzle;
17
    }
18
19
    public static function makeAssertions() : void
20
    {
21
22
        while (count(static::$container)) {
23
            $muzzle = array_pop(static::$container);
24
            $muzzle->makeAssertions();
25
            unset($muzzle);
26
        }
27
    }
28
29
    public static function flush() : void
30
    {
31
32
        static::$container = [];
33
    }
34
}
35