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