| Total Complexity | 3 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class ScaleFilter implements FFMpegVideoFilterInterface |
||
| 10 | { |
||
| 11 | public const OPTION_ASPECT_RATIO_INCREASE = 'increase'; |
||
|
|
|||
| 12 | public const OPTION_ASPECT_RATIO_DECREASE = 'decrease'; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Built-in aspect ratios. |
||
| 16 | * |
||
| 17 | * @var string[] |
||
| 18 | */ |
||
| 19 | public const ASPECT_RATIO_MODES = [ |
||
| 20 | self::OPTION_ASPECT_RATIO_INCREASE, |
||
| 21 | self::OPTION_ASPECT_RATIO_DECREASE, |
||
| 22 | ]; |
||
| 23 | |||
| 24 | /** @var int|string */ |
||
| 25 | protected $height; |
||
| 26 | |||
| 27 | /** @var int|string */ |
||
| 28 | protected $width; |
||
| 29 | |||
| 30 | /** @var string|null */ |
||
| 31 | protected $aspect_ratio_mode; |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Scale filter. |
||
| 35 | * |
||
| 36 | * @see https://trac.ffmpeg.org/wiki/Scaling |
||
| 37 | * |
||
| 38 | * @param string|int $width as an int or any ffmpeg supported placeholder: iw*.5 |
||
| 39 | * @param string|int $height as an int or any ffmpeg supported placeholder: ih*2.3 |
||
| 40 | */ |
||
| 41 | 3 | public function __construct($width, $height, ?string $aspect_ratio_mode = null) |
|
| 42 | { |
||
| 43 | 3 | $this->width = $width; |
|
| 44 | 3 | $this->height = $height; |
|
| 45 | 3 | $this->aspect_ratio_mode = $aspect_ratio_mode; |
|
| 46 | 3 | } |
|
| 47 | |||
| 48 | 3 | public function getFFmpegCLIValue(): string |
|
| 64 | } |
||
| 65 | } |
||
| 66 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.