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   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 44
ccs 0
cts 18
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A titleNotProvided() 0 4 1
A titleLimitExceeded() 0 8 1
A subtitleLimitExceeded() 0 8 1
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