Skip to content

Commit

Permalink
More comma up in some cases
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasReker committed Dec 12, 2018
1 parent b0a5cfc commit 8c203b3
Show file tree
Hide file tree
Showing 180 changed files with 343 additions and 686 deletions.
3 changes: 1 addition & 2 deletions classes/AttributeGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,8 +379,7 @@ public function updatePosition($direction, $position)
) && Db::getInstance()->execute('
UPDATE `' . _DB_PREFIX_ . 'attribute_group`
SET `position` = ' . (int) $position . '
WHERE `id_attribute_group`=' . (int) $movedGroupAttribute['id_attribute_group'])
;
WHERE `id_attribute_group`=' . (int) $movedGroupAttribute['id_attribute_group']);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions classes/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,7 @@ public function getTranslatorFromLocale($locale)
->files()
->name('*.' . $locale . '.xlf')
->notName($notName)
->in($this->getTranslationResourcesDirectories())
;
->in($this->getTranslationResourcesDirectories());

foreach ($finder as $file) {
list($domain, $locale, $format) = explode('.', $file->getBasename(), 3);
Expand Down
3 changes: 1 addition & 2 deletions classes/Cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,8 +236,7 @@ public function isLoggedBack()
return $this->id_employee
&& Validate::isUnsignedId($this->id_employee)
&& Employee::checkPassword((int) $this->id_employee, $this->passwd)
&& (!isset($this->_content['remote_addr']) || $this->_content['remote_addr'] == ip2long(Tools::getRemoteAddr()) || !Configuration::get('PS_COOKIE_CHECKIP'))
;
&& (!isset($this->_content['remote_addr']) || $this->_content['remote_addr'] == ip2long(Tools::getRemoteAddr()) || !Configuration::get('PS_COOKIE_CHECKIP'));
}

/**
Expand Down
3 changes: 1 addition & 2 deletions classes/Employee.php
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,7 @@ public function isLastAdmin()
{
return $this->isSuperAdmin()
&& Employee::countProfile($this->id_profile, true) == 1
&& $this->active
;
&& $this->active;
}

/**
Expand Down
6 changes: 2 additions & 4 deletions classes/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -2132,8 +2132,7 @@ public function deleteCustomization()
'DELETE `' . _DB_PREFIX_ . 'customization_field_lang` FROM `' . _DB_PREFIX_ . 'customization_field_lang` LEFT JOIN `' . _DB_PREFIX_ . 'customization_field`
ON (' . _DB_PREFIX_ . 'customization_field.id_customization_field = ' . _DB_PREFIX_ . 'customization_field_lang.id_customization_field)
WHERE ' . _DB_PREFIX_ . 'customization_field.id_customization_field IS NULL'
)
;
);
}

/**
Expand Down Expand Up @@ -2179,8 +2178,7 @@ public function deleteSearchIndexes()
'DELETE sw FROM `' . _DB_PREFIX_ . 'search_word` sw
LEFT JOIN `' . _DB_PREFIX_ . 'search_index` si ON (sw.id_word=si.id_word)
WHERE si.id_word IS NULL;'
)
;
);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions classes/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@ public function delete()
if (parent::delete()) {
return
Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'access` WHERE `id_profile` = ' . (int) $this->id)
&& Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'module_access` WHERE `id_profile` = ' . (int) $this->id)
;
&& Db::getInstance()->execute('DELETE FROM `' . _DB_PREFIX_ . 'module_access` WHERE `id_profile` = ' . (int) $this->id);
}

return false;
Expand Down
3 changes: 1 addition & 2 deletions classes/Tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,7 @@ public static function isSubmit($submit)
{
return
isset($_POST[$submit]) || isset($_POST[$submit . '_x']) || isset($_POST[$submit . '_y'])
|| isset($_GET[$submit]) || isset($_GET[$submit . '_x']) || isset($_GET[$submit . '_y'])
;
|| isset($_GET[$submit]) || isset($_GET[$submit . '_x']) || isset($_GET[$submit . '_y']);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions classes/checkout/CheckoutAddressesStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ public function handleRequest(array $requestParams = array())
if (!$this->step_is_complete) {
$this->step_is_complete = isset($requestParams['confirm-addresses']) &&
$this->getCheckoutSession()->getIdAddressInvoice() &&
$this->getCheckoutSession()->getIdAddressDelivery()
;
$this->getCheckoutSession()->getIdAddressDelivery();
}

$addresses_count = $this->getCheckoutSession()->getCustomerAddressesCount();
Expand Down
3 changes: 1 addition & 2 deletions classes/checkout/CheckoutDeliveryStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ public function handleRequest(array $requestParams = array())
// - the module associated to the delivery option confirms
$deliveryOptions = $this->getCheckoutSession()->getDeliveryOptions();
$this->step_is_complete =
!empty($deliveryOptions) && $this->getCheckoutSession()->getSelectedDeliveryOption() && $this->isModuleComplete($requestParams)
;
!empty($deliveryOptions) && $this->getCheckoutSession()->getSelectedDeliveryOption() && $this->isModuleComplete($requestParams);
}

$this->setTitle($this->getTranslator()->trans('Shipping Method', array(), 'Shop.Theme.Checkout'));
Expand Down
6 changes: 2 additions & 4 deletions classes/checkout/CheckoutPersonalInformationStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ public function handleRequest(array $requestParameters = array())
->getCheckoutProcess()
->getCheckoutSession()
->getCustomer()
)
;
);

if (isset($requestParameters['submitCreate'])) {
$this->registerForm->fillWith($requestParameters);
Expand All @@ -83,8 +82,7 @@ public function handleRequest(array $requestParameters = array())
$this->logged_in = $this
->getCheckoutProcess()
->getCheckoutSession()
->customerHasLoggedIn()
;
->customerHasLoggedIn();

if ($this->logged_in && !$this->getCheckoutSession()->getCustomer()->is_guest) {
$this->step_is_complete = true;
Expand Down
3 changes: 1 addition & 2 deletions classes/checkout/CheckoutProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,7 @@ public function restorePersistedData(array $data)
$step
->setReachable($stepData['step_is_reachable'])
->setComplete($stepData['step_is_complete'])
->restorePersistedData($stepData)
;
->restorePersistedData($stepData);
}
}

Expand Down
3 changes: 1 addition & 2 deletions classes/checkout/ConditionsToApproveFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ private function getDefaultTermsAndConditions()
$this->translator->trans('I agree to the [terms of service] and will adhere to them unconditionally.', array(), 'Shop.Theme.Checkout'),
$link
)
->setIdentifier('terms-and-conditions')
;
->setIdentifier('terms-and-conditions');

return $termsAndConditions;
}
Expand Down
3 changes: 1 addition & 2 deletions classes/controller/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -587,8 +587,7 @@ public function isXmlHttpRequest()
{
return
!empty($_SERVER['HTTP_X_REQUESTED_WITH'])
&& strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'
;
&& strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest';
}

public function getLayout()
Expand Down
3 changes: 1 addition & 2 deletions classes/controller/FrontController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1858,8 +1858,7 @@ protected function makeCustomerFormatter()
$formatter
->setAskForPartnerOptin(Configuration::get('PS_CUSTOMER_OPTIN'))
->setAskForBirthdate(Configuration::get('PS_CUSTOMER_BIRTHDATE'))
->setPartnerOptinRequired($customer->isFieldRequired('optin'))
;
->setPartnerOptinRequired($customer->isFieldRequired('optin'));

return $formatter;
}
Expand Down
12 changes: 4 additions & 8 deletions classes/controller/ProductListingFrontController.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ abstract class ProductListingFrontControllerCore extends ProductPresentingFrontC
private function prepareProductForTemplate(array $rawProduct)
{
$product = (new ProductAssembler($this->context))
->assembleProduct($rawProduct)
;
->assembleProduct($rawProduct);

$presenter = $this->getProductPresenter();
$settings = $this->getProductPresentationSettings();
Expand Down Expand Up @@ -94,8 +93,7 @@ protected function getProductSearchContext()
$this->context->customer ?
$this->context->customer->id :
null
)
;
);
}

/**
Expand Down Expand Up @@ -279,8 +277,7 @@ protected function getProductSearchVariables()
// we need to set a few parameters from back-end preferences
$query
->setResultsPerPage($resultsPerPage)
->setPage(max((int) Tools::getValue('page'), 1))
;
->setPage(max((int) Tools::getValue('page'), 1));

// set the sort order if provided in the URL
if (($encodedSortOrder = Tools::getValue('order'))) {
Expand Down Expand Up @@ -409,8 +406,7 @@ protected function getTemplateVarPagination(
->setPage($query->getPage())
->setPagesCount(
ceil($result->getTotalProductsCount() / $query->getResultsPerPage())
)
;
);

$totalItems = $result->getTotalProductsCount();
$itemsShownFrom = ($query->getResultsPerPage() * ($query->getPage() - 1)) + 1;
Expand Down
27 changes: 9 additions & 18 deletions classes/form/CustomerFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ public function getFormat()

$format['id_customer'] = (new FormField())
->setName('id_customer')
->setType('hidden')
;
->setType('hidden');

$genders = Gender::getGenders($this->language->id);
if ($genders->count() > 0) {
Expand All @@ -107,8 +106,7 @@ public function getFormat()
[],
'Shop.Forms.Labels'
)
)
;
);
foreach ($genders as $gender) {
$genderField->addAvailableValue($gender->id, $gender->name);
}
Expand All @@ -124,8 +122,7 @@ public function getFormat()
'Shop.Forms.Labels'
)
)
->setRequired(true)
;
->setRequired(true);

$format['lastname'] = (new FormField())
->setName('lastname')
Expand All @@ -136,8 +133,7 @@ public function getFormat()
'Shop.Forms.Labels'
)
)
->setRequired(true)
;
->setRequired(true);

if (Configuration::get('PS_B2B_ENABLE')) {
$format['company'] = (new FormField())
Expand Down Expand Up @@ -169,8 +165,7 @@ public function getFormat()
'Shop.Forms.Labels'
)
)
->setRequired(true)
;
->setRequired(true);

if ($this->ask_for_password) {
$format['password'] = (new FormField())
Expand All @@ -183,8 +178,7 @@ public function getFormat()
'Shop.Forms.Labels'
)
)
->setRequired($this->password_is_required)
;
->setRequired($this->password_is_required);
}

if ($this->ask_for_new_password) {
Expand All @@ -197,8 +191,7 @@ public function getFormat()
[],
'Shop.Forms.Labels'
)
)
;
);
}

if ($this->ask_for_birthdate) {
Expand All @@ -216,8 +209,7 @@ public function getFormat()
->addAvailableValue(
'comment',
$this->translator->trans('(E.g.: %date_format%)', array('%date_format%' => Tools::formatDateStr('31 May 1970')), 'Shop.Forms.Help')
)
;
);
}

if ($this->ask_for_partner_optin) {
Expand All @@ -231,8 +223,7 @@ public function getFormat()
'Shop.Theme.Customeraccount'
)
)
->setRequired($this->partner_optin_is_required)
;
->setRequired($this->partner_optin_is_required);
}

// ToDo, replace the hook exec with HookFinder when the associated PR will be merged
Expand Down
3 changes: 1 addition & 2 deletions controllers/front/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ public function initContent()
$register_form = $this
->makeCustomerForm()
->setGuestAllowed(false)
->fillWith(Tools::getAllValues())
;
->fillWith(Tools::getAllValues());

if (Tools::isSubmit('submitCreate')) {
$hookResult = array_reduce(
Expand Down
3 changes: 1 addition & 2 deletions controllers/front/IdentityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ public function initContent()
->setAskForNewPassword(true)
->setAskForPassword($this->passwordRequired)
->setPasswordRequired($this->passwordRequired)
->setPartnerOptinRequired($customer->isFieldRequired('optin'))
;
->setPartnerOptinRequired($customer->isFieldRequired('optin'));

if (Tools::isSubmit('submitCreate')) {
$customer_form->fillWith(Tools::getAllValues());
Expand Down
3 changes: 1 addition & 2 deletions controllers/front/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,7 @@ protected function bootstrap()
$this->context,
$translator
)
))
;
));
}

/**
Expand Down
3 changes: 1 addition & 2 deletions controllers/front/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1305,8 +1305,7 @@ protected function isValidCombination($productAttributeId, $productId)

return
Validate::isLoadedObject($combination)
&& $combination->id_product == $productId
;
&& $combination->id_product == $productId;
}

return false;
Expand Down
3 changes: 1 addition & 2 deletions controllers/front/listing/BestSalesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ protected function getProductSearchQuery()
$query = new ProductSearchQuery();
$query
->setQueryType('best-sales')
->setSortOrder(new SortOrder('product', 'name', 'asc'))
;
->setSortOrder(new SortOrder('product', 'name', 'asc'));

return $query;
}
Expand Down
3 changes: 1 addition & 2 deletions controllers/front/listing/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ protected function getProductSearchQuery()
$query = new ProductSearchQuery();
$query
->setIdCategory($this->category->id)
->setSortOrder(new SortOrder('product', Tools::getProductsOrder('by'), Tools::getProductsOrder('way')))
;
->setSortOrder(new SortOrder('product', Tools::getProductsOrder('by'), Tools::getProductsOrder('way')));

return $query;
}
Expand Down
3 changes: 1 addition & 2 deletions controllers/front/listing/NewProductsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ protected function getProductSearchQuery()
$query = new ProductSearchQuery();
$query
->setQueryType('new-products')
->setSortOrder(new SortOrder('product', 'date_add', 'desc'))
;
->setSortOrder(new SortOrder('product', 'date_add', 'desc'));

return $query;
}
Expand Down
3 changes: 1 addition & 2 deletions controllers/front/listing/PricesDropController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ protected function getProductSearchQuery()
$query = new ProductSearchQuery();
$query
->setQueryType('prices-drop')
->setSortOrder(new SortOrder('product', 'name', 'asc'))
;
->setSortOrder(new SortOrder('product', 'name', 'asc'));

return $query;
}
Expand Down
3 changes: 1 addition & 2 deletions controllers/front/listing/SupplierController.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ protected function getProductSearchQuery()
$query = new ProductSearchQuery();
$query
->setIdSupplier($this->supplier->id)
->setSortOrder(new SortOrder('product', 'position', 'asc'))
;
->setSortOrder(new SortOrder('product', 'position', 'asc'));

return $query;
}
Expand Down
6 changes: 2 additions & 4 deletions install-dev/upgrade/php/p1540_add_missing_columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,14 @@ function p1540_add_missing_columns()
}
}

$key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "product_sqlstock"');
;
$key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "product_sqlstock"');;
if (is_array($key_exists) && count($key_exists)) {
if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'stock_available` DROP INDEX `product_sqlstock`')) {
$errors[] = Db::getInstance()->getMsgError();
}
}

$key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "id_product_2"');
;
$key_exists = Db::getInstance()->executeS('SHOW INDEX FROM `'._DB_PREFIX_.'stock_available` WHERE KEY_NAME = "id_product_2"');;
if (is_array($key_exists) && count($key_exists)) {
if (!Db::getInstance()->execute('ALTER TABLE `'._DB_PREFIX_.'stock_available` DROP INDEX `id_product_2`')) {
$errors[] = Db::getInstance()->getMsgError();
Expand Down
Loading

0 comments on commit 8c203b3

Please sign in to comment.