| Conditions | 1 |
| Paths | 1 |
| Total Lines | 51 |
| Code Lines | 33 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 46 | public function getParamDefinitions( array $definitions ) { |
||
| 47 | $params = parent::getParamDefinitions( $definitions ); |
||
| 48 | |||
| 49 | $params['defaultview'] = [ |
||
| 50 | 'message' => 'srf-paramdesc-calendardefaultview', |
||
| 51 | 'default' => 'month', |
||
| 52 | 'values' => [ 'month', 'basicweek', 'basicday', 'agendaweek', 'agendaday' ] |
||
| 53 | ]; |
||
| 54 | |||
| 55 | $params['firstday'] = [ |
||
| 56 | 'message' => 'srf-paramdesc-calendarfirstday', |
||
| 57 | 'default' => 'Sunday', |
||
| 58 | 'values' => [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ] |
||
| 59 | ]; |
||
| 60 | |||
| 61 | $params['start'] = [ |
||
| 62 | 'message' => 'srf-paramdesc-calendarstart', |
||
| 63 | 'default' => 'current', |
||
| 64 | 'values' => [ 'current', 'earliest', 'latest' ] |
||
| 65 | ]; |
||
| 66 | |||
| 67 | $params['legend'] = [ |
||
| 68 | 'message' => 'srf-paramdesc-calendarlegend', |
||
| 69 | 'default' => 'none', |
||
| 70 | 'values' => [ 'none', 'top', 'bottom', 'tooltip', 'pane' ] |
||
| 71 | ]; |
||
| 72 | |||
| 73 | $params['dayview'] = [ |
||
| 74 | 'type' => 'boolean', |
||
| 75 | 'message' => 'srf-paramdesc-dayview', |
||
| 76 | 'default' => false |
||
| 77 | ]; |
||
| 78 | |||
| 79 | $params['class'] = [ |
||
| 80 | 'message' => 'srf-paramdesc-class', |
||
| 81 | 'default' => '', |
||
| 82 | ]; |
||
| 83 | |||
| 84 | $params['theme'] = [ |
||
| 85 | 'message' => 'srf-paramdesc-theme', |
||
| 86 | 'default' => 'basic', |
||
| 87 | 'values' => [ 'basic', 'vector' ] |
||
| 88 | ]; |
||
| 89 | |||
| 90 | $params['clicktarget'] = [ |
||
| 91 | 'message' => 'srf-paramdesc-clicktarget', |
||
| 92 | 'default' => 'none' |
||
| 93 | ]; |
||
| 94 | |||
| 95 | return $params; |
||
| 96 | } |
||
| 97 | |||
| 145 |