Issues (11)

src/Config/Traits/HasParamsTrait.php (2 issues)

1
<?php
2
3
namespace ByTIC\Migrations\Config\Traits;
4
5
/**
6
 * Trait HasParamsTrait
7
 * @package ByTIC\Migrations\Config\Traits
8
 */
9
trait HasParamsTrait
10
{
11
    protected $params = [];
12
13
    /**
14
     * @return null
15
     */
16
    public function getParams()
17
    {
18
        return $this->params;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->params returns the type array which is incompatible with the documented return type null.
Loading history...
19
    }
20
21
    /**
22
     * @param null $params
0 ignored issues
show
Documentation Bug introduced by
Are you sure the doc-type for parameter $params is correct as it would always require null to be passed?
Loading history...
23
     */
24 1
    public function setParams($params)
25
    {
26 1
        $this->params = $params;
27 1
    }
28
29
    /**
30
     * @param $params
31
     */
32 2
    public function mergeParams($params)
33
    {
34 2
        $this->params = array_merge($this->params, $params);
35 2
    }
36
37
    /**
38
     * @return array
39
     */
40 5
    public function toArray()
41
    {
42 5
        return $this->params;
43
    }
44
45 8
    protected function generateBaseParams()
46
    {
47 8
        $this->params = [
48
            'paths' => [
49
                'migrations' => [],
50
                'seeds' => [],
51
            ],
52
            'environments' => [],
53
        ];
54
    }
55
}