Passed
Push — master ( f85738...3d85c1 )
by Peter
04:52
created

ApiDataTrait::getCreateData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Admin\Http\Controllers;
6
7
trait ApiDataTrait
8
{
9
    /** @var string */
10
    protected $problemBaseUrl;
11
12
    /**
13
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
14
     *
15
     * @param array $data
16
     *
17
     * @return UploadedFile[]
18
     */
19
    protected function getFileData(array $data): array
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

19
    protected function getFileData(/** @scrutinizer ignore-unused */ array $data): array

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...
20
    {
21
        return [];
22
    }
23
24
    /**
25
     * @return array
26
     */
27
    public function getCreateData(): array
28
    {
29
        return $this->getSharedData();
30
    }
31
32
    /**
33
     * @return array
34
     */
35
    public function getUpdateData(): array
36
    {
37
        return $this->getSharedData();
38
    }
39
40
    /**
41
     * @return array
42
     */
43
    public function getSharedData(): array
44
    {
45
        return $this->request->getJsonBody();
46
    }
47
}
48