Completed
Push — master ( 15ea05...a6b9a5 )
by James
14s
created

NotAPsrContainer   A

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 5
cts 5
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 4
            $filename,
18 4
            is_object($notAContainer) ? get_class($notAContainer) : gettype($notAContainer)
19
        ));
20
    }
21
}
22