Passed
Push — master ( 003724...f241d1 )
by Brent
02:47
created

ConfigurationException   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A requiredAdapterOptions() 0 7 3
1
<?php
2
3
namespace Brendt\Stitcher\Exception;
4
5
class ConfigurationException extends StitcherException
6
{
7
8
    /**
9
     * @param       $adapter
10
     * @param array ...$fields
11
     *
12
     * @return ConfigurationException
13
     */
14
    public static function requiredAdapterOptions($adapter, ...$fields) : ConfigurationException {
15
        $entries = count($fields) > 1 ? 'entries' : 'entry';
16
        $are = count($fields) > 1 ? 'are' : 'is';
17
        $fields = implode('`, `', $fields);
18
19
        return new self("The configuration {$entries} `{$fields}` {$are} required when using the {$adapter} adapter.");
20
    }
21
22
}
23