Completed
Push — master ( 769b1c...ee0ee0 )
by Woody
03:01
created

FormatterException::needsQuality()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Equip\Exception;
4
5
use Equip\Formatter\FormatterInterface;
6
use InvalidArgumentException;
7
8
class FormatterException extends InvalidArgumentException
9
{
10
    /**
11
     * @param string $spec
12
     *
13
     * @return static
14
     */
15 1
    public static function invalidClass($spec)
16
    {
17 1
        return new static(sprintf(
18 1
            'Formatter class `%s` must implement `%s`',
19 1
            $spec,
20
            FormatterInterface::class
21 1
        ));
22
    }
23
24
    /**
25
      * @param string $formatter
26
      *
27
      * @return static
28
      */
29 1
     public static function needsQuality($formatter)
30
     {
31 1
         return new static(sprintf(
32 1
             'No quality have been set for the `%s` formatter',
33
             $formatter
34 1
         ));
35
     }
36
}
37