Conditions | 12 |
Paths | 60 |
Total Lines | 84 |
Code Lines | 56 |
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 |
||
40 | Helper::delete($item['id'], true, $arguments['uid']); |
||
41 | } else { |
||
42 | Helper::delete($item['id']); |
||
43 | } |
||
44 | } |
||
45 | } |
||
46 | |||
47 | /** |
||
48 | * Function that is called after a group is removed. Cleans up the shares to that group. |
||
49 | * @param array $arguments |
||
50 | */ |
||
51 | public static function post_deleteGroup($arguments) { |
||
52 | $sql = 'SELECT `id` FROM `*PREFIX*share` WHERE `share_type` = ? AND `share_with` = ?'; |
||
53 | $result = \OC_DB::executeAudited($sql, array(self::SHARE_TYPE_GROUP, $arguments['gid'])); |
||
54 | while ($item = $result->fetchRow()) { |
||
55 | Helper::delete($item['id']); |
||
56 | } |
||
57 | } |
||
58 | |||
59 | } |
||
60 |