fromAdapterAndPackageNames()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
3
/**
4
 * Copyright (c) Florian Krämer (https://florian-kraemer.net)
5
 * Licensed under The MIT License
6
 * For full copyright and license information, please see the LICENSE.txt
7
 * Redistributions of files must retain the above copyright notice.
8
 *
9
 * @copyright Copyright (c) Florian Krämer (https://florian-kraemer.net)
10
 * @author    Florian Krämer
11
 * @link      https://github.com/Phauthentic
12
 * @license   https://opensource.org/licenses/MIT MIT License
13
 */
14
15
declare(strict_types=1);
16
17
namespace Phauthentic\Infrastructure\Storage\Exception;
18
19
/**
20
 * PackageRequiredException
21
 */
22
class PackageRequiredException extends StorageException
23
{
24
    /**
25
     * @param string $adapter Adapter
26
     * @param string $package Package
27
     * @return self
28
     */
29 2
    public static function fromAdapterAndPackageNames(string $adapter, string $package): self
30
    {
31 2
        return new self(sprintf(
32 2
            'Adapter `%s` requires package `%s`',
33
            $adapter,
34
            $package
35
        ));
36
    }
37
}
38