ApiDataTrait::getSharedData()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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

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