Completed
Push — master ( bca71a...3af5ad )
by Sandro
06:14 queued 02:11
created

MandatoryOptionNotFoundException::missingOption()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 6
rs 9.4285
ccs 3
cts 3
cp 1
cc 1
eloc 3
nc 1
nop 2
crap 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