Conditions | 1 |
Paths | 1 |
Total Lines | 51 |
Code Lines | 27 |
Lines | 0 |
Ratio | 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 |
||
54 | public function initialize_class_file_map(){ |
||
55 | |||
56 | $this->class_file_map = array( |
||
57 | |||
58 | /** |
||
59 | * Main Sensei class |
||
60 | */ |
||
61 | 'Sensei_Main' => 'class-sensei.php', |
||
62 | |||
63 | /** |
||
64 | * Admin |
||
65 | */ |
||
66 | 'Sensei_Welcome' => 'admin/class-sensei-welcome.php' , |
||
67 | 'Sensei_Learner_Management' => 'admin/class-sensei-learner-management.php' , |
||
68 | |||
69 | /** |
||
70 | * Shortcodes |
||
71 | */ |
||
72 | 'Sensei_Shortcode_Loader' => 'shortcodes/class-sensei-shortcode-loader.php', |
||
73 | 'Sensei_Shortcode_Interface' => 'shortcodes/interface-sensei-shortcode.php', |
||
74 | 'Sensei_Shortcode_Featured_Courses' => 'shortcodes/class-sensei-shortcode-featured-courses.php', |
||
75 | 'Sensei_Shortcode_User_Courses' => 'shortcodes/class-sensei-shortcode-user-courses.php', |
||
76 | 'Sensei_Shortcode_Courses' => 'shortcodes/class-sensei-shortcode-courses.php', |
||
77 | 'Sensei_Shortcode_Teachers' => 'shortcodes/class-sensei-shortcode-teachers.php', |
||
78 | 'Sensei_Shortcode_User_Messages' => 'shortcodes/class-sensei-shortcode-user-messages.php', |
||
79 | 'Sensei_Shortcode_Course_Page' => 'shortcodes/class-sensei-shortcode-course-page.php', |
||
80 | 'Sensei_Shortcode_Lesson_Page' => 'shortcodes/class-sensei-shortcode-lesson-page.php', |
||
81 | 'Sensei_Shortcode_Course_Categories' => 'shortcodes/class-sensei-shortcode-course-categories.php', |
||
82 | 'Sensei_Shortcode_Unpurchased_Courses' => 'shortcodes/class-sensei-shortcode-unpurchased-courses.php', |
||
83 | 'Sensei_Legacy_Shortcodes' => 'shortcodes/class-sensei-legacy-shortcodes.php', |
||
84 | |||
85 | /** |
||
86 | * Built in theme integration support |
||
87 | */ |
||
88 | 'Sensei_Theme_Integration_Loader' => 'theme-integrations/theme-integration-loader.php', |
||
89 | 'Sensei__S' => 'theme-integrations/_s.php', |
||
90 | 'Sensei_Twentyeleven' => 'theme-integrations/twentyeleven.php', |
||
91 | 'Sensei_Twentytwelve' => 'theme-integrations/twentytwelve.php', |
||
92 | 'Sensei_Twentythirteen' => 'theme-integrations/Twentythirteen.php', |
||
93 | 'Sensei_Twentyfourteen' => 'theme-integrations/Twentyfourteen.php', |
||
94 | 'Sensei_Twentyfifteen' => 'theme-integrations/Twentyfifteen.php', |
||
95 | 'Sensei_Twentysixteen' => 'theme-integrations/Twentysixteen.php', |
||
96 | 'Sensei_Storefront' => 'theme-integrations/Storefront.php', |
||
97 | |||
98 | /** |
||
99 | * WooCommerce |
||
100 | */ |
||
101 | 'Sensei_WC' => 'class-sensei-wc.php', |
||
102 | |||
103 | ); |
||
104 | } |
||
105 | |||
150 |