Issues (38)

src/Pohoda/Common/AddParameterToHeaderTrait.php (1 issue)

1
<?php
2
3
declare(strict_types=1);
4
5
namespace kalanis\Pohoda\Common;
6
7
use kalanis\Pohoda\AbstractAgenda;
8
use kalanis\Pohoda\Type;
9
10
/**
11
 * @property Dtos\AbstractDto $data
12
 */
13
trait AddParameterToHeaderTrait
14
{
15
    /**
16
     * Set user-defined parameter.
17
     *
18
     * @param string     $name  (can be set without preceding VPr / RefVPr)
19
     * @param Type\Enums\ParameterTypeEnum|string $type
20
     * @param mixed      $value
21
     * @param mixed|null $list
22
     *
23
     * @return AbstractAgenda
24
     */
25 13
    public function addParameter(string $name, Type\Enums\ParameterTypeEnum|string $type, mixed $value, mixed $list = null): AbstractAgenda
26
    {
27 13
        $object = $this->data->header ?? null;
28 13
        if ($object && is_object($object) && method_exists($object, 'addParameter')) {
29 13
            $object->addParameter($name, $type, $value, $list);
30
        }
31 13
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type kalanis\Pohoda\Common\AddParameterToHeaderTrait which is incompatible with the type-hinted return kalanis\Pohoda\AbstractAgenda.
Loading history...
32
    }
33
}
34