Completed
Push — master ( 8023d3...8b2ccd )
by Sherif
10:04
created

OauthClientController::update()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace App\Modules\OauthClients\Http\Controllers;
4
5
use App\Modules\Core\BaseClasses\BaseApiController;
6
use App\Modules\OauthClients\Services\OauthClientService;
7
use App\Modules\Core\Http\Resources\General as GeneralResource;
8
9
class OauthClientController extends BaseApiController
10
{
11
    /**
12
     * Path of the sotre form request.
13
     *
14
     * @var string
15
     */
16
    protected $storeFormRequest = 'App\Modules\OauthClients\Http\Requests\StoreOauthClient';
17
    
18
    /**
19
     * Path of the model resource
20
     *
21
     * @var string
22
     */
23
    protected $modelResource = 'App\Modules\OauthClients\Http\Resources\OauthClient';
24
25
    /**
26
     * Init new object.
27
     *
28
     * @param   OauthClientService $service
29
     * @return  void
0 ignored issues
show
Comprehensibility Best Practice introduced by
Adding a @return annotation to constructors is generally not recommended as a constructor does not have a meaningful return value.

Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.

Please refer to the PHP core documentation on constructors.

Loading history...
30
     */
31
    public function __construct(OauthClientService $service)
32
    {
33
        parent::__construct($service);
34
    }
35
    
36
    /**
37
     * Revoke the given client.
38
     *
39
     * @param  integer  $clientId Id of the client
40
     * @return \Illuminate\Http\Response
41
     */
42
    public function revoke($clientId)
43
    {
44
        return new GeneralResource($this->service->revoke($clientId));
45
    }
46
47
    /**
48
     * Un revoke the given client.
49
     *
50
     * @param  integer  $clientId Id of the client
51
     * @return \Illuminate\Http\Response
52
     */
53
    public function unRevoke($clientId)
54
    {
55
        return new GeneralResource($this->service->unRevoke($clientId));
56
    }
57
}
58