fix cs
This commit is contained in:
@@ -24,14 +24,12 @@
|
||||
namespace Thelia\Controller\Admin;
|
||||
use Thelia\Core\Event\Address\AddressCreateOrUpdateEvent;
|
||||
use Thelia\Core\Event\Address\AddressEvent;
|
||||
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Form\AddressCreateForm;
|
||||
use Thelia\Form\AddressUpdateForm;
|
||||
use Thelia\Model\AddressQuery;
|
||||
use Thelia\Model\CustomerQuery;
|
||||
|
||||
|
||||
/**
|
||||
* Class AddressController
|
||||
* @package Thelia\Controller\Admin
|
||||
@@ -78,7 +76,7 @@ class AddressController extends AbstractCrudController
|
||||
$this->dispatch(TheliaEvents::ADDRESS_DEFAULT, $addressEvent);
|
||||
|
||||
$this->adminLogAppend(sprintf("address %d for customer %d removal", $address_id, $address->getCustomerId()));
|
||||
} catch(\Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
\Thelia\Log\Tlog::getInstance()->error(sprintf("error during address removal with message %s", $e->getMessage()));
|
||||
}
|
||||
|
||||
@@ -176,8 +174,6 @@ class AddressController extends AbstractCrudController
|
||||
$formData["is_default"]
|
||||
);
|
||||
|
||||
|
||||
|
||||
return $event;
|
||||
|
||||
}
|
||||
@@ -279,8 +275,8 @@ class AddressController extends AbstractCrudController
|
||||
/**
|
||||
* Put in this method post object delete processing if required.
|
||||
*
|
||||
* @param \Thelia\Core\Event\AddressEvent $deleteEvent the delete event
|
||||
* @return Response a response, or null to continue normal processing
|
||||
* @param \Thelia\Core\Event\AddressEvent $deleteEvent the delete event
|
||||
* @return Response a response, or null to continue normal processing
|
||||
*/
|
||||
protected function performAdditionalDeleteAction($deleteEvent)
|
||||
{
|
||||
@@ -291,8 +287,8 @@ class AddressController extends AbstractCrudController
|
||||
/**
|
||||
* Put in this method post object creation processing if required.
|
||||
*
|
||||
* @param AddressCreateOrUpdateEvent $createEvent the create event
|
||||
* @return Response a response, or null to continue normal processing
|
||||
* @param AddressCreateOrUpdateEvent $createEvent the create event
|
||||
* @return Response a response, or null to continue normal processing
|
||||
*/
|
||||
protected function performAdditionalCreateAction($createEvent)
|
||||
{
|
||||
@@ -303,4 +299,4 @@ class AddressController extends AbstractCrudController
|
||||
{
|
||||
$this->redirectToEditionTemplate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -378,8 +378,8 @@ class BaseAdminController extends BaseController
|
||||
* Render the given template, and returns the result as a string.
|
||||
*
|
||||
* @param $templateName the complete template name, with extension
|
||||
* @param array $args the template arguments
|
||||
* @param null $templateDir
|
||||
* @param array $args the template arguments
|
||||
* @param null $templateDir
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*/
|
||||
|
||||
@@ -243,7 +243,7 @@ class CountryController extends AbstractCrudController
|
||||
try {
|
||||
$this->dispatch(TheliaEvents::COUNTRY_TOGGLE_DEFAULT, $toogleDefaultEvent);
|
||||
|
||||
if($toogleDefaultEvent->hasCountry()) {
|
||||
if ($toogleDefaultEvent->hasCountry()) {
|
||||
return $this->nullResponse();
|
||||
}
|
||||
} catch (\Exception $ex) {
|
||||
|
||||
@@ -25,14 +25,11 @@ namespace Thelia\Controller\Admin;
|
||||
|
||||
use Propel\Runtime\Exception\PropelException;
|
||||
use Symfony\Component\Form\Form;
|
||||
use Thelia\Core\Event\Address\AddressEvent;
|
||||
use Thelia\Core\Event\Customer\CustomerAddressEvent;
|
||||
use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent;
|
||||
use Thelia\Core\Event\Customer\CustomerEvent;
|
||||
use Thelia\Core\Event\TheliaEvents;
|
||||
use Thelia\Form\CustomerModification;
|
||||
use Thelia\Form\Exception\FormValidationException;
|
||||
use Thelia\Model\AddressQuery;
|
||||
use Thelia\Model\CustomerQuery;
|
||||
use Thelia\Core\Translation\Translator;
|
||||
|
||||
@@ -57,8 +54,6 @@ class CustomerController extends BaseAdminController
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* update customer action
|
||||
*
|
||||
|
||||
@@ -59,7 +59,7 @@ class ModuleController extends BaseAdminController
|
||||
$event = new ModuleToggleActivationEvent($module_id);
|
||||
$this->dispatch(TheliaEvents::MODULE_TOGGLE_ACTIVATION, $event);
|
||||
|
||||
if(null === $event->getModule()) {
|
||||
if (null === $event->getModule()) {
|
||||
throw new \LogicException(
|
||||
$this->getTranslator()->trans("No %obj was updated.", array('%obj' => 'Module')));
|
||||
}
|
||||
@@ -67,9 +67,8 @@ class ModuleController extends BaseAdminController
|
||||
$message = $e->getMessage();
|
||||
}
|
||||
|
||||
|
||||
if($this->getRequest()->isXmlHttpRequest()) {
|
||||
if($message) {
|
||||
if ($this->getRequest()->isXmlHttpRequest()) {
|
||||
if ($message) {
|
||||
$response = $this->jsonResponse(json_encode(array(
|
||||
"error" => $message
|
||||
)), 500);
|
||||
|
||||
@@ -211,7 +211,6 @@ class OrderController extends BaseAdminController
|
||||
{
|
||||
if (null !== $response = $this->checkAuth("admin.order.update")) return $response;
|
||||
|
||||
|
||||
$html = $this->renderRaw(
|
||||
$fileName,
|
||||
array(
|
||||
@@ -227,7 +226,7 @@ class OrderController extends BaseAdminController
|
||||
|
||||
$this->dispatch(TheliaEvents::GENERATE_PDF, $pdfEvent);
|
||||
|
||||
if($pdfEvent->hasPdf()) {
|
||||
if ($pdfEvent->hasPdf()) {
|
||||
return Response::create($pdfEvent->getPdf(), 200,
|
||||
array(
|
||||
'Content-type' => "application/pdf",
|
||||
|
||||
@@ -140,5 +140,4 @@ class ShippingZoneController extends BaseAdminController
|
||||
return $this->getRequest()->get('shipping_zone_id', 0);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -199,8 +199,8 @@ class TaxRuleController extends AbstractCrudController
|
||||
/**
|
||||
* Put in this method post object creation processing if required.
|
||||
*
|
||||
* @param TaxRuleEvent $createEvent the create event
|
||||
* @return Response a response, or null to continue normal processing
|
||||
* @param TaxRuleEvent $createEvent the create event
|
||||
* @return Response a response, or null to continue normal processing
|
||||
*/
|
||||
protected function performAdditionalCreateAction($createEvent)
|
||||
{
|
||||
@@ -284,4 +284,4 @@ class TaxRuleController extends AbstractCrudController
|
||||
// At this point, the form has errors, and should be redisplayed.
|
||||
return $this->renderEditionTemplate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user