Conditions | 1 |
Paths | 1 |
Total Lines | 12 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Methods with many parameters are not only hard to understand, but their parameters also often become inconsistent when you need more, or different data.
There are several approaches to avoid long parameter lists:
1 | <?php |
||
15 | function __construct($msg = 'not Set', $varsToDump = 'not Set', $view = 'not Set', $actions = 'not Set', $accountId = 'not Set', $isVerified = 'not Set', $isTokenFresh = 'not Set', $page = 'not Set', $referrer = 'not Set') |
||
16 | { |
||
17 | $this->view = $view; |
||
18 | $this->actions = $actions; |
||
19 | $this->accountId = $accountId; |
||
20 | $this->isVerified = $isVerified; |
||
21 | $this->isTokenFresh = $isTokenFresh; |
||
22 | $this->page = $page; |
||
23 | $this->referrer = $referrer; |
||
24 | $this->msg = $msg; |
||
25 | $this->varsToDump = $varsToDump; |
||
26 | } |
||
27 | |||
51 | } |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.