AddParameterToHeaderTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
eloc 4
c 0
b 0
f 0
dl 0
loc 18
ccs 4
cts 4
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A addParameter() 0 6 1
1
<?php
2
3
/**
4
 * This file is part of riesenia/pohoda package.
5
 *
6
 * Licensed under the MIT License
7
 * (c) RIESENIA.com
8
 */
9
10
declare(strict_types=1);
11
12
namespace Riesenia\Pohoda\Common;
13
14
use Riesenia\Pohoda\AbstractAgenda;
15
16
trait AddParameterToHeaderTrait
17
{
18
    /**
19
     * Set user-defined parameter.
20
     *
21
     * @param string     $name  (can be set without preceding VPr / RefVPr)
22
     * @param string     $type
23
     * @param mixed      $value
24
     * @param mixed|null $list
25
     *
26
     * @return AbstractAgenda
27
     */
28 13
    public function addParameter(string $name, string $type, mixed $value, mixed $list = null): AbstractAgenda
29
    {
30 13
        $object = $this->data['header'];
31
        /** @var self $object */
32 13
        $object->addParameter($name, $type, $value, $list);
33 13
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type Riesenia\Pohoda\Common\AddParameterToHeaderTrait which is incompatible with the type-hinted return Riesenia\Pohoda\AbstractAgenda.
Loading history...
34
    }
35
}
36