Conditions | 12 |
Paths | 13 |
Total Lines | 31 |
Code Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 3 | ||
Bugs | 1 | 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 |
||
41 | { |
||
42 | case 'compression': |
||
43 | case 'compression lossless': |
||
44 | $this->lossless = ($value == 'true' || $value == 'Uncompressed'); |
||
45 | break; |
||
46 | |||
47 | case 'height': |
||
48 | case 'image height': |
||
49 | case 'tiff:imageheigth': |
||
50 | case 'tiff:imagelength': |
||
51 | $this->height = (int) $value; |
||
52 | break; |
||
53 | |||
54 | case 'width': |
||
55 | case 'image width': |
||
56 | case 'tiff:imagewidth': |
||
57 | $this->width = (int) $value; |
||
58 | break; |
||
59 | |||
60 | case 'x-tika:content': |
||
61 | $this->content = $value; |
||
62 | break; |
||
63 | } |
||
64 | |||
65 | return $this; |
||
66 | } |
||
67 | } |
||
68 |