PlaygroundController::index()   A
last analyzed

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 0
Metric Value
dl 0
loc 6
ccs 0
cts 5
cp 0
rs 9.4285
c 0
b 0
f 0
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
 * NOTICE OF LICENSE
7
 *
8
 * Licensed under the 3-clause BSD License.
9
 *
10
 * This source file is subject to the 3-clause BSD License that is
11
 * bundled with this package in the LICENSE file.
12
 *
13
 * @version    alpha
14
 *
15
 * @author     Bertrand Kintanar <[email protected]>
16
 * @license    BSD License (3-clause)
17
 * @copyright  (c) 2014-2016, b8 Studios, Ltd
18
 *
19
 * @link       http://github.com/HB-Co/HRis
20
 */
21
22
namespace HRis\Api\Controllers;
23
24
use HRis\Api\ThirdParty\Elastic;
25
use Illuminate\Http\Request;
26
use Irradiate\Api\Controllers\BaseController;
27
use Irradiate\Eloquent\Employee;
28
use Symfony\Component\HttpFoundation\Response;
29
30
class PlaygroundController extends BaseController
31
{
32
    protected $employee;
33
34
    protected $elastic;
35
36
    public function __construct(Employee $employee, Elastic $elastic)
37
    {
38
        $this->employee = $employee;
39
        $this->elastic = $elastic;
40
    }
41
42
    public function index(Request $request)
43
    {
44
        $result = $this->elastic->searchEmployee($request->all());
45
46
        return $this->responseAPI(Response::HTTP_CREATED, SUCCESS_RETRIEVE_MESSAGE, compact('result'));
47
    }
48
}
49