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

PlaygroundController::index()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 2
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