| Conditions | 1 |
| Paths | 1 |
| Total Lines | 56 |
| Code Lines | 46 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 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 namespace CosmicRadioTV\Podcast\Components; |
||
| 67 | public function defineProperties() |
||
| 68 | { |
||
| 69 | return [ |
||
| 70 | 'showSlug' => [ |
||
| 71 | 'title' => 'cosmicradiotv.podcast::components.common.properties.show_slug.title', |
||
| 72 | 'description' => 'cosmicradiotv.podcast::components.episodes.properties.show_slug.description', |
||
| 73 | 'default' => '{{ :show_slug }}', |
||
| 74 | 'type' => 'string', |
||
| 75 | 'group' => trans('cosmicradiotv.podcast::components.episodes.groups.filters'), |
||
| 76 | ], |
||
| 77 | 'tagSlug' => [ |
||
| 78 | 'title' => 'cosmicradiotv.podcast::components.common.properties.tag_slug.title', |
||
| 79 | 'description' => 'cosmicradiotv.podcast::components.episodes.properties.tag_slug.description', |
||
| 80 | 'default' => '', |
||
| 81 | 'type' => 'string', |
||
| 82 | 'group' => trans('cosmicradiotv.podcast::components.episodes.groups.filters'), |
||
| 83 | ], |
||
| 84 | 'episodePage' => [ |
||
| 85 | 'title' => 'cosmicradiotv.podcast::components.episodes.properties.episode_page.title', |
||
| 86 | 'description' => 'cosmicradiotv.podcast::components.episodes.properties.episode_page.description', |
||
| 87 | 'type' => 'dropdown', |
||
| 88 | 'default' => 'podcast/episode', |
||
| 89 | 'required' => true, |
||
| 90 | 'group' => trans('cosmicradiotv.podcast::components.episodes.groups.links'), |
||
| 91 | ], |
||
| 92 | 'perPage' => [ |
||
| 93 | 'title' => 'cosmicradiotv.podcast::components.episodes.properties.per_page.title', |
||
| 94 | 'description' => 'cosmicradiotv.podcast::components.episodes.properties.per_page.description', |
||
| 95 | 'default' => 10, |
||
| 96 | 'type' => 'string', |
||
| 97 | 'validationPattern' => '^[0-9]+$', |
||
| 98 | 'validationMessage' => trans('cosmicradiotv.podcast::components.episodes.properties.per_page.validationMessage'), |
||
| 99 | 'required' => true, |
||
| 100 | 'group' => trans('cosmicradiotv.podcast::components.episodes.groups.pagination') |
||
| 101 | ], |
||
| 102 | 'allowPagination' => [ |
||
| 103 | 'title' => 'cosmicradiotv.podcast::components.episodes.properties.allow_pagination.title', |
||
| 104 | 'description' => 'cosmicradiotv.podcast::components.episodes.properties.allow_pagination.description', |
||
| 105 | 'default' => true, |
||
| 106 | 'type' => 'checkbox', |
||
| 107 | 'group' => trans('cosmicradiotv.podcast::components.episodes.groups.pagination') |
||
| 108 | ], |
||
| 109 | 'updateTitle' => [ |
||
| 110 | 'title' => 'cosmicradiotv.podcast::components.common.properties.update_title.title', |
||
| 111 | 'description' => 'cosmicradiotv.podcast::components.common.properties.update_title.description', |
||
| 112 | 'default' => true, |
||
| 113 | 'type' => 'checkbox', |
||
| 114 | ], |
||
| 115 | 'metaTags' => [ |
||
| 116 | 'title' => 'cosmicradiotv.podcast::components.common.properties.meta_tags.title', |
||
| 117 | 'description' => 'cosmicradiotv.podcast::components.common.properties.meta_tags.description', |
||
| 118 | 'default' => false, |
||
| 119 | 'type' => 'checkbox', |
||
| 120 | ], |
||
| 121 | ]; |
||
| 122 | } |
||
| 123 | |||
| 293 | } |