Passed
Push — master ( 8016ac...3325dd )
by Iman
05:45 queued 51s
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 hookQuery() 0 3 1
A hookValidate() 0 3 1
A hookAfter() 0 3 1
1
<?php
2
namespace Crocodicstudio\Crudbooster\Modules\ApiGeneratorModule\ApiController;
3
4
trait ApiHooks
5
{
6
    public function hookBefore($data)
7
    {
8
        return $data;
9
    }
10
11
    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

11
    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...
12
    {
13
        return $result;
14
    }
15
16
    public function hookValidate($data)
17
    {
18
        return $data;
19
    }
20
21
    public function hookQuery($query)
22
    {
23
        return $query;
24
    }
25
}