JobException   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A branchIsNull() 0 3 1
A unknownDeployType() 0 3 1
A cannotAddExcept() 0 3 1
A cannotAddOnly() 0 3 1
1
<?php
2
3
namespace TheAentMachine\AentGitLabCI\Exception;
4
5
use TheAentMachine\Exception\AenthillException;
6
7
final class JobException extends AenthillException
8
{
9
    /**
10
     * @param string $identifier
11
     * @return self
12
     */
13
    public static function cannotAddOnly(string $identifier): self
14
    {
15
        return new self("\"$identifier\" is already referenced in \"except\" section");
16
    }
17
18
    /**
19
     * @param string $identifier
20
     * @return self
21
     */
22
    public static function cannotAddExcept(string $identifier): self
23
    {
24
        return new self("\"$identifier\" is already referenced in \"only\" section");
25
    }
26
27
    /**
28
     * @return self
29
     */
30
    public static function branchIsNull(): self
31
    {
32
        return new self('"only" section cannot have a null entry');
33
    }
34
35
    /**
36
     * @param string $deployType
37
     * @return self
38
     */
39
    public static function unknownDeployType(string $deployType): self
40
    {
41
        return new self("\"$deployType\" is not a valid deploy type.");
42
    }
43
}
44