HostException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 7
dl 0
loc 15
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A noSocketMount() 0 5 1
A noHostMount() 0 5 1
1
<?php declare(strict_types=1);
2
3
namespace Cocotte\Host;
4
5
final class HostException extends \Exception
6
{
7
    public static function noHostMount()
8
    {
9
        return new self(
10
            "There is no writable bind mount with the destination '/host'.\nMake sure you run your command ".
11
            "with a volume like this:\n-v \"$(pwd)\":/host"
12
        );
13
    }
14
15
    public static function noSocketMount(string $message)
16
    {
17
        return new self(
18
            $message."\nMake sure you start Docker and run your command ".
19
            "with a volume like this:\n-v /var/run/docker.sock:/var/run/docker.sock:ro"
20
        );
21
    }
22
23
}