Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c98a9bb

Browse files
[PSR-2] Enclose each structure by braces
Fixed with php-cs-fixer and `braces` fixer
1 parent 5a304c2 commit c98a9bb

538 files changed

Lines changed: 33362 additions & 30537 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Adapter/Adapter_Configuration.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
class Adapter_Configuration implements Core_Business_ConfigurationInterface
2828
{
29-
3029
/**
3130
* Returns constant defined by given $key if exists or check directly into PrestaShop
3231
* Configuration

Adapter/Adapter_EntityMapper.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
* International Registered Trademark & Property of PrestaShop SA
2525
*/
2626

27-
class Adapter_EntityMapper {
28-
27+
class Adapter_EntityMapper
28+
{
2929
/**
3030
* Load ObjectModel
3131
* @param $id
@@ -47,7 +47,6 @@ public function load($id, $id_lang, $entity, $entity_defs, $id_shop, $should_cac
4747

4848
// Get lang informations
4949
if ($id_lang && isset($entity_defs['multilang']) && $entity_defs['multilang']) {
50-
5150
$sql->leftJoin($entity_defs['table'] . '_lang', 'b', 'a.`' . bqSQL($entity_defs['primary']) . '` = b.`' . bqSQL($entity_defs['primary']) . '` AND b.`id_lang` = ' . (int)$id_lang);
5251
if ($id_shop && !empty($entity_defs['multilang_shop'])) {
5352
$sql->where('b.`id_shop` = ' . (int)$id_shop);
@@ -61,19 +60,18 @@ public function load($id, $id_lang, $entity, $entity_defs, $id_shop, $should_cac
6160

6261
if ($object_datas = Db::getInstance()->getRow($sql)) {
6362
if (!$id_lang && isset($entity_defs['multilang']) && $entity_defs['multilang']) {
64-
6563
$sql = 'SELECT *
6664
FROM `' . bqSQL(_DB_PREFIX_ . $entity_defs['table']) . '_lang`
6765
WHERE `' . bqSQL($entity_defs['primary']) . '` = ' . (int)$id
6866
.(($id_shop && $entity->isLangMultishop()) ? ' AND `id_shop` = ' . (int)$id_shop : '');
6967

7068
if ($object_datas_lang = Db::getInstance()->executeS($sql)) {
71-
7269
foreach ($object_datas_lang as $row) {
7370
foreach ($row as $key => $value) {
7471
if ($key != $entity_defs['primary'] && array_key_exists($key, $entity)) {
75-
if (!isset($object_datas[$key]) || !is_array($object_datas[$key]))
72+
if (!isset($object_datas[$key]) || !is_array($object_datas[$key])) {
7673
$object_datas[$key] = array();
74+
}
7775

7876
$object_datas[$key][$row['id_lang']] = $value;
7977
}
@@ -103,5 +101,4 @@ public function load($id, $id_lang, $entity, $entity_defs, $id_shop, $should_cac
103101
}
104102
}
105103
}
106-
107104
}

Adapter/Adapter_ProductPriceCalculator.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ public function getProductPrice(
4444
$use_group_reduction = true,
4545
Context $context = null,
4646
$use_customer_price = true
47-
)
48-
{
47+
) {
4948
return Product::getPriceStatic(
5049
$id_product,
5150
$usetax,

Core/Business/CMS/Core_Business_CMS_CMSRoleRepository.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,4 @@ public function getCMSRolesAssociated()
3939

4040
return $this->hydrateMany($this->db->select($sql));
4141
}
42-
43-
4442
}

Core/Business/Email/Core_Business_Email_EmailLister.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ public function getAvailableMails($dir)
5151

5252
// Remove unwanted .html / .txt / .tpl / .php / . / ..
5353
foreach ($mail_directory as $mail) {
54-
5554
if (strpos($mail->getFilename(), '.') !== false) {
5655
$tmp = explode('.', $mail->getFilename());
5756

Core/Business/Payment/Core_Business_Payment_PaymentOption.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,9 @@ public function setModuleName($moduleName)
177177
*/
178178
public static function convertLegacyOption(array $legacyOption)
179179
{
180-
if (!$legacyOption)
180+
if (!$legacyOption) {
181181
return;
182+
}
182183

183184
if (array_key_exists('cta_text', $legacyOption)) {
184185
$legacyOption = array($legacyOption);
@@ -195,7 +196,6 @@ public static function convertLegacyOption(array $legacyOption)
195196
);
196197

197198
foreach ($legacyOption as $option) {
198-
199199
$option = array_merge($defaults, $option);
200200

201201
$newOption = new Core_Business_Payment_PaymentOption();

Core/Foundation/Database/Core_Foundation_Database_EntityManager.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ class Core_Foundation_Database_EntityManager
3434
public function __construct(
3535
Core_Foundation_Database_DatabaseInterface $db,
3636
Core_Business_ConfigurationInterface $configuration
37-
)
38-
{
37+
) {
3938
$this->db = $db;
4039
$this->configuration = $configuration;
4140
}

Core/Foundation/Database/Core_Foundation_Database_EntityRepository.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@ public function __construct(
3636
Core_Foundation_Database_EntityManager $entityManager,
3737
$tablesPrefix,
3838
Core_Foundation_Database_EntityMetaData $entityMetaData
39-
)
40-
{
39+
) {
4140
$this->entityManager = $entityManager;
4241
$this->db = $this->entityManager->getDatabase();
4342
$this->tablesPrefix = $tablesPrefix;

admin-dev/ajax-tab.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,23 @@
2424
* International Registered Trademark & Property of PrestaShop SA
2525
*/
2626

27-
if (!defined('_PS_ADMIN_DIR_'))
27+
if (!defined('_PS_ADMIN_DIR_')) {
2828
define('_PS_ADMIN_DIR_', getcwd());
29+
}
2930

3031
require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
3132
require(_PS_ADMIN_DIR_.'/functions.php');
3233

3334
// For retrocompatibility with "tab" parameter
34-
if (!isset($_GET['controller']) && isset($_GET['tab']))
35+
if (!isset($_GET['controller']) && isset($_GET['tab'])) {
3536
$_GET['controller'] = strtolower($_GET['tab']);
36-
if (!isset($_POST['controller']) && isset($_POST['tab']))
37+
}
38+
if (!isset($_POST['controller']) && isset($_POST['tab'])) {
3739
$_POST['controller'] = strtolower($_POST['tab']);
38-
if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab']))
40+
}
41+
if (!isset($_REQUEST['controller']) && isset($_REQUEST['tab'])) {
3942
$_REQUEST['controller'] = strtolower($_REQUEST['tab']);
43+
}
4044
// Retrocompatibility with 1.4
4145
$_REQUEST['ajaxMode'] = $_POST['ajaxMode'] = $_GET['ajaxMode'] = $_REQUEST['ajax'] = $_POST['ajax'] = $_GET['ajax'] = 1;
4246

admin-dev/ajax.php

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -24,34 +24,36 @@
2424
* International Registered Trademark & Property of PrestaShop SA
2525
*/
2626

27-
if (!defined('_PS_ADMIN_DIR_'))
27+
if (!defined('_PS_ADMIN_DIR_')) {
2828
define('_PS_ADMIN_DIR_', getcwd());
29+
}
2930
include(_PS_ADMIN_DIR_.'/../config/config.inc.php');
3031

3132
/* Getting cookie or logout */
3233
require_once(_PS_ADMIN_DIR_.'/init.php');
3334

3435
$context = Context::getContext();
3536

36-
if (Tools::isSubmit('ajaxReferrers'))
37+
if (Tools::isSubmit('ajaxReferrers')) {
3738
require(_PS_CONTROLLER_DIR_.'admin/AdminReferrersController.php');
39+
}
3840

39-
if (Tools::getValue('page') == 'prestastore' and @fsockopen('addons.prestashop.com', 80, $errno, $errst, 3))
41+
if (Tools::getValue('page') == 'prestastore' and @fsockopen('addons.prestashop.com', 80, $errno, $errst, 3)) {
4042
readfile('http://addons.prestashop.com/adminmodules.php?lang='.$context->language->iso_code);
43+
}
4144

42-
if (Tools::isSubmit('getAvailableFields') and Tools::isSubmit('entity'))
43-
{
45+
if (Tools::isSubmit('getAvailableFields') and Tools::isSubmit('entity')) {
4446
$jsonArray = array();
4547
$import = new AdminImportController();
4648

4749
$fields = $import->getAvailableFields(true);
48-
foreach ($fields as $field)
50+
foreach ($fields as $field) {
4951
$jsonArray[] = '{"field":"'.addslashes($field).'"}';
52+
}
5053
die('['.implode(',', $jsonArray).']');
5154
}
5255

53-
if (Tools::isSubmit('ajaxProductPackItems'))
54-
{
56+
if (Tools::isSubmit('ajaxProductPackItems')) {
5557
$jsonArray = array();
5658
$products = Db::getInstance()->executeS('
5759
SELECT p.`id_product`, pl.`name`
@@ -62,31 +64,28 @@
6264
AND NOT EXISTS (SELECT 1 FROM `'._DB_PREFIX_.'pack` WHERE `id_product_pack` = p.`id_product`)
6365
AND p.`id_product` != '.(int)(Tools::getValue('id_product')));
6466

65-
foreach ($products as $packItem)
67+
foreach ($products as $packItem) {
6668
$jsonArray[] = '{"value": "'.(int)($packItem['id_product']).'-'.addslashes($packItem['name']).'", "text":"'.(int)($packItem['id_product']).' - '.addslashes($packItem['name']).'"}';
69+
}
6770
die('['.implode(',', $jsonArray).']');
6871
}
6972

70-
if (Tools::isSubmit('getChildrenCategories') && Tools::isSubmit('id_category_parent'))
71-
{
73+
if (Tools::isSubmit('getChildrenCategories') && Tools::isSubmit('id_category_parent')) {
7274
$children_categories = Category::getChildrenWithNbSelectedSubCat(Tools::getValue('id_category_parent'), Tools::getValue('selectedCat'), Context::getContext()->language->id, null, Tools::getValue('use_shop_context'));
7375
die(Tools::jsonEncode($children_categories));
7476
}
7577

76-
if (Tools::isSubmit('getNotifications'))
77-
{
78+
if (Tools::isSubmit('getNotifications')) {
7879
$notification = new Notification;
7980
die(Tools::jsonEncode($notification->getLastElements()));
8081
}
8182

82-
if (Tools::isSubmit('updateElementEmployee') && Tools::getValue('updateElementEmployeeType'))
83-
{
83+
if (Tools::isSubmit('updateElementEmployee') && Tools::getValue('updateElementEmployeeType')) {
8484
$notification = new Notification;
8585
die($notification->updateEmployeeLastElement(Tools::getValue('updateElementEmployeeType')));
8686
}
8787

88-
if (Tools::isSubmit('searchCategory'))
89-
{
88+
if (Tools::isSubmit('searchCategory')) {
9089
$q = Tools::getValue('q');
9190
$limit = Tools::getValue('limit');
9291
$results = Db::getInstance()->executeS(
@@ -98,27 +97,29 @@
9897
GROUP BY c.id_category
9998
ORDER BY c.`position`
10099
LIMIT '.(int)$limit);
101-
if ($results)
102-
foreach ($results as $result)
103-
echo trim($result['name']).'|'.(int)$result['id_category']."\n";
100+
if ($results) {
101+
foreach ($results as $result) {
102+
echo trim($result['name']).'|'.(int)$result['id_category']."\n";
103+
}
104+
}
104105
}
105106

106-
if (Tools::isSubmit('getParentCategoriesId') && $id_category = Tools::getValue('id_category'))
107-
{
107+
if (Tools::isSubmit('getParentCategoriesId') && $id_category = Tools::getValue('id_category')) {
108108
$category = new Category((int)$id_category);
109109
$results = Db::getInstance()->executeS('SELECT `id_category` FROM `'._DB_PREFIX_.'category` c WHERE c.`nleft` < '.(int)$category->nleft.' AND c.`nright` > '.(int)$category->nright.'');
110110
$output = array();
111-
foreach ($results as $result)
111+
foreach ($results as $result) {
112112
$output[] = $result;
113+
}
113114

114115
die(Tools::jsonEncode($output));
115116
}
116117

117-
if (Tools::isSubmit('getZones'))
118-
{
118+
if (Tools::isSubmit('getZones')) {
119119
$html = '<select id="zone_to_affect" name="zone_to_affect">';
120-
foreach (Zone::getZones() as $z)
120+
foreach (Zone::getZones() as $z) {
121121
$html .= '<option value="'.$z['id_zone'].'">'.$z['name'].'</option>';
122+
}
122123
$html .= '</select>';
123124
$array = array('hasError' => false, 'errors' => '', 'data' => $html);
124125
die(Tools::jsonEncode($array));

0 commit comments

Comments
 (0)