Responses   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 7
eloc 12
dl 0
loc 42
c 1
b 1
f 0
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A userNotFound() 0 4 1
A youShouldBeGuest() 0 4 1
A tokenSent() 0 3 1
A tokenNotFound() 0 3 1
A loggedIn() 0 3 1
A emailNotValid() 0 4 1
A blockedUser() 0 4 1
1
<?php
2
3
namespace Imanghafoori\TokenizedLogin\Http\Responses;
4
5
use Illuminate\Http\Response;
6
7
class Responses
8
{
9
    public function tokenNotFound()
10
    {
11
        return response()->json(['message' => 'Token is not valid']);
12
    }
13
14
    public function loggedIn()
15
    {
16
        return response()->json(['message' => 'You are logged in']);
17
    }
18
19
    public function youShouldBeGuest()
20
    {
21
        return response()->json([
22
            'error' => 'you are logged in', Response::HTTP_BAD_REQUEST,
23
        ]);
24
    }
25
26
    public function emailNotValid()
27
    {
28
        return response()->json([
29
            'error' => 'your email is not valid', Response::HTTP_BAD_REQUEST,
30
        ]);
31
    }
32
33
    public function blockedUser()
34
    {
35
        return response()->json(
36
            ['error' => 'You are blocked'], Response::HTTP_BAD_REQUEST
37
        );
38
    }
39
40
    public function tokenSent()
41
    {
42
        return response()->json(['message' => 'token was sent.']);
43
    }
44
45
    public function userNotFound()
46
    {
47
        return response()->json(
48
            ['error' => 'Email Does not Exist'], Response::HTTP_BAD_REQUEST
49
        );
50
    }
51
}
52