Applied fixes from StyleCI

This commit is contained in:
Pierre Rudloff 2016-09-07 22:28:28 +00:00 committed by StyleCI Bot
parent 6df1eccb9e
commit 13c3366e9d
6 changed files with 203 additions and 178 deletions

View file

@ -1,78 +1,88 @@
<?php
/**
* Config class
* Config class.
*/
namespace Alltube;
use Symfony\Component\Yaml\Yaml;
/**
* Manage config parameters
* Manage config parameters.
*/
class Config
{
/**
* Singleton instance
* Singleton instance.
*
* @var Config
*/
private static $instance;
/**
* youtube-dl binary path
* youtube-dl binary path.
*
* @var string
*/
public $youtubedl = 'vendor/rg3/youtube-dl/youtube_dl/__main__.py';
/**
* python binary path
* python binary path.
*
* @var string
*/
public $python = '/usr/bin/python';
/**
* youtube-dl parameters
* youtube-dl parameters.
*
* @var array
*/
public $params = array('--no-playlist', '--no-warnings', '-f best[protocol^=http]', '--playlist-end', 1);
public $params = ['--no-playlist', '--no-warnings', '-f best[protocol^=http]', '--playlist-end', 1];
/**
* Enable audio conversion
* Enable audio conversion.
*
* @var bool
*/
public $convert = false;
/**
* avconv or ffmpeg binary path
* avconv or ffmpeg binary path.
*
* @var string
*/
public $avconv = 'vendor/bin/ffmpeg';
/**
* rtmpdump binary path
* rtmpdump binary path.
*
* @var string
*/
public $rtmpdump = 'vendor/bin/rtmpdump';
/**
* curl binary path
* curl binary path.
*
* @var string
*/
public $curl = '/usr/bin/curl';
/**
* curl parameters
* curl parameters.
*
* @var array
*/
public $curl_params = array();
public $curl_params = [];
/**
* YAML config file path
* YAML config file path.
*
* @var string
*/
private $file;
/**
* Config constructor
* Config constructor.
*
* @param string $yamlfile YAML config file path
*/
@ -95,7 +105,7 @@ class Config
}
/**
* Get singleton instance
* Get singleton instance.
*
* @param string $yamlfile YAML config file name
*
@ -105,13 +115,15 @@ class Config
{
$yamlfile = __DIR__.'/../'.$yamlfile;
if (is_null(self::$instance) || self::$instance->file != $yamlfile) {
self::$instance = new Config($yamlfile);
self::$instance = new self($yamlfile);
}
return self::$instance;
}
/**
* Destroy singleton instance
* Destroy singleton instance.
*
* @return void
*/
public static function destroyInstance()