From 08e6754e0eb4d893256bcc87d86a3daf1402411a Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Tue, 10 Feb 2015 14:09:40 +0100 Subject: [PATCH] refactoring --- src/Api/Client.php | 6 +++--- src/Api/ConfigLoader.php | 2 +- src/Console/Command/TorrentsSearchCommand.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Api/Client.php b/src/Api/Client.php index f789dd4..c2566ba 100644 --- a/src/Api/Client.php +++ b/src/Api/Client.php @@ -13,7 +13,7 @@ class Client 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) @@ -48,9 +48,9 @@ class Client public function searchTorrents($query, $options) { $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])) { $query[$p] = $options[$p]; } diff --git a/src/Api/ConfigLoader.php b/src/Api/ConfigLoader.php index bdc3c36..9cc7b15 100644 --- a/src/Api/ConfigLoader.php +++ b/src/Api/ConfigLoader.php @@ -33,6 +33,6 @@ class ConfigLoader public function getConfig() { - return $this->configExists() ? Yaml::parse($this->configFile) : array(); + return $this->configExists() ? Yaml::parse($this->configFile) : []; } } diff --git a/src/Console/Command/TorrentsSearchCommand.php b/src/Console/Command/TorrentsSearchCommand.php index 90321a7..fbf87a1 100644 --- a/src/Console/Command/TorrentsSearchCommand.php +++ b/src/Console/Command/TorrentsSearchCommand.php @@ -74,7 +74,7 @@ class TorrentsSearchCommand extends Command foreach ($terms as $term) { if (isset($termType['terms'][$term])) { if (!isset($finalTerms[$termTypeId])) { - $finalTerms[$termTypeId] = array(); + $finalTerms[$termTypeId] = []; } if (!in_array($term, $finalTerms[$termTypeId])) {