Completed
Pull Request — master (#33)
by Tom
02:19
created

UnknownContainerException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 1
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 19
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A fromContainerName() 0 8 1
1
<?php
2
3
namespace TomPHP\ConfigServiceProvider\Exception;
4
5
use LogicException;
6
7
final class UnknownContainerException extends LogicException implements Exception
8
{
9
    use ExceptionFactory;
10
11
    /**
12
     * @param string   $name
13
     * @param string[] $knownContainers
14
     *
15
     * @return self
16
     */
17
    public static function fromContainerName($name, array $knownContainers)
18
    {
19
        return self::create(
20
            'Container %s is unknown; known containers are %s.',
21
            $name,
22
            self::optionsToString($knownContainers)
23
        );
24
    }
25
}
26