Completed
Pull Request — master (#29)
by Sandro
06:42
created

MandatoryOptionNotFoundException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 1
c 2
b 0
f 1
lcom 0
cbo 1
dl 0
loc 14
rs 10
ccs 3
cts 3
cp 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A missingOption() 0 6 1
1
<?php
2
/**
3
 * Sandro Keil (https://sandro-keil.de)
4
 *
5
 * @link      http://github.com/sandrokeil/interop-config for the canonical source repository
6
 * @copyright Copyright (c) 2015-2016 Sandro Keil
7
 * @license   http://github.com/sandrokeil/interop-config/blob/master/LICENSE.md New BSD License
8
 */
9
10
namespace Interop\Config\Exception;
11
12
/**
13
 * Mandatory option not found exception
14
 *
15
 * Use this exception if a mandatory option was not found in the config
16
 */
17
class MandatoryOptionNotFoundException extends OutOfBoundsException
18
{
19
    /**
20
     * @param array|\ArrayAccess $dimensions
21
     * @param mixed $option Missed option
22
     * @return UnexpectedValueException
23
     */
24 3
    public static function missingOption($dimensions, $option)
25
    {
26 3
        return new static(
27 3
            sprintf('Mandatory option "%s" was not set for configuration "%s"', $option, implode('.', $dimensions))
28
        );
29
    }
30
}
31