Conditions | 1 |
Paths | 1 |
Total Lines | 6 |
Code Lines | 4 |
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 |
||
36 | public function __construct($workers = 1, $environment = null, $delay = 0, $memory = 128, $timeout = 60, $sleep = 3, $maxTries = 0, $force = false) |
||
37 | { |
||
38 | $this->workers = $workers; |
||
39 | $this->environment = $environment; |
||
40 | parent::__construct($delay, $memory, $timeout, $sleep, $maxTries, $force); |
||
41 | } |
||
42 | } |
||
43 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.