Passed
Pull Request — master (#88)
by
unknown
03:22
created

SupportVectorMachineException   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 0
dl 0
loc 43
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A missingBinPath() 0 4 1
A missingTrainFile() 0 4 1
A missingPredictFile() 0 4 1
A missingVarPath() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Phpml\Exception;
6
7
class SupportVectorMachineException extends \Exception
8
{
9
10
    /**
11
     * @param string $binPath
12
     *
13
     * @return SupportVectorMachineException
14
     */
15
    public static function missingBinPath(string $binPath)
16
    {
17
        return new self(sprintf('Bin path "%s" missing.', $binPath));
18
    }
19
20
    /**
21
     * @param string $trainFile
22
     *
23
     * @return SupportVectorMachineException
24
     */
25
    public static function missingTrainFile(string $trainFile)
26
    {
27
        return new self(sprintf('Train file "%s" missing.', $trainFile));
28
    }
29
30
    /**
31
     * @param string $predictFile
32
     *
33
     * @return SupportVectorMachineException
34
     */
35
    public static function missingPredictFile(string $predictFile)
36
    {
37
        return new self(sprintf('Predict file "%s" missing.', $predictFile));
38
    }
39
40
    /**
41
     * @param string $varPath
42
     *
43
     * @return SupportVectorMachineException
44
     */
45
    public static function missingVarPath(string $varPath)
46
    {
47
        return new self(sprintf('Var path "%s" missing.', $varPath));
48
    }
49
}
50