refactoring

This commit is contained in:
Simon Vieille 2015-02-10 14:09:40 +01:00
parent e2acfcf68a
commit 08e6754e0e
3 changed files with 5 additions and 5 deletions

View file

@ -13,7 +13,7 @@ class Client
public function __construct() public function __construct()
{ {
$this->client = new GuzzleClient(array('base_url' => 'https://api.t411.me')); $this->client = new GuzzleClient(['base_url' => 'https://api.t411.me']);
} }
public function getAuthorization($username, $password) public function getAuthorization($username, $password)
@ -48,9 +48,9 @@ class Client
public function searchTorrents($query, $options) public function searchTorrents($query, $options)
{ {
$url = '/torrents/search/'.urlencode($query); $url = '/torrents/search/'.urlencode($query);
$query = array(); $query = [];
foreach (array('offset', 'limit', 'cat') as $p) { foreach (['offset', 'limit', 'cat'] as $p) {
if (!empty($options[$p])) { if (!empty($options[$p])) {
$query[$p] = $options[$p]; $query[$p] = $options[$p];
} }

View file

@ -33,6 +33,6 @@ class ConfigLoader
public function getConfig() public function getConfig()
{ {
return $this->configExists() ? Yaml::parse($this->configFile) : array(); return $this->configExists() ? Yaml::parse($this->configFile) : [];
} }
} }

View file

@ -74,7 +74,7 @@ class TorrentsSearchCommand extends Command
foreach ($terms as $term) { foreach ($terms as $term) {
if (isset($termType['terms'][$term])) { if (isset($termType['terms'][$term])) {
if (!isset($finalTerms[$termTypeId])) { if (!isset($finalTerms[$termTypeId])) {
$finalTerms[$termTypeId] = array(); $finalTerms[$termTypeId] = [];
} }
if (!in_array($term, $finalTerms[$termTypeId])) { if (!in_array($term, $finalTerms[$termTypeId])) {