Passed
Push — master ( 64da52...b1a7d7 )
by Peter
05:43
created

ApiDataTrait::getCreateData()   A

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
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AbterPhp\Framework\Http\Controllers;
6
7
use AbterPhp\Framework\Domain\Entities\IToJsoner;
0 ignored issues
show
Bug introduced by
The type AbterPhp\Framework\Domain\Entities\IToJsoner was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
9
trait ApiDataTrait
10
{
11
    /** @var string */
12
    protected $problemBaseUrl;
13
14
    /**
15
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
16
     *
17
     * @param array $data
18
     *
19
     * @return UploadedFile[]
20
     */
21
    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

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