From 4c6f29b791439fed2949d89e04cbddf7f725938b Mon Sep 17 00:00:00 2001 From: Tobias Krais Date: Tue, 20 Jun 2017 22:24:01 +0200 Subject: [PATCH] replace array() with [] --- lib/category.php | 10 +++++----- lib/contact.php | 4 ++-- pages/category.php | 4 ++-- plugins/export/lib/aexport.php | 2 +- plugins/export/lib/provider.php | 2 +- plugins/export/lib/socialexport_linkedin.php | 2 +- plugins/export/pages/provider.php | 4 ++-- plugins/export/vendor/Facebook/base_facebook.php | 4 ++-- plugins/window_advertising/lib/advertisement.php | 6 +++--- plugins/window_advertising/pages/advertisement.php | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/category.php b/lib/category.php index bd812e9..4f8bb22 100644 --- a/lib/category.php +++ b/lib/category.php @@ -141,7 +141,7 @@ public static function getAll($clang_id) { $result = rex_sql::factory(); $result->setQuery($query); - $categories = array(); + $categories = []; for($i = 0; $i < $result->getRows(); $i++) { $categories[] = new Category($result->getValue("category_id"), $clang_id); $result->next(); @@ -167,7 +167,7 @@ public function getChildren() { $result = rex_sql::factory(); $result->setQuery($query); - $children = array(); + $children = []; for($i = 0; $i < $result->getRows(); $i++) { $children[] = new Category($result->getValue("category_id"), $this->clang_id); $result->next(); @@ -214,7 +214,7 @@ public function getProperties() { $result = rex_sql::factory(); $result->setQuery($query); - $properties = array(); + $properties = []; for($i = 0; $i < $result->getRows(); $i++) { $properties[] = new Property($result->getValue("property_id"), $this->clang_id); $result->next(); @@ -259,7 +259,7 @@ public function getURL($including_domain = FALSE) { if($this->url == "") { $d2u_immo = rex_addon::get("d2u_immo"); - $parameterArray = array(); + $parameterArray = []; $parameterArray['category_id'] = $this->category_id; $this->url = rex_getUrl($d2u_immo->getConfig('article_id'), $this->clang_id, $parameterArray, "&"); @@ -356,7 +356,7 @@ private function setPriority() { $this->priority = $result->getRows() + 1; } - $categories = array(); + $categories = []; for($i = 0; $i < $result->getRows(); $i++) { $categories[$result->getValue("priority")] = $result->getValue("category_id"); $result->next(); diff --git a/lib/contact.php b/lib/contact.php index a5d56c2..7aa2781 100644 --- a/lib/contact.php +++ b/lib/contact.php @@ -127,7 +127,7 @@ public static function getAll() { $result = rex_sql::factory(); $result->setQuery($query); - $contacts = array(); + $contacts = []; for($i = 0; $i < $result->getRows(); $i++) { $contacts[] = new Contact($result->getValue("contact_id")); $result->next(); @@ -153,7 +153,7 @@ public function getProperties() { $result = rex_sql::factory(); $result->setQuery($query); - $properties = array(); + $properties = []; for($i = 0; $i < $result->getRows(); $i++) { $properties[] = new Property($result->getValue("property_id"), $this->clang_id); $result->next(); diff --git a/pages/category.php b/pages/category.php index 2c467f6..2467038 100644 --- a/pages/category.php +++ b/pages/category.php @@ -130,7 +130,7 @@
getId() != rex_config::get("d2u_immo", "default_lang")) { - $options_translations = array(); + $options_translations = []; $options_translations["yes"] = rex_i18n::msg('d2u_helper_translation_needs_update'); $options_translations["no"] = rex_i18n::msg('d2u_helper_translation_is_uptodate'); $options_translations["delete"] = rex_i18n::msg('d2u_helper_translation_delete'); @@ -160,7 +160,7 @@ } $options = array("-1"=>rex_i18n::msg('d2u_immo_category_parent_none')); - $selected_values = array(); + $selected_values = []; foreach(Category::getAll(rex_config::get("d2u_immo", "default_lang")) as $parent_category) { if(!$parent_category->isChild() && $parent_category->category_id != $category->category_id) { $options[$parent_category->category_id] = $parent_category->name; diff --git a/plugins/export/lib/aexport.php b/plugins/export/lib/aexport.php index 80008c6..6afaeb4 100644 --- a/plugins/export/lib/aexport.php +++ b/plugins/export/lib/aexport.php @@ -6,7 +6,7 @@ abstract class AExport { /** * @var ExportedProperty[] that need to be exported. */ - protected $export_properties = array(); + protected $export_properties = []; /** * @var Provider Export provider object. diff --git a/plugins/export/lib/provider.php b/plugins/export/lib/provider.php index f589b04..a414f4d 100644 --- a/plugins/export/lib/provider.php +++ b/plugins/export/lib/provider.php @@ -360,7 +360,7 @@ public static function getAll() { $result = rex_sql::factory(); $result->setQuery($query); - $providers = array(); + $providers = []; for($i = 0; $i < $result->getRows(); $i++) { $providers[] = new Provider($result->getValue("provider_id")); $result->next(); diff --git a/plugins/export/lib/socialexport_linkedin.php b/plugins/export/lib/socialexport_linkedin.php index 4acec0a..6709bb7 100644 --- a/plugins/export/lib/socialexport_linkedin.php +++ b/plugins/export/lib/socialexport_linkedin.php @@ -290,7 +290,7 @@ public function export() { * @return Returns an array on success or FALSE on failure. */ private static function http_parse_headers($r) { - $o = array(); + $o = []; $r = substr($r, stripos($r, "\r\n")); $r = explode("\r\n", $r); foreach ($r as $h) { diff --git a/plugins/export/pages/provider.php b/plugins/export/pages/provider.php index 74220fa..e63fcad 100644 --- a/plugins/export/pages/provider.php +++ b/plugins/export/pages/provider.php @@ -84,7 +84,7 @@ 'linkedin' => rex_i18n::msg('d2u_immo_export_linkedin')]; d2u_addon_backend_helper::form_select('d2u_immo_export_type', 'form[type]', $options, array($provider->type), 1, FALSE, $readonly); - $options_lang = array(); + $options_lang = []; foreach(rex_clang::getAll() as $rex_clang) { $options_lang[$rex_clang->getId()] = $rex_clang->getName(); } @@ -92,7 +92,7 @@ d2u_addon_backend_helper::form_input('d2u_immo_export_company_name', 'form[company_name]', $provider->company_name, TRUE, $readonly, 'text'); d2u_addon_backend_helper::form_input('d2u_immo_export_company_email', 'form[company_email]', $provider->company_email, TRUE, $readonly, 'email'); d2u_addon_backend_helper::form_input('d2u_immo_export_customer_number', 'form[customer_number]', $provider->customer_number, FALSE, $readonly, 'text'); - $options_media = array(); + $options_media = []; $media_sql = rex_sql::factory(); $media_sql->setQuery("SELECT name FROM ". rex::getTablePrefix() ."media_manager_type"); for($i = 0; $i < $media_sql->getRows(); $i++) { diff --git a/plugins/export/vendor/Facebook/base_facebook.php b/plugins/export/vendor/Facebook/base_facebook.php index 557a758..662fd85 100644 --- a/plugins/export/vendor/Facebook/base_facebook.php +++ b/plugins/export/vendor/Facebook/base_facebook.php @@ -676,7 +676,7 @@ protected function getAccessTokenFromCode($code, $redirect_uri = null) { return false; } - $response_params = array(); + $response_params = []; parse_str($access_token_response, $response_params); if (!isset($response_params['access_token'])) { return false; @@ -972,7 +972,7 @@ protected function getCurrentUrl() { if (!empty($parts['query'])) { // drop known fb params $params = explode('&', $parts['query']); - $retained_params = array(); + $retained_params = []; foreach ($params as $param) { if ($this->shouldRetainParam($param)) { $retained_params[] = $param; diff --git a/plugins/window_advertising/lib/advertisement.php b/plugins/window_advertising/lib/advertisement.php index 1ca5000..c8e675d 100644 --- a/plugins/window_advertising/lib/advertisement.php +++ b/plugins/window_advertising/lib/advertisement.php @@ -162,7 +162,7 @@ public static function getAll($clang_id, $only_online = FALSE) { $result = rex_sql::factory(); $result->setQuery($query); - $advertisements = array(); + $advertisements = []; for($i = 0; $i < $result->getRows(); $i++) { $advertisements[] = new Advertisement($result->getValue("ad_id"), $clang_id); $result->next(); @@ -179,7 +179,7 @@ public function getURL($including_domain = FALSE) { if($this->url == "") { $d2u_immo = rex_addon::get("d2u_immo"); - $parameterArray = array(); + $parameterArray = []; $parameterArray['ad_id'] = $this->ad_id; $this->url = rex_getUrl($d2u_immo->getConfig('article_id'), $this->clang_id, $parameterArray, "&"); @@ -270,7 +270,7 @@ private function setPriority() { $this->priority = $result->getRows() + 1; } - $advertisements = array(); + $advertisements = []; for($i = 0; $i < $result->getRows(); $i++) { $advertisements[$result->getValue("priority")] = $result->getValue("ad_id"); $result->next(); diff --git a/plugins/window_advertising/pages/advertisement.php b/plugins/window_advertising/pages/advertisement.php index 30e0af9..40782ec 100644 --- a/plugins/window_advertising/pages/advertisement.php +++ b/plugins/window_advertising/pages/advertisement.php @@ -104,7 +104,7 @@
getId() != rex_config::get("d2u_immo", "default_lang")) { - $options_translations = array(); + $options_translations = []; $options_translations["yes"] = rex_i18n::msg('d2u_helper_translation_needs_update'); $options_translations["no"] = rex_i18n::msg('d2u_helper_translation_is_uptodate'); $options_translations["delete"] = rex_i18n::msg('d2u_helper_translation_delete');