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.

CouldNotCreateCard::titleLimitExceeded()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 2
1
<?php
2
3
namespace NotificationChannels\Facebook\Exceptions;
4
5
use Exception;
6
7
/**
8
 * Class CouldNotCreateCard.
9
 */
10
class CouldNotCreateCard extends Exception
11
{
12
    /**
13
     * Thrown when the button title is not provided.
14
     *
15
     * @return static
16
     */
17
    public static function titleNotProvided(): self
18
    {
19
        return new static('Button title was not provided, A 20 character limited title should be provided.');
20
    }
21
22
    /**
23
     * Thrown when the title characters limit is exceeded.
24
     *
25
     * @param  string  $title
26
     *
27
     * @return static
28
     */
29
    public static function titleLimitExceeded(string $title): self
30
    {
31
        $count = mb_strlen($title);
32
33
        return new static(
34
            "Your title was {$count} characters long, which exceeds the 80 character limit"
35
        );
36
    }
37
38
    /**
39
     * Thrown when the subtitle characters limit is exceeded.
40
     *
41
     * @param  string  $title
42
     *
43
     * @return static
44
     */
45
    public static function subtitleLimitExceeded(string $title): self
46
    {
47
        $count = mb_strlen($title);
48
49
        return new static(
50
            "Your subtitle was {$count} characters long, which exceeds the 80 character limit"
51
        );
52
    }
53
}
54