Conditions | 1 |
Paths | 1 |
Total Lines | 30 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 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 |
||
24 | public function __construct( |
||
25 | $name, |
||
26 | $field, |
||
27 | $interval, |
||
28 | $minDocCount, |
||
29 | $orderMode, |
||
30 | $orderDirection, |
||
31 | $extendedBoundsMin, |
||
32 | $extendedBoundsMax, |
||
33 | $keyed |
||
34 | ) { |
||
35 | |||
36 | parent::__construct( |
||
37 | $name, |
||
38 | $field, |
||
39 | $interval, |
||
40 | $minDocCount, |
||
41 | $orderMode, |
||
42 | $orderDirection, |
||
43 | $extendedBoundsMin, |
||
44 | $extendedBoundsMax, |
||
45 | $keyed |
||
46 | ); |
||
47 | |||
48 | trigger_error( |
||
49 | 'This aggregation is moved to `Bucketing` namespace. Use the new namespace instead.' . |
||
50 | ' It will be removed in 3.0', |
||
51 | E_USER_DEPRECATED |
||
52 | ); |
||
53 | } |
||
54 | } |
||
55 |