| Conditions | 1 |
| Paths | 1 |
| Total Lines | 89 |
| Code Lines | 42 |
| 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 |
||
| 20 | protected static function dbGetTableFields() { |
||
| 21 | return |
||
| 22 | [ |
||
| 23 | 'id' => |
||
| 24 | [ |
||
| 25 | 'Field' => 'id', |
||
| 26 | 'Type' => 'bigint(20) unsigned', |
||
| 27 | 'Collation' => null, |
||
| 28 | 'Null' => 'NO', |
||
| 29 | 'Key' => 'PRI', |
||
| 30 | 'Default' => null, |
||
| 31 | 'Extra' => 'auto_increment', |
||
| 32 | 'Privileges' => 'select,insert,update,references', |
||
| 33 | 'Comment' => '', |
||
| 34 | ], |
||
| 35 | 'timestamp_current' => |
||
| 36 | [ |
||
| 37 | 'Field' => 'timestamp_current', |
||
| 38 | 'Type' => 'timestamp', |
||
| 39 | 'Collation' => null, |
||
| 40 | 'Null' => 'NO', |
||
| 41 | 'Key' => '', |
||
| 42 | 'Default' => 'CURRENT_TIMESTAMP', |
||
| 43 | 'Extra' => 'on update CURRENT_TIMESTAMP', |
||
| 44 | 'Privileges' => 'select,insert,update,references', |
||
| 45 | 'Comment' => '', |
||
| 46 | ], |
||
| 47 | 'varchar' => |
||
| 48 | [ |
||
| 49 | 'Field' => 'varchar', |
||
| 50 | 'Type' => 'varchar(32)', |
||
| 51 | 'Collation' => 'utf8_general_ci', |
||
| 52 | 'Null' => 'YES', |
||
| 53 | 'Key' => 'UNI', |
||
| 54 | 'Default' => '', |
||
| 55 | 'Extra' => '', |
||
| 56 | 'Privileges' => 'select,insert,update,references', |
||
| 57 | 'Comment' => '', |
||
| 58 | ], |
||
| 59 | 'null' => |
||
| 60 | [ |
||
| 61 | 'Field' => 'varchar', |
||
| 62 | 'Type' => 'varchar(32)', |
||
| 63 | 'Collation' => 'utf8_general_ci', |
||
| 64 | 'Null' => 'YES', |
||
| 65 | 'Key' => 'UNI', |
||
| 66 | 'Default' => null, |
||
| 67 | 'Extra' => '', |
||
| 68 | 'Privileges' => 'select,insert,update,references', |
||
| 69 | 'Comment' => '', |
||
| 70 | ], |
||
| 71 | // 'owner' => |
||
| 72 | // [ |
||
| 73 | // 'Field' => 'ally_owner', |
||
| 74 | // 'Type' => 'bigint(20) unsigned', |
||
| 75 | // 'Collation' => null, |
||
| 76 | // 'Null' => 'YES', |
||
| 77 | // 'Key' => 'MUL', |
||
| 78 | // 'Default' => null, |
||
| 79 | // 'Extra' => '', |
||
| 80 | // 'Privileges' => 'select,insert,update,references', |
||
| 81 | // 'Comment' => '', |
||
| 82 | // ], |
||
| 83 | // 'unix_time' => |
||
| 84 | // [ |
||
| 85 | // 'Field' => 'ally_register_time', |
||
| 86 | // 'Type' => 'int(11)', |
||
| 87 | // 'Collation' => null, |
||
| 88 | // 'Null' => 'NO', |
||
| 89 | // 'Key' => '', |
||
| 90 | // 'Default' => '0', |
||
| 91 | // 'Extra' => '', |
||
| 92 | // 'Privileges' => 'select,insert,update,references', |
||
| 93 | // 'Comment' => '', |
||
| 94 | // ], |
||
| 95 | // 'medium_text' => |
||
| 96 | // [ |
||
| 97 | // 'Field' => 'ally_description', |
||
| 98 | // 'Type' => 'mediumtext', |
||
| 99 | // 'Collation' => 'utf8_general_ci', |
||
| 100 | // 'Null' => 'YES', |
||
| 101 | // 'Key' => '', |
||
| 102 | // 'Default' => null, |
||
| 103 | // 'Extra' => '', |
||
| 104 | // 'Privileges' => 'select,insert,update,references', |
||
| 105 | // 'Comment' => '', |
||
| 106 | // ], |
||
| 107 | ]; |
||
| 108 | } |
||
| 109 | |||
| 134 |