Test Setup Failed
Push — master ( f0f097...c6f3d6 )
by Php Easy Api
04:31
created

AuthenticateException::logoutInternal()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Resta\Authenticate;
4
5
trait AuthenticateException
6
{
7
    /**
8
     * @return void|mixed
9
     */
10
    public function getExceptionForHttp($http)
11
    {
12
        exception('authenticateHttpException')->badMethodCall('Authenticate requests ['.$http.'] as http method');
13
    }
14
15
    /**
16
     * @return void|mixed
17
     */
18
    public function credentials()
19
    {
20
        exception('authenticateCredentialException')->invalidArgument('credentials fail for authenticate');
21
    }
22
23
    /**
24
     * @param $exceptionType
25
     */
26
    public function exceptionManager($exceptionType)
27
    {
28
        return $this->{$exceptionType}();
29
    }
30
31
    /**
32
     * logout exception
33
     *
34
     * @return mixed|void
35
     */
36
    public function logoutException()
37
    {
38
        exception('authenticateLogoutException')->runtime('no such token data is available.');
39
    }
40
41
    /**
42
     * logout exception
43
     *
44
     * @return mixed|void
45
     */
46
    public function logoutInternal()
47
    {
48
        exception('authenticateLogoutInternal')->runtime('You have failed to sign out. There was a problem with us. Please try again.');
49
    }
50
51
    /**
52
     * token exception
53
     *
54
     * @return mixed|void
55
     */
56
    public function tokenException()
57
    {
58
        exception('authenticateTokenException')->invalidArgument('Your token is missing for authenticate process');
59
    }
60
61
    /**
62
     * update exception
63
     *
64
     * @return mixed|void
65
     */
66
    public function update()
67
    {
68
        exception('authenticateUpdateException')->invalidArgument('Updating Token for authenticate is missing.');
69
    }
70
}