phpstan update

Better typying
This commit is contained in:
Pierre Rudloff 2020-05-13 22:28:05 +02:00
parent 74db3b9ad0
commit 6adc1df213
17 changed files with 166 additions and 158 deletions

View file

@ -40,7 +40,7 @@ class Config
/**
* youtube-dl parameters.
*
* @var array
* @var string[]
*/
public $params = ['--no-warnings', '--ignore-errors', '--flat-playlist', '--restrict-filenames', '--no-playlist'];
@ -61,7 +61,7 @@ class Config
/**
* List of formats available in advanced conversion mode.
*
* @var array
* @var string[]
*/
public $convertAdvancedFormats = ['mp3', 'avi', 'flv', 'wav'];
@ -125,7 +125,7 @@ class Config
/**
* Generic formats supported by youtube-dl.
*
* @var array
* @var string[]
*/
public $genericFormats = [];
@ -139,7 +139,8 @@ class Config
/**
* Config constructor.
*
* @param array $options Options
* @param mixed[] $options Options
* @throws CaseConverterException
*/
private function __construct(array $options = [])
{
@ -210,7 +211,7 @@ class Config
/**
* Apply the provided options.
*
* @param array $options Options
* @param mixed[] $options Options
*
* @return void
*/
@ -260,12 +261,13 @@ class Config
* Set options from a YAML file.
*
* @param string $file Path to the YAML file
* @return void
* @throws Exception
*/
public static function setFile($file)
{
if (is_file($file)) {
$options = Yaml::parse(file_get_contents($file));
$options = Yaml::parse(strval(file_get_contents($file)));
self::$instance = new self($options);
self::$instance->validateOptions();
} else {
@ -276,8 +278,9 @@ class Config
/**
* Manually set some options.
*
* @param array $options Options (see `config/config.example.yml` for available options)
* @param mixed[] $options Options (see `config/config.example.yml` for available options)
* @param bool $update True to update an existing instance
* @return void
* @throws Exception
*/
public static function setOptions(array $options, $update = true)