Completed
Push — master ( 727f83...413b1b )
by Mahmoud
06:06
created

Controller   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 4
dl 0
loc 45
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A authenticateTwitter() 0 6 1
A authenticateFacebook() 0 6 1
A authenticateGoogle() 0 6 1
1
<?php
2
3
namespace App\Containers\SocialAuthentication\UI\API\Controllers;
4
5
use App\Containers\SocialAuthentication\Actions\SocialLoginAction;
6
use App\Containers\SocialAuthentication\SocialProvider;
7
use App\Containers\SocialAuthentication\UI\API\Requests\AuthenticateOneRequest;
8
use App\Containers\SocialAuthentication\UI\API\Requests\AuthenticateTwoRequest;
9
use App\Containers\User\UI\API\Transformers\UserTransformer;
10
use App\Port\Controller\Abstracts\PortApiController;
11
use Dingo\Api\Http\Request;
12
13
/**
14
 * Class Controller.
15
 *
16
 * @author Mahmoud Zalt <[email protected]>
17
 */
18
class Controller extends PortApiController
19
{
20
21
    /**
22
     * @param \App\Containers\SocialAuthentication\UI\API\Requests\AuthenticateOneRequest $request
23
     * @param \App\Containers\SocialAuthentication\Actions\SocialLoginAction              $action
24
     *
25
     * @return  \Dingo\Api\Http\Response
26
     */
27
    public function authenticateTwitter(AuthenticateOneRequest $request, SocialLoginAction $action)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
28
    {
29
        $user = $action->run(SocialProvider::TWITTER);
30
31
        return $this->response->item($user, new UserTransformer());
32
    }
33
34
    /**
35
     * @param \App\Containers\SocialAuthentication\UI\API\Requests\AuthenticateTwoRequest $request
36
     * @param \App\Containers\SocialAuthentication\Actions\SocialLoginAction              $action
37
     *
38
     * @return  \Dingo\Api\Http\Response
39
     */
40
    public function authenticateFacebook(AuthenticateTwoRequest $request, SocialLoginAction $action)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
41
    {
42
        $user = $action->run(SocialProvider::FACEBOOK);
43
44
        return $this->response->item($user, new UserTransformer());
45
    }
46
47
48
    /**
49
     * @param \App\Containers\SocialAuthentication\UI\API\Requests\AuthenticateTwoRequest $request
50
     * @param \App\Containers\SocialAuthentication\Actions\SocialLoginAction              $action
51
     *
52
     * @return  \Dingo\Api\Http\Response
53
     */
54
    public function authenticateGoogle(AuthenticateTwoRequest $request, SocialLoginAction $action)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
55
    {
56
        $user = $action->run(SocialProvider::GOOGLE);
57
58
        return $this->response->item($user, new UserTransformer());
59
    }
60
61
62
}
63