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 — develop ( ef7da1...3c7252 )
by Amr
01:47
created

AcceptFriendFailed::__construct()   A

Complexity

Conditions 5
Paths 5

Size

Total Lines 16

Duplication

Lines 16
Ratio 100 %

Code Coverage

Tests 7
CRAP Score 8.7918

Importance

Changes 0
Metric Value
dl 16
loc 16
ccs 7
cts 15
cp 0.4667
rs 9.4222
c 0
b 0
f 0
cc 5
nc 5
nop 1
crap 8.7918
1
<?php
2
3
namespace Merodiro\Friendships\Exceptions;
4
5
use Exception;
6
7 View Code Duplication
class AcceptFriendFailed extends Exception
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
8
{
9 2
    public function __construct(string $status) {
10 1
        switch ($status) {
11 2
            case 'SAME_USER':
12
                $this->message = 'user can not accept friend request from himself';
13
                break;
14 2
            case 'WAITING':
15 2
                $this->message = 'user can not accept a friend request he sent';
16 2
                break;
17
            case 'NOT_FRIENDS':
18
                $this->message = 'user has no pending friend request from this user';
19
                break;
20
            case 'FRIENDS':
21
                $this->message = 'users are already friends';
22
                break;
23
        }
24 2
    }
25
}
26