Stronger typying now that we target PHP 7.4

This commit is contained in:
Pierre Rudloff 2023-03-21 20:18:21 +01:00
parent b23ce88be8
commit 71647158d3
No known key found for this signature in database
5 changed files with 31 additions and 29 deletions

View file

@ -24,84 +24,86 @@ class Config
*
* @var string
*/
public $youtubedl = 'vendor/ytdl-org/youtube-dl/youtube_dl/__main__.py';
public string $youtubedl = 'vendor/ytdl-org/youtube-dl/youtube_dl/__main__.py';
/**
* python binary path.
*
* @var string
*/
public $python = '/usr/bin/python';
public string $python = '/usr/bin/python';
/**
* youtube-dl parameters.
*
* @var string[]
*/
public $params = ['--no-warnings', '--ignore-errors', '--flat-playlist', '--restrict-filenames', '--no-playlist'];
public array $params = [
'--no-warnings', '--ignore-errors', '--flat-playlist', '--restrict-filenames', '--no-playlist'
];
/**
* Enable audio conversion.
*
* @var bool
*/
public $convert = false;
public bool $convert = false;
/**
* Enable advanced conversion mode.
*
* @var bool
*/
public $convertAdvanced = false;
public bool $convertAdvanced = false;
/**
* List of formats available in advanced conversion mode.
*
* @var string[]
*/
public $convertAdvancedFormats = ['mp3', 'avi', 'flv', 'wav'];
public array $convertAdvancedFormats = ['mp3', 'avi', 'flv', 'wav'];
/**
* ffmpeg binary path.
*
* @var string
*/
public $ffmpeg = '/usr/bin/ffmpeg';
public string $ffmpeg = '/usr/bin/ffmpeg';
/**
* Path to the directory that contains the phantomjs binary.
*
* @var string
*/
public $phantomjsDir = '/usr/bin/';
public string $phantomjsDir = '/usr/bin/';
/**
* Disable URL rewriting.
*
* @var bool
*/
public $uglyUrls = false;
public bool $uglyUrls = false;
/**
* Stream downloaded files trough server?
*
* @var bool
*/
public $stream = false;
public bool $stream = false;
/**
* Allow to remux video + audio?
*
* @var bool
*/
public $remux = false;
public bool $remux = false;
/**
* MP3 bitrate when converting (in kbit/s).
*
* @var int
*/
public $audioBitrate = 128;
public int $audioBitrate = 128;
/**
* ffmpeg logging level.
@ -109,21 +111,21 @@ class Config
*
* @var string
*/
public $ffmpegVerbosity = 'error';
public string $ffmpegVerbosity = 'error';
/**
* App name.
*
* @var string
*/
public $appName = 'AllTube Download';
public string $appName = 'AllTube Download';
/**
* Generic formats supported by youtube-dl.
*
* @var string[]
*/
public $genericFormats = [
public array $genericFormats = [
'best/bestvideo' => 'Best',
'bestvideo+bestaudio' => 'Remux best video with best audio',
'worst/worstvideo' => 'Worst',
@ -134,21 +136,21 @@ class Config
*
* @var bool
*/
public $debug = false;
public bool $debug = false;
/**
* Default to audio.
*
* @var bool
*/
public $defaultAudio = false;
public bool $defaultAudio = false;
/**
* Disable audio conversion from/to seeker.
*
* @var bool
*/
public $convertSeek = true;
public bool $convertSeek = true;
/**
* Config constructor.