RequirementsException   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 17
ccs 1
cts 1
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 14 1
1
<?php
2
3
/**
4
 * BsbFlystem
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 *
9
 * @see       https://bushbaby.nl/
10
 *
11
 * @copyright Copyright (c) 2014-2021 bushbaby multimedia. (https://bushbaby.nl)
12
 * @author    Bas Kamer <[email protected]>
13 1
 * @license   MIT
14 1
 *
15 1
 * @package   bushbaby/flysystem
16
 */
17 1
18 1
declare(strict_types=1);
19 1
20 1
namespace BsbFlysystem\Exception;
21
22
use Exception;
23 1
24 1
class RequirementsException extends RuntimeException
25
{
26
    public function __construct(array $requirements, string $for, int $code = 0, Exception $previous = null)
27
    {
28
        $requirements = \array_map(function ($r) {
29
            return \sprintf("'%s'", \trim($r));
30
        }, $requirements);
31
32
        $message = \sprintf(
33
            "Install %s to use '%s'",
34
            \implode(' & ', $requirements),
35
            $for
36
        );
37
38
        parent::__construct($message, $code, $previous);
39
    }
40
}
41