Conditions | 1 |
Paths | 1 |
Total Lines | 84 |
Code Lines | 51 |
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 |
||
32 | public function getParamsOptions(): array |
||
33 | { |
||
34 | return [ |
||
35 | ConversionParamsInterface::PARAM_OUTPUT_FORMAT => [ |
||
36 | 'pattern' => '-f %s', |
||
37 | ], |
||
38 | |||
39 | ConversionParamsInterface::PARAM_VIDEO_CODEC => [ |
||
40 | 'pattern' => '-c:v %s', |
||
41 | ], |
||
42 | ConversionParamsInterface::PARAM_VIDEO_BITRATE => [ |
||
43 | 'pattern' => '-b:v %s', |
||
44 | ], |
||
45 | ConversionParamsInterface::PARAM_VIDEO_MIN_BITRATE => [ |
||
46 | 'pattern' => '-minrate %s', |
||
47 | ], |
||
48 | ConversionParamsInterface::PARAM_VIDEO_MAX_BITRATE => [ |
||
49 | 'pattern' => '-maxrate %s', |
||
50 | ], |
||
51 | |||
52 | ConversionParamsInterface::PARAM_AUDIO_CODEC => [ |
||
53 | 'pattern' => '-c:a %s', |
||
54 | ], |
||
55 | ConversionParamsInterface::PARAM_AUDIO_BITRATE => [ |
||
56 | 'pattern' => '-b:a %s', |
||
57 | ], |
||
58 | ConversionParamsInterface::PARAM_PIX_FMT => [ |
||
59 | 'pattern' => '-pix_fmt %s', |
||
60 | ], |
||
61 | ConversionParamsInterface::PARAM_PRESET => [ |
||
62 | 'pattern' => '-preset %s', |
||
63 | ], |
||
64 | ConversionParamsInterface::PARAM_SPEED => [ |
||
65 | 'pattern' => '-speed %d', |
||
66 | ], |
||
67 | ConversionParamsInterface::PARAM_THREADS => [ |
||
68 | 'pattern' => '-threads %d', |
||
69 | ], |
||
70 | ConversionParamsInterface::PARAM_KEYFRAME_SPACING => [ |
||
71 | 'pattern' => '-g %d', |
||
72 | ], |
||
73 | ConversionParamsInterface::PARAM_QUALITY => [ |
||
74 | 'pattern' => '-quality %s', |
||
75 | ], |
||
76 | |||
77 | ConversionParamsInterface::PARAM_VIDEO_QUALITY_SCALE => [ |
||
78 | 'pattern' => '-qscale:v %d', |
||
79 | ], |
||
80 | |||
81 | ConversionParamsInterface::PARAM_CRF => [ |
||
82 | 'pattern' => '-crf %d', |
||
83 | ], |
||
84 | ConversionParamsInterface::PARAM_STREAMABLE => [ |
||
85 | 'pattern' => '-movflags +faststart', |
||
86 | ], |
||
87 | |||
88 | ConversionParamsInterface::PARAM_FRAME_PARALLEL => [ |
||
89 | 'pattern' => '-frame-parallel %s', |
||
90 | ], |
||
91 | ConversionParamsInterface::PARAM_TILE_COLUMNS => [ |
||
92 | 'pattern' => '-tile-columns %s', |
||
93 | ], |
||
94 | ConversionParamsInterface::PARAM_TUNE => [ |
||
95 | 'pattern' => '-tune %s', |
||
96 | ], |
||
97 | ConversionParamsInterface::PARAM_VIDEO_FILTER => [ |
||
98 | 'pattern' => '-vf %s', |
||
99 | ], |
||
100 | ConversionParamsInterface::PARAM_OVERWRITE => [ |
||
101 | 'pattern' => '-y', |
||
102 | ], |
||
103 | ConversionParamsInterface::PARAM_VIDEO_FRAMES => [ |
||
104 | 'pattern' => '-frames:v %d', |
||
105 | ], |
||
106 | ConversionParamsInterface::PARAM_NOAUDIO => [ |
||
107 | 'pattern' => '-an', |
||
108 | ], |
||
109 | |||
110 | ConversionParamsInterface::PARAM_SEEK_START => [ |
||
111 | 'pattern' => '-ss %s', |
||
112 | ], |
||
113 | |||
114 | ConversionParamsInterface::PARAM_SEEK_END => [ |
||
115 | 'pattern' => '-to %s', |
||
116 | ], |
||
207 |