Passed
Push — master ( 4cc795...0d286f )
by Brent
02:50
created

ConfigurationException::fileNotFound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 3
rs 10
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
     * @param $path
24
     *
25
     * @return ConfigurationException
26
     */
27
    public static function fileNotFound($path) : ConfigurationException {
28
        return new self("Could not load file: `{$path}`.");
29
    }
30
31
    public static function pluginNotFound($path) : ConfigurationException {
32
        return new self("Could not find plugin in {$path}. Looking for a `*Plugin.php` file in this directory");
33
    }
34
35
}
36