NotAPsrContainer   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 16
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromAnythingButAPsrContainer() 0 8 2
1
<?php
2
declare(strict_types=1);
3
4
namespace Roave\BehatPsrContainer\Exception;
5
6
final class NotAPsrContainer extends \RuntimeException
7
{
8
    /**
9
     * @param string $filename
10
     * @param mixed $notAContainer
11
     * @return self
12
     */
13 4
    public static function fromAnythingButAPsrContainer(string $filename, $notAContainer) : self
14
    {
15 4
        return new self(sprintf(
16 4
            'File %s must return a PSR-11 container, actually returned %s',
17
            $filename,
18 4
            is_object($notAContainer) ? get_class($notAContainer) : gettype($notAContainer)
19
        ));
20
    }
21
}
22