Completed
Push — api/develop ( e4271f...4a9872 )
by Bertrand
11:08
created

PlaygroundController   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 2
c 1
b 0
f 1
lcom 1
cbo 3
dl 0
loc 19
ccs 0
cts 10
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A index() 0 6 1
1
<?php
2
3
/**
4
 * This file is part of the HRis Software package.
5
 *
6
 * HRis - Human Resource and Payroll System
7
 *
8
 * @link http://github.com/HB-Co/HRis
9
 */
10
namespace HRis\Api\Controllers;
11
12
use HRis\Api\Eloquent\Employee;
13
use HRis\Api\ThirdParty\Elastic;
14
use Illuminate\Http\Request;
15
use Swagger\Annotations as SWG;
16
17
class PlaygroundController extends BaseController
18
{
19
    protected $employee;
20
21
    protected $elastic;
22
23
    public function __construct(Employee $employee, Elastic $elastic)
24
    {
25
        $this->employee = $employee;
26
        $this->elastic = $elastic;
27
    }
28
29
    public function index(Request $request)
30
    {
31
        $result = $this->elastic->searchEmployee($request->all());
32
33
        return $this->responseAPI(201, SUCCESS_RETRIEVE_MESSAGE, compact('result'));
34
    }
35
}
36