TestsRetrieveAction::requiredHeaders()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 1
b 0
f 0
1
<?php
2
3
4
namespace Digitonic\ApiTestSuite\Concerns;
5
6
use Illuminate\Http\Response;
7
8
trait TestsRetrieveAction
9
{
10
    /**
11
     * @return array
12
     */
13
    public function requiredFields()
14
    {
15
        return [];
16
    }
17
18
    /**
19
     * @return string
20
     */
21
    public function httpAction()
22
    {
23
        return 'get';
24
    }
25
26
    /**
27
     * @return array
28
     */
29
    public function statusCodes()
30
    {
31
        return [
32
            Response::HTTP_UNAUTHORIZED,
33
            Response::HTTP_FORBIDDEN,
34
            Response::HTTP_NOT_FOUND,
35
            Response::HTTP_OK
36
        ];
37
    }
38
39
    /**
40
     * @return bool
41
     */
42
    public function shouldAssertPaginate()
43
    {
44
        return false;
45
    }
46
47
    /**
48
     * @return array
49
     */
50
    public function requiredHeaders()
51
    {
52
        return $this->defaultHeaders();
0 ignored issues
show
Bug introduced by
It seems like defaultHeaders() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

52
        return $this->/** @scrutinizer ignore-call */ defaultHeaders();
Loading history...
53
    }
54
55
    public function creationHeaders()
56
    {
57
        return $this->defaultHeaders();
58
    }
59
60
    /**
61
     * @return bool
62
     */
63
    public function cannotBeDuplicated()
64
    {
65
        return false;
66
    }
67
}
68