Container::makeAssertions()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
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