GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 8d304f...3ed6f1 )
by Irfaq
02:37
created

CouldNotCreateButton::phoneNumberNotProvided()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace NotificationChannels\Facebook\Exceptions;
4
5
class CouldNotCreateButton extends \Exception
6
{
7
    /**
8
     * Thrown when the button title is not provided.
9
     *
10
     * @return static
11
     */
12
    public static function titleNotProvided()
13
    {
14
        return new static('Button title was not provided, A 20 character limited title should be provided.');
15
    }
16
17
    /**
18
     * Thrown when the button type is "web_url" but the url is not provided.
19
     *
20
     * @return static
21
     */
22
    public static function urlNotProvided()
23
    {
24
        return new static('Your button type is `web_url` but the url is not provided.');
25
    }
26
27
    /**
28
     * Thrown when the button type is "phone_number" but the number is not provided.
29
     *
30
     * @return static
31
     */
32
    public static function phoneNumberNotProvided()
33
    {
34
        return new static('Your button type is `phone_number` but the phone number is not provided.');
35
    }
36
37
    /**
38
     * Thrown when the button type is "postback" but the postback data is not provided.
39
     *
40
     * @return static
41
     */
42
    public static function postbackNotProvided()
43
    {
44
        return new static('Your button type is `postback` but the postback data is not provided.');
45
    }
46
47
    /**
48
     * Thrown when the button type is "postback" or "phone_number",
49
     * but the data value is not provided for the payload.
50
     *
51
     * @param $type
52
     *
53
     * @return static
54
     */
55
    public static function dataNotProvided($type)
56
    {
57
        return new static("Your button type is `{$type}` but the payload is not provided.");
58
    }
59
60
    /**
61
     * Thrown when the title characters limit is exceeded.
62
     *
63
     * @param $title
64
     *
65
     * @return static
66
     */
67
    public static function titleLimitExceeded($title)
68
    {
69
        $count = mb_strlen($title);
70
71
        return new static(
72
            "Your title was {$count} characters long, which exceeds the 20 character limit. Please check the button template docs for more information."
73
        );
74
    }
75
76
    /**
77
     * Thrown when the payload characters limit is exceeded.
78
     *
79
     * @param mixed $data
80
     *
81
     * @return static
82
     */
83
    public static function payloadLimitExceeded($data)
84
    {
85
        $count = mb_strlen($data);
86
87
        return new static(
88
            "Your payload was {$count} characters long, which exceeds the 1000 character limit. Please check the button template docs for more information."
89
        );
90
    }
91
92
    /**
93
     * Thrown when the URL provided is not valid.
94
     *
95
     * @param $url
96
     *
97
     * @return static
98
     */
99
    public static function invalidUrlProvided($url)
100
    {
101
        return new static("`{$url}` is not a valid URL. Please check and provide a valid URL");
102
    }
103
104
    /**
105
     * Thrown when the phone number provided is of invalid format.
106
     *
107
     * @param $phoneNumber
108
     *
109
     * @return static
110
     */
111
    public static function invalidPhoneNumberProvided($phoneNumber)
112
    {
113
        return new static(
114
            "Provided phone number `{$phoneNumber}` format is invalid.".
115
            "Format must be '+' prefix followed by the country code, area code and local number.".
116
            'Please check the button template docs for more information.'
117
        );
118
    }
119
120
    /**
121
     * Thrown when the postback is not valid.
122
     *
123
     * @param $postback
124
     *
125
     * @return static
126
     */
127
    public static function invalidPostbackProvided($postback)
128
    {
129
        return new static("`{$postback}` is not a valid value for the `postback` button type. It should be an array.");
130
    }
131
}
132