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

ConfigurationException::requiredAdapterOptions()   A

Complexity

Conditions 3
Paths 4

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

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