Conditions | 1 |
Paths | 1 |
Total Lines | 58 |
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 |
||
17 | function onboard_ME() { |
||
18 | |||
19 | elgg_register_page_handler('profileonboard', 'profileonboard_page_handler'); |
||
20 | elgg_register_page_handler('groupsonboard', 'groupsonboard_page_handler'); |
||
21 | |||
22 | //actions |
||
23 | elgg_register_action("onboard/join", elgg_get_plugins_path() . "gc_onboard/actions/groups/membership/join.php"); |
||
24 | elgg_register_action("onboard/search", elgg_get_plugins_path() . "gc_onboard/actions/groups/onboard-search.php"); |
||
25 | elgg_register_action("onboard/upload", elgg_get_plugins_path() . "/gc_onboard/actions/onboard/upload.php"); |
||
26 | elgg_register_action("onboard/update-profile", elgg_get_plugins_path() . "/gc_onboard/actions/update-profile.php"); |
||
27 | elgg_register_action("onboard/set_cta", elgg_get_plugins_path() . "/gc_onboard/actions/set_cta.php"); |
||
28 | elgg_register_action("onboard/set_wire_metadata", elgg_get_plugins_path() . "/gc_onboard/actions/set_wire_metadata.php"); |
||
29 | |||
30 | //profile strength views |
||
31 | elgg_register_ajax_view('profileStrength/info'); |
||
32 | elgg_register_ajax_view('profileStrength/infoCard'); |
||
33 | |||
34 | //views for complete profile onboarding |
||
35 | elgg_register_ajax_view('profile-steps/stepOne'); |
||
36 | elgg_register_ajax_view('profile-steps/stepTwo'); |
||
37 | elgg_register_ajax_view('profile-steps/stepThree'); |
||
38 | elgg_register_ajax_view('profile-steps/stepFour'); |
||
39 | elgg_register_ajax_view('profile-steps/stepFive'); |
||
40 | |||
41 | //views for groups onboarding |
||
42 | elgg_register_ajax_view('groups-steps/group-tracker'); |
||
43 | |||
44 | //views for intro profile onboarding |
||
45 | elgg_register_ajax_view('welcome-steps/stepOne'); |
||
46 | elgg_register_ajax_view('welcome-steps/stepTwo'); |
||
47 | elgg_register_ajax_view('welcome-steps/stepThree'); |
||
48 | elgg_register_ajax_view('welcome-steps/stepFour'); |
||
49 | elgg_register_ajax_view('welcome-steps/stepFive'); |
||
50 | |||
51 | //geds view |
||
52 | elgg_register_ajax_view('welcome-steps/geds/org-people'); |
||
53 | |||
54 | //step counter |
||
55 | elgg_register_ajax_view('page/elements/step_counter'); |
||
56 | |||
57 | elgg_extend_view('css/elgg', 'onboard/css'); |
||
58 | elgg_extend_view('css/elgg', 'onboard/bootstrap-tour.min'); |
||
59 | |||
60 | //Extend layout for call to action (cta) |
||
61 | elgg_extend_view('page/layouts/one_sidebar', 'page/elements/onboard_start', 450); |
||
62 | elgg_extend_view('thewire/sidebar', 'welcome-steps/wire_modal', 449); |
||
63 | elgg_extend_view('contactform/contactform', 'onboard/module_links'); |
||
64 | |||
65 | //extend newsfeed to launch onboarding |
||
66 | elgg_extend_view('widgets/stream_newsfeed_index/content', 'onboard/launch', 491); |
||
67 | elgg_extend_view('widgets/wet_activity/content', 'onboard/launch', 491); |
||
68 | |||
69 | elgg_require_js("onboard_require"); |
||
70 | |||
71 | elgg_register_js('bootstrap_tour',"mod/gc_onboard/views/default/js/bootstrap-tour.min.js"); |
||
72 | elgg_register_js('group_tour', 'mod/gc_onboard/views/default/js/group_tour.js'); |
||
73 | |||
74 | } |
||
75 | |||
165 |
If you suppress an error, we recommend checking for the error condition explicitly: