Completed
Pull Request — master (#13)
by Jhao
03:24
created

NormalizeFioRequest::addFio()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Appwilio\RussianPostSDK\Dispatching\Endpoints\Services\Requests;
6
7
use Appwilio\RussianPostSDK\Dispatching\Contracts\Arrayable;
8
9
final class NormalizeFioRequest implements Arrayable
10
{
11
    private $items = [];
12
13
    public static function one(string $fio): self
14
    {
15
        $request = new self();
16
17
        $request->addFio(...\func_get_args());
0 ignored issues
show
Bug introduced by
func_get_args() is expanded, but the parameter $fio of Appwilio\RussianPostSDK\...izeFioRequest::addFio() does not expect variable arguments. ( Ignorable by Annotation )

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

17
        $request->addFio(/** @scrutinizer ignore-type */ ...\func_get_args());
Loading history...
18
19
        return $request;
20
    }
21
22
    public function addFio(string $fio): void
23
    {
24
        $this->items[] = [
25
            'id'           => \sha1($fio),
26
            'original-fio' => $fio,
27
        ];
28
    }
29
30
    public function toArray(): array
31
    {
32
        return $this->items;
33
    }
34
}
35