Completed
Push — master ( 1b44ea...7444a6 )
by Adrian
01:08
created

InvalidFactomApiConfig::noCurlFound()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace AdrianMejias\FactomApi\Exceptions;
4
5
use Exception;
6
7
class InvalidFactomApiConfig extends Exception
8
{
9
    /**
10
     * @return static
11
     */
12
    public static function noCurlFound()
13
    {
14
        return new static('The Factom API integration requires the cURL extension, please see http://curl.haxx.se/docs/install.html to install it');
15
    }
16
17
    /**
18
     * @return static
19
     */
20
    public static function noUrlDefined()
21
    {
22
        return new static('The Factom API requires a url to connect to');
23
    }
24
25
    /**
26
     * @return static
27
     */
28
    public static function noCertificateDefined()
29
    {
30
        return new static('When enabling SSL configuration, you must ensure to define a certificate');
31
    }
32
33
    /**
34
     * @return static
35
     */
36
    public static function noSecureUrlDefined()
37
    {
38
        return new static('When defining a certificate, you must ensure the host is using HTTPS');
39
    }
40
41
    /**
42
     * @return static
43
     */
44
    public static function noCertificateExists()
45
    {
46
        return new static('Can\'t find provided certificate file');
47
    }
48
    
49
    /**
50
     * @return static
51
     */
52
    public static function noUsernameDefined()
53
    {
54
        return new static('You must provide a password with a username');
55
    }
56
    
57
    /**
58
     * @return static
59
     */
60
    public static function noPasswordDefined()
61
    {
62
        return new static('You must provide a username with a password');
63
    }
64
    
65
    /**
66
     * @return static
67
     */
68
    public static function invalidMethodCalled()
69
    {
70
        return new static('Supplied method must match GET or POST');
71
    }
72
    
73
    /**
74
     * @return static
75
     */
76
    public static function invalidApiResponse(string $error, string $actionName)
77
    {
78
        return new static('Received error "'.$error.'" when hitting "'.$actionName.'" within the Factom API');
79
    }
80
    
81
    /**
82
     * @return static
83
     */
84
    public static function emptyApiResponse(string $actionName)
85
    {
86
        return new static('Received an empty response when hitting "'.$actionName.'" within the Factom API');
87
    }
88
}
89