TestsUpdateAction::creationHeaders()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace Digitonic\ApiTestSuite\Concerns;
5
6
use Illuminate\Http\Response;
7
8
trait TestsUpdateAction
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 'put';
24
    }
25
26
    /**
27
     * @return array
28
     */
29
    public function statusCodes()
30
    {
31
        return [
32
            Response::HTTP_ACCEPTED,
33
            Response::HTTP_UNAUTHORIZED,
34
            Response::HTTP_UNPROCESSABLE_ENTITY,
35
            Response::HTTP_NOT_FOUND,
36
            Response::HTTP_FORBIDDEN
37
        ];
38
    }
39
40
    /**
41
     * @return bool
42
     */
43
    public function shouldAssertPaginate()
44
    {
45
        return false;
46
    }
47
48
    /**
49
     * @return array
50
     */
51
    public function requiredHeaders()
52
    {
53
        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

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