Passed
Push — master ( d63a45...8016ac )
by Iman
09:10
created

ApiHooks   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 20
rs 10
c 0
b 0
f 0
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A hookBefore() 0 3 1
A hookAfter() 0 3 1
A hookQuery() 0 3 1
A hookValidate() 0 3 1
1
<?php
2
3
namespace Crocodicstudio\Crudbooster\Controllers\ApiController;
4
5
trait ApiHooks
6
{
7
    public function hookBefore($data)
8
    {
9
        return $data;
10
    }
11
12
    public function hookAfter($data, $result)
0 ignored issues
show
Unused Code introduced by
The parameter $data is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

12
    public function hookAfter(/** @scrutinizer ignore-unused */ $data, $result)

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

Loading history...
13
    {
14
        return $result;
15
    }
16
17
    public function hookValidate($data)
18
    {
19
        return $data;
20
    }
21
22
    public function hookQuery($query)
23
    {
24
        return $query;
25
    }
26
}