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

UnknownContainerException::fromContainerName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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