Conditions | 1 |
Paths | 1 |
Total Lines | 70 |
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 |
||
44 | public static function get_field_data() { |
||
45 | return array( |
||
46 | 'glue' => array( |
||
47 | 'type' => 'text', |
||
48 | 'title' => __( 'Glue', 'carbon_breadcrumbs' ), |
||
49 | 'default' => ' > ', |
||
50 | 'help' => __( 'This is displayed between the breadcrumb items.', 'carbon_breadcrumbs' ), |
||
51 | ), |
||
52 | 'link_before' => array( |
||
53 | 'type' => 'text', |
||
54 | 'title' => __( 'Link Before', 'carbon_breadcrumbs' ), |
||
55 | 'default' => '', |
||
56 | 'help' => __( 'This is displayed before the breadcrumb item link.', 'carbon_breadcrumbs' ), |
||
57 | ), |
||
58 | 'link_after' => array( |
||
59 | 'type' => 'text', |
||
60 | 'title' => __( 'Link After', 'carbon_breadcrumbs' ), |
||
61 | 'default' => '', |
||
62 | 'help' => __( 'This is displayed after the breadcrumb item link.', 'carbon_breadcrumbs' ), |
||
63 | ), |
||
64 | 'wrapper_before' => array( |
||
65 | 'type' => 'text', |
||
66 | 'title' => __( 'Wrapper Before', 'carbon_breadcrumbs' ), |
||
67 | 'default' => '', |
||
68 | 'help' => __( 'This is displayed before displaying the breadcrumb items.', 'carbon_breadcrumbs' ), |
||
69 | ), |
||
70 | 'wrapper_after' => array( |
||
71 | 'type' => 'text', |
||
72 | 'title' => __( 'Wrapper After', 'carbon_breadcrumbs' ), |
||
73 | 'default' => '', |
||
74 | 'help' => __( 'This is displayed after displaying the breadcrumb items.', 'carbon_breadcrumbs' ), |
||
75 | ), |
||
76 | 'title_before' => array( |
||
77 | 'type' => 'text', |
||
78 | 'title' => __( 'Title Before', 'carbon_breadcrumbs' ), |
||
79 | 'default' => '', |
||
80 | 'help' => __( 'This is displayed before the breadcrumb item title.', 'carbon_breadcrumbs' ), |
||
81 | ), |
||
82 | 'title_after' => array( |
||
83 | 'type' => 'text', |
||
84 | 'title' => __( 'Title After', 'carbon_breadcrumbs' ), |
||
85 | 'default' => '', |
||
86 | 'help' => __( 'This is displayed after the breadcrumb item title.', 'carbon_breadcrumbs' ), |
||
87 | ), |
||
88 | 'min_items' => array( |
||
89 | 'type' => 'text', |
||
90 | 'title' => __( 'Min Items', 'carbon_breadcrumbs' ), |
||
91 | 'default' => 2, |
||
92 | 'help' => __( 'Determines the minimum number of items, required to display the breadcrumb trail.', 'carbon_breadcrumbs' ), |
||
93 | ), |
||
94 | 'last_item_link' => array( |
||
95 | 'type' => 'checkbox', |
||
96 | 'title' => __( 'Last Item Link', 'carbon_breadcrumbs' ), |
||
97 | 'default' => true, |
||
98 | 'help' => __( 'Whether the last breadcrumb item should be a link.', 'carbon_breadcrumbs' ), |
||
99 | ), |
||
100 | 'display_home_item' => array( |
||
101 | 'type' => 'checkbox', |
||
102 | 'title' => __( 'Display Home Item?', 'carbon_breadcrumbs' ), |
||
103 | 'default' => true, |
||
104 | 'help' => __( 'Whether the home breadcrumb item should be displayed.', 'carbon_breadcrumbs' ), |
||
105 | ), |
||
106 | 'home_item_title' => array( |
||
107 | 'type' => 'text', |
||
108 | 'title' => __( 'Home Item Title', 'carbon_breadcrumbs' ), |
||
109 | 'default' => __( 'Home', 'carbon_breadcrumbs' ), |
||
110 | 'help' => __( 'Determines the title of the home item.', 'carbon_breadcrumbs' ), |
||
111 | ), |
||
112 | ); |
||
113 | } |
||
114 | |||
200 |