Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] PHP Code Standart fix [WIP] #129

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions controllers/admin/AdminDPDAjaxOnBoardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ private function nextOnBoardStep($nextStep)
return;
}

if (!Configuration::updateValue(Config::ON_BOARD_STEP, $nextStep) ) {
if (!Configuration::updateValue(Config::ON_BOARD_STEP, $nextStep)) {
$this->returnResponse(
array(
'status' => false,
Expand Down Expand Up @@ -104,4 +104,4 @@ private function returnResponse(array $response)
$response = json_encode($response);
$this->ajaxDie($response);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public function __construct()
$this->initList();
$this->initForm();
$this->addressTemplateService = $this->module->getModuleContainer()->get('invertus.dpdbaltics.service.address.address_template_service');

}

public function renderForm()
Expand Down
2 changes: 1 addition & 1 deletion controllers/admin/AdminDPDBalticsAjaxController.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function ajaxProcessImportZones()

$selectedCountry = Tools::getValue('country');
switch ($selectedCountry) {
case 'latvia' :
case 'latvia':
$this->ajaxDie(json_encode($importOnLoginService->importLatviaZones()));
break;
case 'lithuania':
Expand Down
3 changes: 1 addition & 2 deletions controllers/admin/AdminDPDBalticsAjaxShipmentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ public function printMultipleLabelsFromList($orderIds)
$shipmentService = $this->module->getModuleContainer('invertus.dpdbaltics.service.shipment_service');

return $shipmentService->formatMultipleLabelShipmentPrintResponse($orderIds);

}


Expand Down Expand Up @@ -294,7 +293,7 @@ private function printLabel($shipmentId, $labelFormat, $labelPosition)
return $labelPrintingService->setLabelOptions($shipmentId, $labelFormat, $labelPosition);
}

private function printReturnLabel($shipmentId)
private function printReturnLabel($shipmentId)
{
/** @var LabelApiService $labelApiService */
$labelApiService = $this->module->getModuleContainer('invertus.dpdbaltics.service.api.label_api_service');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ private function initForm()
if (Tools::getIsset('submitAdddpd_courier_request')) {
$phoneData['sender_phone_code'] = Tools::getValue('sender_phone_code');
$phoneData['sender_phone'] = Tools::getValue('sender_phone');

} elseif (Tools::getIsset('id_dpd_courier_request')) {

/** @var CourierRequestRepository $courierRequestRepository */
Expand Down
8 changes: 4 additions & 4 deletions controllers/admin/AdminDPDBalticsImportExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,10 @@ private function postProcessImport($importOption, $deleteOnImport, $importFile =
);

$this->confirmations[] = sprintf(
$this->l('Successfully imported %s with %d row(s)'),
$name,
$importable->getImportedRowsCount()
) . $break;
$this->l('Successfully imported %s with %d row(s)'),
$name,
$importable->getImportedRowsCount()
) . $break;

$this->confirmations = array_merge($this->confirmations, $importable->getConfirmations());
}
Expand Down
3 changes: 2 additions & 1 deletion controllers/admin/AdminDPDBalticsOrderReturnController.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ public function displayViewOrderLink($token, $idDpdShipment)
[
'vieworder' => '1',
'id_order' => (int)$shipment->id_order
]);
]
);

$params = [
'href' => $orderUrl,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ public function renderForm()
$this->module->l('Friday'),
];

$this->context->smarty->assign([
$this->context->smarty->assign(
[
'daysList' => $deliveryDays,
'productId' => Tools::getValue('id_dpd_product')
]
Expand Down
1 change: 0 additions & 1 deletion controllers/admin/AdminDPDBalticsSettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,6 @@ public function postProcess()
try {
$regenerationHandler->handle();
$this->confirmations[] = $this->l('Prestashop carriers regenerated successfully');

} catch (DpdCarrierException $e) {
$logger->error($e->getMessage());
$this->errors[] = $this->l('Could not regenerate carriers, please refer to module logs for more information');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ protected function initOptions()
$this->module->display($this->module->getPathUri(), 'views/templates/admin/redirect/redirect-closing.tpl')
);
}

}

/** @var LabelPositionService $labelPositionService */
Expand Down
3 changes: 1 addition & 2 deletions controllers/admin/AdminDPDBalticsZonesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ private function updateOnBoardAndAddTemplateToResponseOnZoneSave($response)
$onBoardStepActionService = $this->module->getModuleContainer('invertus.dpdbaltics.on_board.service.on_board_step_action_service');
$onBoardStepActionService->nextStep(Config::STEP_MANUAL_ZONES_6);

if(Tools::getValue('buttonName') === Config::ZONES_SAVE_AND_STAY_BUTTON) {
if (Tools::getValue('buttonName') === Config::ZONES_SAVE_AND_STAY_BUTTON) {
/** @var OnBoardService $onBoardService */
$onBoardService = $this->module->getModuleContainer('invertus.dpdbaltics.on_board.service.on_board_service');
$response['onBoardStepTemplate'] = $onBoardService->makeStepActionWithTemplateReturn(true);
Expand All @@ -387,5 +387,4 @@ private function updateOnBoardAndAddTemplateToResponseOnZoneSave($response)

return $response;
}

}
4 changes: 2 additions & 2 deletions controllers/front/Ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ public function init()

public function postProcess()
{

$action = Tools::getValue('action');
$currentCountryProvider = $this->module->getModuleContainer('invertus.dpdbaltics.provider.current_country_provider');
$countryCode = $currentCountryProvider->getCurrentCountryIsoCode();
$city = Tools::getValue('city_name');
$carrierId = (int)Tools::getValue('id_carrier');
$carrierId = (int) Tools::getValue('id_carrier');

switch ($action) {
case 'searchPudoServices':
$cartId = Context::getContext()->cart->id;
Expand Down
1 change: 0 additions & 1 deletion controllers/front/ShipmentReturn.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ public function postProcess()

private function printReturnLabel($orderId, $returnTemplateId)
{

$response['status'] = false;

/** @var ShipmentRepository $shipmentRepo */
Expand Down
4 changes: 3 additions & 1 deletion src/Config/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ public static function getDefaultServiceWeights($countryIso, $productReference)
default:
return false;
}
// no break
case self::LITHUANIA_ISO_CODE:
case self::LATVIA_ISO_CODE:
switch ($productReference) {
Expand All @@ -504,6 +505,7 @@ public static function getDefaultServiceWeights($countryIso, $productReference)
default:
return false;
}
// no break
case self::PORTUGAL_ISO_CODE:
switch ($productReference) {
case self::PRODUCT_TYPE_PUDO:
Expand All @@ -516,6 +518,7 @@ public static function getDefaultServiceWeights($countryIso, $productReference)
default:
return false;
}
// no break
default:
switch ($productReference) {
case self::PRODUCT_TYPE_PUDO:
Expand Down Expand Up @@ -629,7 +632,6 @@ public static function getMinimalTimeIntervalForCountry($countryIso)
public static function isPrestashopVersionAbove177()
{
if (_PS_VERSION_ >= self::PS_VERSION_1_7_7) {

return true;
}

Expand Down
6 changes: 3 additions & 3 deletions src/Controller/OrderLabelController.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private function printLabel($shipmentId)
$exceptionService->getAPIErrorMessages()
));
} catch (\Exception $e) {
return $this->redirectWithError('admin_orders_index',$this->module->l('Failed to print label: ') . $e->getMessage());
return $this->redirectWithError('admin_orders_index', $this->module->l('Failed to print label: ') . $e->getMessage());
}

if (!empty($parcelPrintResponse->getErrLog())) {
Expand All @@ -179,11 +179,11 @@ private function printMultipleLabels($shipmentIds)
$exceptionService->getAPIErrorMessages()
));
} catch (\Exception $e) {
return $this->redirectWithError('admin_orders_index',$this->module->l('Failed to print label: ') . $e->getMessage());
return $this->redirectWithError('admin_orders_index', $this->module->l('Failed to print label: ') . $e->getMessage());
}

if (!empty($parcelPrintResponse->getErrLog())) {
return $this->redirectWithError('admin_orders_index',$parcelPrintResponse->getErrLog());
return $this->redirectWithError('admin_orders_index', $parcelPrintResponse->getErrLog());
}

return null;
Expand Down
1 change: 0 additions & 1 deletion src/Core/Shared/Repository/LanguageRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

namespace Invertus\dpdBaltics\Core\Shared\Repository;


use Invertus\dpdBaltics\Infrastructure\Repository\CollectionRepository;

class LanguageRepository extends CollectionRepository implements LanguageRepositoryInterface
Expand Down
1 change: 0 additions & 1 deletion src/DTO/CourierRequestData.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,5 +401,4 @@ public function setNonStandard($nonStandard)
{
$this->nonStandard = $nonStandard;
}

}
1 change: 0 additions & 1 deletion src/Entity/DPDCourierRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

class DPDCourierRequest extends ObjectModel
{

public $sender_name;

public $sender_phone_code;
Expand Down
Loading
Loading