Completed
Push — master ( e28e5a...6fa56b )
by Julien
02:03
created

PayloadException::missingServiceName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
4
namespace TheAentMachine\AentGitLabCI\Exception;
5
6
use TheAentMachine\Aenthill\CommonEvents;
7
use TheAentMachine\Exception\AenthillException;
8
9
final class PayloadException extends AenthillException
10
{
11
    public static function emptyPayload(string $event): self
12
    {
13
        return new self("$event event requires a payload");
14
    }
15
16
    public static function missingDockerComposeFilename(): self
17
    {
18
        return new self(CommonEvents::NEW_DEPLOY_DOCKER_COMPOSE_JOB_EVENT . ' event requires a payload with the Docker Compose filename');
19
    }
20
21
    public static function missingServiceName(): self
22
    {
23
        return new self(CommonEvents::NEW_BUILD_IMAGE_JOB_EVENT . ' event requires a payload with the service name');
24
    }
25
26
    public static function missingDockerfileName(): self
27
    {
28
        return new self(CommonEvents::NEW_BUILD_IMAGE_JOB_EVENT . ' event requires a payload with the Dockerfile name');
29
    }
30
}
31