diff --git a/core/lib/Thelia/Action/Area.php b/core/lib/Thelia/Action/Area.php index d9173ae93..92eb75634 100644 --- a/core/lib/Thelia/Action/Area.php +++ b/core/lib/Thelia/Action/Area.php @@ -34,7 +34,6 @@ use Thelia\Model\CountryQuery; use Thelia\Action\BaseAction; use Thelia\Model\Area as AreaModel; - /** * Class Area * @package Thelia\Action @@ -97,7 +96,6 @@ class Area extends BaseAction implements EventSubscriberInterface $event->setArea($area); } - /** * Returns an array of event names this subscriber wants to listen to. * @@ -128,4 +126,4 @@ class Area extends BaseAction implements EventSubscriberInterface TheliaEvents::AREA_CREATE => array('create', 128) ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Action/Cache.php b/core/lib/Thelia/Action/Cache.php index 6d2cf1a16..4407c3e92 100644 --- a/core/lib/Thelia/Action/Cache.php +++ b/core/lib/Thelia/Action/Cache.php @@ -27,7 +27,6 @@ use Symfony\Component\Filesystem\Filesystem; use Thelia\Core\Event\Cache\CacheEvent; use Thelia\Core\Event\TheliaEvents; - /** * Class Cache * @package Thelia\Action @@ -42,7 +41,6 @@ class Cache extends BaseAction implements EventSubscriberInterface $directoryBrowser = new \DirectoryIterator($dir); - $fs = new Filesystem(); $fs->remove($dir); @@ -74,4 +72,4 @@ class Cache extends BaseAction implements EventSubscriberInterface TheliaEvents::CACHE_CLEAR => array('cacheClear', 128) ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Action/Content.php b/core/lib/Thelia/Action/Content.php index 8560aa00e..3c027ad04 100644 --- a/core/lib/Thelia/Action/Content.php +++ b/core/lib/Thelia/Action/Content.php @@ -160,7 +160,7 @@ class Content extends BaseAction implements EventSubscriberInterface ->filterByFolderId($event->getFolderId()) ->findOne(); - if(null !== $contentFolder) { + if (null !== $contentFolder) { $contentFolder->delete(); } } diff --git a/core/lib/Thelia/Action/Country.php b/core/lib/Thelia/Action/Country.php index 69bf3c568..4c2d0839b 100644 --- a/core/lib/Thelia/Action/Country.php +++ b/core/lib/Thelia/Action/Country.php @@ -32,7 +32,6 @@ use Thelia\Core\Event\TheliaEvents; use Thelia\Model\Country as CountryModel; use Thelia\Model\CountryQuery; - /** * Class Country * @package Thelia\Action @@ -85,15 +84,13 @@ class Country extends BaseAction implements EventSubscriberInterface public function toggleDefault(CountryToggleDefaultEvent $event) { - if( null !== $country = CountryQuery::create()->findPk($event->getCountryId())) - { + if ( null !== $country = CountryQuery::create()->findPk($event->getCountryId())) { $country->toggleDefault(); $event->setCountry($country); } } - /** * Returns an array of event names this subscriber wants to listen to. * @@ -123,4 +120,4 @@ class Country extends BaseAction implements EventSubscriberInterface TheliaEvents::COUNTRY_TOGGLE_DEFAULT => array('toggleDefault', 128) ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Action/Customer.php b/core/lib/Thelia/Action/Customer.php index 85643cb88..2e18872f6 100755 --- a/core/lib/Thelia/Action/Customer.php +++ b/core/lib/Thelia/Action/Customer.php @@ -25,7 +25,6 @@ namespace Thelia\Action; use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Thelia\Core\Event\ActionEvent; -use Thelia\Core\Event\Customer\CustomerAddressEvent; use Thelia\Core\Event\Customer\CustomerCreateOrUpdateEvent; use Thelia\Core\Event\Customer\CustomerEvent; use Thelia\Core\Event\TheliaEvents; diff --git a/core/lib/Thelia/Action/Module.php b/core/lib/Thelia/Action/Module.php index 5025c513f..213024e16 100644 --- a/core/lib/Thelia/Action/Module.php +++ b/core/lib/Thelia/Action/Module.php @@ -29,7 +29,6 @@ use Thelia\Core\Event\TheliaEvents; use Thelia\Model\ModuleQuery; use Thelia\Module\BaseModule; - /** * Class Module * @package Thelia\Action @@ -45,16 +44,16 @@ class Module extends BaseAction implements EventSubscriberInterface $moduleInstance = $moduleClass->newInstance(); - if( method_exists($moduleInstance, 'setContainer')) { + if ( method_exists($moduleInstance, 'setContainer')) { $moduleInstance->setContainer($this->container); - if($module->getActivate() == BaseModule::IS_ACTIVATED) { + if ($module->getActivate() == BaseModule::IS_ACTIVATED) { $moduleInstance->deActivate($module); } else { $moduleInstance->activate($module); } } - if($module->isModified()) { + if ($module->isModified()) { $event->setModule($module); } @@ -95,4 +94,4 @@ class Module extends BaseAction implements EventSubscriberInterface TheliaEvents::MODULE_TOGGLE_ACTIVATION => array('toggleActivation', 128) ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Action/Pdf.php b/core/lib/Thelia/Action/Pdf.php index 52ce0b92d..2bdad9366 100644 --- a/core/lib/Thelia/Action/Pdf.php +++ b/core/lib/Thelia/Action/Pdf.php @@ -26,7 +26,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Thelia\Core\Event\PdfEvent; use Thelia\Core\Event\TheliaEvents; - /** * Class Pdf * @package Thelia\Action @@ -72,4 +71,4 @@ class Pdf extends BaseAction implements EventSubscriberInterface TheliaEvents::GENERATE_PDF => array("generatePdf", 128) ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Action/ShippingZone.php b/core/lib/Thelia/Action/ShippingZone.php index 517a5ca25..c621efd8f 100644 --- a/core/lib/Thelia/Action/ShippingZone.php +++ b/core/lib/Thelia/Action/ShippingZone.php @@ -29,7 +29,6 @@ use Thelia\Core\Event\TheliaEvents; use Thelia\Model\AreaDeliveryModule; use Thelia\Model\AreaDeliveryModuleQuery; - /** * Class ShippingZone * @package Thelia\Action @@ -55,7 +54,7 @@ class ShippingZone extends BaseAction implements EventSubscriberInterface ->filterByDeliveryModuleId($event->getShoppingZoneId()) ->findOne(); - if($areaDelivery) { + if ($areaDelivery) { $areaDelivery->delete(); } else { throw new \RuntimeException(sprintf('areaDeliveryModule not found with area_id = %d and delivery_module_id = %d', $event->getAreaId(), $event->getShoppingZoneId())); @@ -89,4 +88,4 @@ class ShippingZone extends BaseAction implements EventSubscriberInterface TheliaEvents::SHIPPING_ZONE_REMOVE_AREA => array('removeArea', 128), ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Action/TaxRule.php b/core/lib/Thelia/Action/TaxRule.php index 4b24f8cb9..f9f9fb412 100644 --- a/core/lib/Thelia/Action/TaxRule.php +++ b/core/lib/Thelia/Action/TaxRule.php @@ -68,8 +68,6 @@ class TaxRule extends BaseAction implements EventSubscriberInterface ->save() ; - - $event->setTaxRule($taxRule); } } @@ -90,12 +88,12 @@ class TaxRule extends BaseAction implements EventSubscriberInterface ->delete(); /* for each country */ - foreach($event->getCountryList() as $country) { + foreach ($event->getCountryList() as $country) { $position = 1; /* on applique les nouvelles regles */ - foreach($taxList as $tax) { - if(is_array($tax)) { - foreach($tax as $samePositionTax) { + foreach ($taxList as $tax) { + if (is_array($tax)) { + foreach ($tax as $samePositionTax) { $taxModel = new TaxRuleCountry(); $taxModel->setTaxRule($taxRule) ->setCountryId($country) diff --git a/core/lib/Thelia/Command/Install.php b/core/lib/Thelia/Command/Install.php index 6423d861a..7b6ca31c5 100755 --- a/core/lib/Thelia/Command/Install.php +++ b/core/lib/Thelia/Command/Install.php @@ -143,8 +143,8 @@ class Install extends ContainerAwareCommand $permissions = new CheckPermission(false, $this->getContainer()->get('thelia.translator')); $isValid = $permissions->exec(); - foreach($permissions->getValidationMessages() as $item => $data) { - if($data['status']) { + foreach ($permissions->getValidationMessages() as $item => $data) { + if ($data['status']) { $output->writeln(array( sprintf("%s ... %s", $data['text'], @@ -162,7 +162,7 @@ class Install extends ContainerAwareCommand } - if(false === $isValid) { + if (false === $isValid) { $output->writeln(array( "", "Please put correct permissions and reload install process" diff --git a/core/lib/Thelia/Command/ModuleActivateCommand.php b/core/lib/Thelia/Command/ModuleActivateCommand.php index d5ca8156d..1b8ac600f 100755 --- a/core/lib/Thelia/Command/ModuleActivateCommand.php +++ b/core/lib/Thelia/Command/ModuleActivateCommand.php @@ -26,7 +26,6 @@ namespace Thelia\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; -use Symfony\Component\Filesystem\Filesystem; use Thelia\Model\ModuleQuery; diff --git a/core/lib/Thelia/Command/Skeleton/Module/Class.php b/core/lib/Thelia/Command/Skeleton/Module/Class.php index c4c90aa60..c9c7109ac 100755 --- a/core/lib/Thelia/Command/Skeleton/Module/Class.php +++ b/core/lib/Thelia/Command/Skeleton/Module/Class.php @@ -25,7 +25,7 @@ namespace %%NAMESPACE%%; use Thelia\Module\BaseModule; -class %%CLASSNAME%% extends BaseModule +class Class extends BaseModule { /** * YOU HAVE TO IMPLEMENT HERE ABSTRACT METHODD FROM BaseModule Class diff --git a/core/lib/Thelia/Controller/Admin/AddressController.php b/core/lib/Thelia/Controller/Admin/AddressController.php index 38ec9cb6b..859fb8dc6 100644 --- a/core/lib/Thelia/Controller/Admin/AddressController.php +++ b/core/lib/Thelia/Controller/Admin/AddressController.php @@ -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(); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Controller/Admin/BaseAdminController.php b/core/lib/Thelia/Controller/Admin/BaseAdminController.php index 9adb7a19a..829e51c37 100755 --- a/core/lib/Thelia/Controller/Admin/BaseAdminController.php +++ b/core/lib/Thelia/Controller/Admin/BaseAdminController.php @@ -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 */ diff --git a/core/lib/Thelia/Controller/Admin/CountryController.php b/core/lib/Thelia/Controller/Admin/CountryController.php index 91160311f..a19a19212 100644 --- a/core/lib/Thelia/Controller/Admin/CountryController.php +++ b/core/lib/Thelia/Controller/Admin/CountryController.php @@ -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) { diff --git a/core/lib/Thelia/Controller/Admin/CustomerController.php b/core/lib/Thelia/Controller/Admin/CustomerController.php index e4d24e9ad..c5ebc9a39 100644 --- a/core/lib/Thelia/Controller/Admin/CustomerController.php +++ b/core/lib/Thelia/Controller/Admin/CustomerController.php @@ -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 * diff --git a/core/lib/Thelia/Controller/Admin/ModuleController.php b/core/lib/Thelia/Controller/Admin/ModuleController.php index 4a22c868a..c7d020d58 100644 --- a/core/lib/Thelia/Controller/Admin/ModuleController.php +++ b/core/lib/Thelia/Controller/Admin/ModuleController.php @@ -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); diff --git a/core/lib/Thelia/Controller/Admin/OrderController.php b/core/lib/Thelia/Controller/Admin/OrderController.php index 1df0679f0..4524e16ac 100644 --- a/core/lib/Thelia/Controller/Admin/OrderController.php +++ b/core/lib/Thelia/Controller/Admin/OrderController.php @@ -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", diff --git a/core/lib/Thelia/Controller/Admin/ShippingZoneController.php b/core/lib/Thelia/Controller/Admin/ShippingZoneController.php index d68de4808..b53b0a911 100644 --- a/core/lib/Thelia/Controller/Admin/ShippingZoneController.php +++ b/core/lib/Thelia/Controller/Admin/ShippingZoneController.php @@ -140,5 +140,4 @@ class ShippingZoneController extends BaseAdminController return $this->getRequest()->get('shipping_zone_id', 0); } - } diff --git a/core/lib/Thelia/Controller/Admin/TaxRuleController.php b/core/lib/Thelia/Controller/Admin/TaxRuleController.php index b0ceba67e..cfa5af1ff 100644 --- a/core/lib/Thelia/Controller/Admin/TaxRuleController.php +++ b/core/lib/Thelia/Controller/Admin/TaxRuleController.php @@ -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(); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Area/AreaAddCountryEvent.php b/core/lib/Thelia/Core/Event/Area/AreaAddCountryEvent.php index b6af3c5b3..5c98c071c 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaAddCountryEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaAddCountryEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Area; - /** * Class AreaAddCountryEvent * @package Thelia\Core\Event\Area @@ -34,7 +33,7 @@ class AreaAddCountryEvent extends AreaEvent protected $area_id; protected $country_id; - function __construct($area_id, $country_id) + public function __construct($area_id, $country_id) { $this->area_id = $area_id; $this->country_id = $country_id; @@ -80,7 +79,4 @@ class AreaAddCountryEvent extends AreaEvent return $this->country_id; } - - - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Area/AreaCreateEvent.php b/core/lib/Thelia/Core/Event/Area/AreaCreateEvent.php index d63afa5b9..32dc7a6c8 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaCreateEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Area; - /** * Class AreaCreateEvent * @package Thelia\Core\Event\Area @@ -49,5 +48,4 @@ class AreaCreateEvent extends AreaEvent return $this->name; } - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Area/AreaDeleteEvent.php b/core/lib/Thelia/Core/Event/Area/AreaDeleteEvent.php index 86f936140..2a83c98a4 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaDeleteEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Area; - /** * Class AreaDeleteEvent * @package Thelia\Core\Event\Area @@ -61,5 +60,4 @@ class AreaDeleteEvent extends AreaEvent return $this->area_id; } - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Area/AreaEvent.php b/core/lib/Thelia/Core/Event/Area/AreaEvent.php index 892d00843..9e0c2dc00 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaEvent.php @@ -24,7 +24,6 @@ namespace Thelia\Core\Event\Area; use Thelia\Core\Event\ActionEvent; - /** * Class AreaEvent * @package Thelia\Core\Event\Shipping @@ -63,4 +62,4 @@ class AreaEvent extends ActionEvent { return null !== $this->area; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Area/AreaRemoveCountryEvent.php b/core/lib/Thelia/Core/Event/Area/AreaRemoveCountryEvent.php index 84c8f10d2..92cfd57d3 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaRemoveCountryEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaRemoveCountryEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Area; - /** * Class AreaRemoveCountryEvent * @package Thelia\Core\Event\Area @@ -32,4 +31,4 @@ namespace Thelia\Core\Event\Area; class AreaRemoveCountryEvent extends AreaAddCountryEvent { -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Area/AreaUpdateEvent.php b/core/lib/Thelia/Core/Event/Area/AreaUpdateEvent.php index f5f7c8704..361607f42 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaUpdateEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Area; - /** * Class AreaUpdateEvent * @package Thelia\Core\Event\Area @@ -32,4 +31,4 @@ namespace Thelia\Core\Event\Area; class AreaUpdateEvent extends AreaCreateEvent { -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Area/AreaUpdatePostageEvent.php b/core/lib/Thelia/Core/Event/Area/AreaUpdatePostageEvent.php index 5f799b93c..b9cb825c4 100644 --- a/core/lib/Thelia/Core/Event/Area/AreaUpdatePostageEvent.php +++ b/core/lib/Thelia/Core/Event/Area/AreaUpdatePostageEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Area; - /** * Class AreaUpdatePostageEvent * @package Thelia\Core\Event\Area @@ -34,7 +33,7 @@ class AreaUpdatePostageEvent extends AreaEvent protected $area_id; protected $postage; - function __construct($area_id) + public function __construct($area_id) { $this->area_id = $area_id; } @@ -79,7 +78,4 @@ class AreaUpdatePostageEvent extends AreaEvent return $this->postage; } - - - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Cache/CacheEvent.php b/core/lib/Thelia/Core/Event/Cache/CacheEvent.php index 3a882d5dd..7b21db53d 100644 --- a/core/lib/Thelia/Core/Event/Cache/CacheEvent.php +++ b/core/lib/Thelia/Core/Event/Cache/CacheEvent.php @@ -25,7 +25,6 @@ namespace Thelia\Core\Event\Cache; use Thelia\Core\Event\ActionEvent; - /** * Class CacheEvent * @package Thelia\Core\Event\Cache @@ -63,5 +62,4 @@ class CacheEvent extends ActionEvent return $this->dir; } - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Content/ContentAddFolderEvent.php b/core/lib/Thelia/Core/Event/Content/ContentAddFolderEvent.php index a1d1d44e1..dac4317ba 100644 --- a/core/lib/Thelia/Core/Event/Content/ContentAddFolderEvent.php +++ b/core/lib/Thelia/Core/Event/Content/ContentAddFolderEvent.php @@ -24,7 +24,6 @@ namespace Thelia\Core\Event\Content; use Thelia\Model\Content; - /** * Class ContentAddFolderEvent * @package Thelia\Core\Event\Content @@ -61,6 +60,4 @@ class ContentAddFolderEvent extends ContentEvent return $this->folderId; } - - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Content/ContentRemoveFolderEvent.php b/core/lib/Thelia/Core/Event/Content/ContentRemoveFolderEvent.php index 195f4f3b0..1733ec893 100644 --- a/core/lib/Thelia/Core/Event/Content/ContentRemoveFolderEvent.php +++ b/core/lib/Thelia/Core/Event/Content/ContentRemoveFolderEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Content; - /** * Class ContentRemoveFolderEvent * @package Thelia\Core\Event\Content @@ -31,4 +30,4 @@ namespace Thelia\Core\Event\Content; */ class ContentRemoveFolderEvent extends ContentAddFolderEvent { -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Country/CountryCreateEvent.php b/core/lib/Thelia/Core/Event/Country/CountryCreateEvent.php index 48e8469a4..92d6632ae 100644 --- a/core/lib/Thelia/Core/Event/Country/CountryCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Country/CountryCreateEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Country; - /** * Class CountryCreateEvent * @package Thelia\Core\Event\Country @@ -150,5 +149,4 @@ class CountryCreateEvent extends CountryEvent return $this->area; } - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Country/CountryDeleteEvent.php b/core/lib/Thelia/Core/Event/Country/CountryDeleteEvent.php index 4a7d9c400..5d658ebc0 100644 --- a/core/lib/Thelia/Core/Event/Country/CountryDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Country/CountryDeleteEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Country; - /** * Class CountryDeleteEvent * @package Thelia\Core\Event\Country @@ -36,7 +35,7 @@ class CountryDeleteEvent extends CountryEvent */ protected $country_id; - function __construct($country_id) + public function __construct($country_id) { $this->country_id = $country_id; } @@ -57,4 +56,4 @@ class CountryDeleteEvent extends CountryEvent return $this->country_id; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Country/CountryEvent.php b/core/lib/Thelia/Core/Event/Country/CountryEvent.php index 962d880fa..505ead8ec 100644 --- a/core/lib/Thelia/Core/Event/Country/CountryEvent.php +++ b/core/lib/Thelia/Core/Event/Country/CountryEvent.php @@ -25,7 +25,6 @@ namespace Thelia\Core\Event\Country; use Thelia\Core\Event\ActionEvent; use Thelia\Model\Country; - /** * Class CountryEvent * @package Thelia\Core\Event\Country @@ -38,7 +37,7 @@ class CountryEvent extends ActionEvent */ protected $country; - function __construct(Country $country = null) + public function __construct(Country $country = null) { $this->country = $country; } @@ -69,5 +68,4 @@ class CountryEvent extends ActionEvent return null !== $this->country; } - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Country/CountryToggleDefaultEvent.php b/core/lib/Thelia/Core/Event/Country/CountryToggleDefaultEvent.php index 8f8142d0d..a414c70e8 100644 --- a/core/lib/Thelia/Core/Event/Country/CountryToggleDefaultEvent.php +++ b/core/lib/Thelia/Core/Event/Country/CountryToggleDefaultEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Country; - /** * Class CountryToggleDefaultEvent * @package Thelia\Core\Event\Country @@ -33,7 +32,7 @@ class CountryToggleDefaultEvent extends CountryEvent { protected $country_id; - function __construct($country_id) + public function __construct($country_id) { $this->country_id = $country_id; } @@ -45,4 +44,4 @@ class CountryToggleDefaultEvent extends CountryEvent { return $this->country_id; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Country/CountryUpdateEvent.php b/core/lib/Thelia/Core/Event/Country/CountryUpdateEvent.php index 496904172..2f82b17d0 100644 --- a/core/lib/Thelia/Core/Event/Country/CountryUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Country/CountryUpdateEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Country; - /** * Class CountryUpdateEvent * @package Thelia\Core\Event\Country @@ -37,7 +36,7 @@ class CountryUpdateEvent extends CountryCreateEvent protected $description; protected $postscriptum; - function __construct($country_id) + public function __construct($country_id) { $this->country_id = $country_id; } @@ -114,7 +113,4 @@ class CountryUpdateEvent extends CountryCreateEvent return $this->country_id; } - - - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Module/ModuleEvent.php b/core/lib/Thelia/Core/Event/Module/ModuleEvent.php index e9cf2623e..c37b2b995 100644 --- a/core/lib/Thelia/Core/Event/Module/ModuleEvent.php +++ b/core/lib/Thelia/Core/Event/Module/ModuleEvent.php @@ -25,7 +25,6 @@ namespace Thelia\Core\Event\Module; use Thelia\Core\Event\ActionEvent; use Thelia\Model\Module; - /** * Class ModuleEvent * @package Thelia\Core\Event\Module @@ -38,7 +37,7 @@ class ModuleEvent extends ActionEvent */ protected $module; - function __construct(Module $module = null) + public function __construct(Module $module = null) { $this->module = $module; } @@ -63,7 +62,4 @@ class ModuleEvent extends ActionEvent return $this->module; } - - - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Module/ModuleToggleActivationEvent.php b/core/lib/Thelia/Core/Event/Module/ModuleToggleActivationEvent.php index dd517d8ff..c6ece16f4 100644 --- a/core/lib/Thelia/Core/Event/Module/ModuleToggleActivationEvent.php +++ b/core/lib/Thelia/Core/Event/Module/ModuleToggleActivationEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Module; - /** * Class ModuleToggleActivationEvent * @package Thelia\Core\Event\Module @@ -36,7 +35,7 @@ class ModuleToggleActivationEvent extends ModuleEvent */ protected $module_id; - function __construct($module_id) + public function __construct($module_id) { $this->module_id = $module_id; } @@ -61,7 +60,4 @@ class ModuleToggleActivationEvent extends ModuleEvent return $this->module_id; } - - - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/PdfEvent.php b/core/lib/Thelia/Core/Event/PdfEvent.php index e0f873e04..b439c8a23 100644 --- a/core/lib/Thelia/Core/Event/PdfEvent.php +++ b/core/lib/Thelia/Core/Event/PdfEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event; - /** * Class PdfEvent * @package Thelia\Core\Event @@ -44,12 +43,12 @@ class PdfEvent extends ActionEvent /** * @param $content html content to transform into pdf - * @param string $orientation page orientation, same as TCPDF - * @param string $format The format used for pages, same as TCPDF - * @param string $lang Lang : fr, en, it... - * @param bool $unicode TRUE means that the input text is unicode (default = true) - * @param string $encoding charset encoding; default is UTF-8 - * @param array $marges Default marges (left, top, right, bottom) + * @param string $orientation page orientation, same as TCPDF + * @param string $format The format used for pages, same as TCPDF + * @param string $lang Lang : fr, en, it... + * @param bool $unicode TRUE means that the input text is unicode (default = true) + * @param string $encoding charset encoding; default is UTF-8 + * @param array $marges Default marges (left, top, right, bottom) */ public function __construct($content, $orientation = 'P', $format = 'A4', $lang='fr', $unicode=true, $encoding='UTF-8',array $marges = array(0, 0, 0, 0)) { @@ -189,5 +188,4 @@ class PdfEvent extends ActionEvent return $this->unicode; } - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Product/ProductCreateEvent.php b/core/lib/Thelia/Core/Event/Product/ProductCreateEvent.php index a9f6bbea1..9717f171d 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductCreateEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductCreateEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Product; - class ProductCreateEvent extends ProductEvent { protected $ref; diff --git a/core/lib/Thelia/Core/Event/Product/ProductDeleteEvent.php b/core/lib/Thelia/Core/Event/Product/ProductDeleteEvent.php index 108ceb781..7a3406e7e 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductDeleteEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\Product; - class ProductDeleteEvent extends ProductEvent { public function __construct($product_id) diff --git a/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneAddAreaEvent.php b/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneAddAreaEvent.php index d1e406646..35f3dcac1 100644 --- a/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneAddAreaEvent.php +++ b/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneAddAreaEvent.php @@ -24,7 +24,6 @@ namespace Thelia\Core\Event\ShippingZone; use Thelia\Core\Event\ActionEvent; - /** * Class ShippingZoneAddAreaEvent * @package Thelia\Core\Event\ShippingZone @@ -35,7 +34,7 @@ class ShippingZoneAddAreaEvent extends ActionEvent protected $area_id; protected $shopping_zone_id; - function __construct($area_id, $shopping_zone_id) + public function __construct($area_id, $shopping_zone_id) { $this->area_id = $area_id; $this->shopping_zone_id = $shopping_zone_id; @@ -81,7 +80,4 @@ class ShippingZoneAddAreaEvent extends ActionEvent return $this->shopping_zone_id; } - - - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneRemoveAreaEvent.php b/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneRemoveAreaEvent.php index 6dc6094d6..a3177f522 100644 --- a/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneRemoveAreaEvent.php +++ b/core/lib/Thelia/Core/Event/ShippingZone/ShippingZoneRemoveAreaEvent.php @@ -23,7 +23,6 @@ namespace Thelia\Core\Event\ShippingZone; - /** * Class ShippingZoneRemoveAreaEvent * @package Thelia\Core\Event\ShippingZone @@ -32,4 +31,4 @@ namespace Thelia\Core\Event\ShippingZone; class ShippingZoneRemoveAreaEvent extends ShippingZoneAddAreaEvent { -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Tax/TaxRuleEvent.php b/core/lib/Thelia/Core/Event/Tax/TaxRuleEvent.php index e364bfd84..6d3f21e6e 100644 --- a/core/lib/Thelia/Core/Event/Tax/TaxRuleEvent.php +++ b/core/lib/Thelia/Core/Event/Tax/TaxRuleEvent.php @@ -118,5 +118,4 @@ class TaxRuleEvent extends ActionEvent return $this->taxList; } - } diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php index f70eca2a1..860b63e27 100755 --- a/core/lib/Thelia/Core/Event/TheliaEvents.php +++ b/core/lib/Thelia/Core/Event/TheliaEvents.php @@ -183,7 +183,6 @@ final class TheliaEvents const FOLDER_TOGGLE_VISIBILITY = "action.toggleFolderVisibility"; const FOLDER_UPDATE_POSITION = "action.updateFolderPosition"; - const BEFORE_CREATEFOLDER = "action.before_createFolder"; const AFTER_CREATEFOLDER = "action.after_createFolder"; @@ -204,7 +203,6 @@ final class TheliaEvents const CONTENT_ADD_FOLDER = "action.contentAddFolder"; const CONTENT_REMOVE_FOLDER = "action.contentRemoveFolder"; - const BEFORE_CREATECONTENT = "action.before_createContent"; const AFTER_CREATECONTENT = "action.after_createContent"; @@ -222,7 +220,6 @@ final class TheliaEvents const COUNTRY_TOGGLE_DEFAULT = "action.toggleCountryDefault"; //const COUNTRY_UPDATE_POSITION = "action.updateFolderPosition"; - const BEFORE_CREATECOUNTRY = "action.before_createCountry"; const AFTER_CREATECOUNTRY = "action.after_createCountry"; diff --git a/core/lib/Thelia/Core/Template/Loop/Area.php b/core/lib/Thelia/Core/Template/Loop/Area.php index 4d43f524b..524777d08 100644 --- a/core/lib/Thelia/Core/Template/Loop/Area.php +++ b/core/lib/Thelia/Core/Template/Loop/Area.php @@ -30,7 +30,6 @@ use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Model\AreaQuery; - /** * Class Area * @package Thelia\Core\Template\Loop @@ -112,8 +111,7 @@ class Area extends BaseLoop $withoutZone = $this->getWithout_zone(); - if($withoutZone) - { + if ($withoutZone) { $search->joinAreaDeliveryModule('without_zone', Criteria::LEFT_JOIN) ->addJoinCondition('without_zone', 'delivery_module_id '.Criteria::EQUAL.' ?', $withoutZone, null, \PDO::PARAM_INT) ->where('`without_zone`.delivery_module_id '.Criteria::ISNULL); @@ -140,5 +138,4 @@ class Area extends BaseLoop return $loopResult; } - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Loop/Folder.php b/core/lib/Thelia/Core/Template/Loop/Folder.php index 04ba737fa..efc45030f 100755 --- a/core/lib/Thelia/Core/Template/Loop/Folder.php +++ b/core/lib/Thelia/Core/Template/Loop/Folder.php @@ -114,7 +114,7 @@ class Folder extends BaseI18nLoop if (null !== $content) { $obj = ContentQuery::create()->findPk($content); - if($obj) { + if ($obj) { $search->filterByContent($obj, Criteria::IN); } } diff --git a/core/lib/Thelia/Core/Template/Loop/FolderPath.php b/core/lib/Thelia/Core/Template/Loop/FolderPath.php index 272b9fbbb..2b9a52b0d 100644 --- a/core/lib/Thelia/Core/Template/Loop/FolderPath.php +++ b/core/lib/Thelia/Core/Template/Loop/FolderPath.php @@ -30,7 +30,6 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Model\FolderQuery; use Thelia\Type\BooleanOrBothType; - /** * Class FolderPath * @package Thelia\Core\Template\Loop @@ -156,5 +155,4 @@ class FolderPath extends BaseI18nLoop return $loopResult; } - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Loop/Tax.php b/core/lib/Thelia/Core/Template/Loop/Tax.php index 1ddf18824..18fb5e0dc 100644 --- a/core/lib/Thelia/Core/Template/Loop/Tax.php +++ b/core/lib/Thelia/Core/Template/Loop/Tax.php @@ -97,7 +97,7 @@ class Tax extends BaseI18nLoop $country = $this->getCountry(); $taxRule = $this->getTax_rule(); - if(null !== $taxRule && null !== $country) { + if (null !== $taxRule && null !== $country) { $search->filterByTaxRuleCountry( TaxRuleCountryQuery::create() ->filterByCountryId($country, Criteria::EQUAL) @@ -108,7 +108,7 @@ class Tax extends BaseI18nLoop } $excludeTaxRule = $this->getExclude_tax_rule(); - if(null !== $excludeTaxRule && null !== $country) { + if (null !== $excludeTaxRule && null !== $country) { $excludedTaxes = TaxRuleCountryQuery::create() ->filterByCountryId($country, Criteria::EQUAL) ->filterByTaxRuleId($excludeTaxRule, Criteria::IN) @@ -118,7 +118,7 @@ class Tax extends BaseI18nLoop $excludedTaxes, Criteria::NOT_IN );*/ - foreach($excludedTaxes as $excludedTax) { + foreach ($excludedTaxes as $excludedTax) { $search->filterByTaxRuleCountry($excludedTax, Criteria::NOT_EQUAL); } } diff --git a/core/lib/Thelia/Core/Template/Loop/TaxRuleCountry.php b/core/lib/Thelia/Core/Template/Loop/TaxRuleCountry.php index 91616f398..c4c165192 100644 --- a/core/lib/Thelia/Core/Template/Loop/TaxRuleCountry.php +++ b/core/lib/Thelia/Core/Template/Loop/TaxRuleCountry.php @@ -35,8 +35,6 @@ use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Model\Map\CountryTableMap; use Thelia\Model\Map\TaxRuleCountryTableMap; use Thelia\Model\Map\TaxTableMap; -use Thelia\Type\TypeCollection; -use Thelia\Type; use Thelia\Model\TaxRuleCountryQuery; /** @@ -76,15 +74,15 @@ class TaxRuleCountry extends BaseI18nLoop $country = $this->getCountry(); $taxes = $this->getTaxes(); - if((null === $country && null === $taxes)) { + if ((null === $country && null === $taxes)) { throw new \InvalidArgumentException('You must provide either `country` or `taxes` parameter in tax-rule-country loop'); } - if((null === $country && null !== $taxes)) { + if ((null === $country && null !== $taxes)) { throw new \InvalidArgumentException('You must provide `country` parameter with `taxes` parameter in tax-rule-country loop'); } - if(null !== $taxes) { + if (null !== $taxes) { $search->groupByCountryId(); $originalCountryJoin = new Join(); @@ -106,7 +104,7 @@ class TaxRuleCountry extends BaseI18nLoop CountryTableMap::TABLE_NAME, 'COUNTRY_ID' ); - } elseif(null !== $country) { + } elseif (null !== $country) { $search->filterByCountryId($country); /* manage tax translation */ @@ -132,7 +130,7 @@ class TaxRuleCountry extends BaseI18nLoop $loopResultRow = new LoopResultRow($loopResult, $taxRuleCountry, $this->versionable, $this->timestampable, $this->countable); - if(null !== $taxes) { + if (null !== $taxes) { $loopResultRow ->set("TAX_RULE" , $taxRuleCountry->getTaxRuleId()) ->set("COUNTRY" , $taxRuleCountry->getCountryId()) @@ -141,7 +139,7 @@ class TaxRuleCountry extends BaseI18nLoop ->set("COUNTRY_DESCRIPTION" , $taxRuleCountry->getVirtualColumn(CountryTableMap::TABLE_NAME . '_i18n_DESCRIPTION')) ->set("COUNTRY_POSTSCRIPTUM" , $taxRuleCountry->getVirtualColumn(CountryTableMap::TABLE_NAME . '_i18n_POSTSCRIPTUM')) ; - }elseif(null !== $country) { + } elseif (null !== $country) { $loopResultRow ->set("TAX_RULE" , $taxRuleCountry->getTaxRuleId()) ->set("COUNTRY" , $taxRuleCountry->getCountryId()) @@ -152,8 +150,6 @@ class TaxRuleCountry extends BaseI18nLoop ; } - - $loopResult->addRow($loopResultRow); } diff --git a/core/lib/Thelia/Core/Template/Loop/Template.php b/core/lib/Thelia/Core/Template/Loop/Template.php index 9eaa3ea4f..83ef4fabe 100644 --- a/core/lib/Thelia/Core/Template/Loop/Template.php +++ b/core/lib/Thelia/Core/Template/Loop/Template.php @@ -32,7 +32,6 @@ use Thelia\Core\Template\Loop\Argument\ArgumentCollection; use Thelia\Core\Template\Loop\Argument\Argument; use Thelia\Model\Base\TemplateQuery; -use Thelia\Type; /** * diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php index 594b45ae9..a401755a4 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/DataAccessFunctions.php @@ -172,6 +172,7 @@ class DataAccessFunctions extends AbstractSmartyPlugin self::$dataAccessCache['defaultCountry'] = $defaultCountry; }*/ $defaultCountry = CountryQuery::create()->filterByByDefault(1)->limit(1); + return $this->dataAccessWithI18n("defaultCountry", $params, $defaultCountry); } } @@ -237,7 +238,7 @@ class DataAccessFunctions extends AbstractSmartyPlugin public function ConfigDataAccess($params, $smarty) { - if(false === array_key_exists("key", $params)) { + if (false === array_key_exists("key", $params)) { return null; } diff --git a/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php b/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php index 37be09824..b86f160dc 100755 --- a/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php +++ b/core/lib/Thelia/Core/Template/Smarty/Plugins/Form.php @@ -152,7 +152,7 @@ class Form extends AbstractSmartyPlugin $template->assign("options", $formFieldView->vars); /* access to choices */ - if(isset($formFieldView->vars['choices'])) { + if (isset($formFieldView->vars['choices'])) { $template->assign("choices", $formFieldView->vars['choices']); } @@ -199,8 +199,8 @@ $this->assignFieldValues($template, $formFieldView->vars["full_name"], $fieldVar foreach ($formView->getIterator() as $row) { if ($this->isHidden($row) && $row->isRendered() === false) { $attributeList = array(); - if(isset($row->vars["attr"])) { - foreach($row->vars["attr"] as $attrKey => $attrValue) { + if (isset($row->vars["attr"])) { + foreach ($row->vars["attr"] as $attrKey => $attrValue) { $attributeList[] = sprintf($attrFormat, $attrKey, $attrValue); } } diff --git a/core/lib/Thelia/Form/Area/AreaCountryForm.php b/core/lib/Thelia/Form/Area/AreaCountryForm.php index c511e0b3c..b3f09ae06 100644 --- a/core/lib/Thelia/Form/Area/AreaCountryForm.php +++ b/core/lib/Thelia/Form/Area/AreaCountryForm.php @@ -28,7 +28,6 @@ use Symfony\Component\Validator\Constraints\GreaterThan; use Symfony\Component\Validator\Constraints\NotBlank; use Thelia\Form\BaseForm; - /** * Class AreaCountryForm * @package Thelia\Form\Area @@ -86,4 +85,4 @@ class AreaCountryForm extends BaseForm { return 'thelia_area_country'; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Form/Area/AreaCreateForm.php b/core/lib/Thelia/Form/Area/AreaCreateForm.php index 590001867..79fc4b2a2 100644 --- a/core/lib/Thelia/Form/Area/AreaCreateForm.php +++ b/core/lib/Thelia/Form/Area/AreaCreateForm.php @@ -26,7 +26,6 @@ use Thelia\Core\Translation\Translator; use Symfony\Component\Validator\Constraints\NotBlank; use Thelia\Form\BaseForm; - /** * Class AreaCreateForm * @package Thelia\Form\Shipping @@ -76,4 +75,4 @@ class AreaCreateForm extends BaseForm { return 'thelia_area_creation'; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Form/Area/AreaModificationForm.php b/core/lib/Thelia/Form/Area/AreaModificationForm.php index eefcb825a..03f4b2e46 100644 --- a/core/lib/Thelia/Form/Area/AreaModificationForm.php +++ b/core/lib/Thelia/Form/Area/AreaModificationForm.php @@ -25,7 +25,6 @@ namespace Thelia\Form\Area; use Symfony\Component\Validator\Constraints\GreaterThan; use Thelia\Form\Area\AreaCreateForm; - /** * Class AreaModificationForm * @package Thelia\Form\Shipping @@ -46,4 +45,4 @@ class AreaModificationForm extends AreaCreateForm { return 'thelia_area_modification'; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Form/Area/AreaPostageForm.php b/core/lib/Thelia/Form/Area/AreaPostageForm.php index ba24499e8..fa22ab908 100644 --- a/core/lib/Thelia/Form/Area/AreaPostageForm.php +++ b/core/lib/Thelia/Form/Area/AreaPostageForm.php @@ -29,7 +29,6 @@ use Symfony\Component\Validator\Constraints\NotBlank; use Thelia\Form\BaseForm; use Thelia\Core\Translation\Translator; - /** * Class AreaPostageForm * @package Thelia\Form\Area @@ -85,4 +84,4 @@ class AreaPostageForm extends BaseForm { return 'thelia_area_postage'; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Form/CountryModificationForm.php b/core/lib/Thelia/Form/CountryModificationForm.php index 68570425b..99c404e62 100644 --- a/core/lib/Thelia/Form/CountryModificationForm.php +++ b/core/lib/Thelia/Form/CountryModificationForm.php @@ -23,8 +23,6 @@ namespace Thelia\Form; use Symfony\Component\Validator\Constraints\GreaterThan; -use Symfony\Component\Validator\Constraints\NotBlank; -use Thelia\Core\Translation\Translator; class CountryModificationForm extends CountryCreationForm { diff --git a/core/lib/Thelia/Form/ShippingZone/ShippingZoneAddArea.php b/core/lib/Thelia/Form/ShippingZone/ShippingZoneAddArea.php index 81dd422b6..ea31b696b 100644 --- a/core/lib/Thelia/Form/ShippingZone/ShippingZoneAddArea.php +++ b/core/lib/Thelia/Form/ShippingZone/ShippingZoneAddArea.php @@ -28,7 +28,6 @@ use Symfony\Component\Validator\Constraints\GreaterThan; use Symfony\Component\Validator\Constraints\NotBlank; use Thelia\Form\BaseForm; - /** * Class ShippingZoneAddArea * @package Thelia\Form\ShippingZone @@ -84,4 +83,4 @@ class ShippingZoneAddArea extends BaseForm { return 'thelia_shippingzone_area'; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Form/ShippingZone/ShippingZoneRemoveArea.php b/core/lib/Thelia/Form/ShippingZone/ShippingZoneRemoveArea.php index 5c4e5597b..dfa568334 100644 --- a/core/lib/Thelia/Form/ShippingZone/ShippingZoneRemoveArea.php +++ b/core/lib/Thelia/Form/ShippingZone/ShippingZoneRemoveArea.php @@ -23,7 +23,6 @@ namespace Thelia\Form\ShippingZone; - /** * Class ShippingZoneRemoveArea * @package Thelia\Form\ShippingZone @@ -39,4 +38,4 @@ class ShippingZoneRemoveArea extends ShippingZoneAddArea { return 'thelia_shippingzone_remove_area'; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Form/TaxRuleCreationForm.php b/core/lib/Thelia/Form/TaxRuleCreationForm.php index be3556321..a5dcc1999 100644 --- a/core/lib/Thelia/Form/TaxRuleCreationForm.php +++ b/core/lib/Thelia/Form/TaxRuleCreationForm.php @@ -24,8 +24,6 @@ namespace Thelia\Form; use Symfony\Component\Validator\Constraints; use Symfony\Component\Validator\Constraints\NotBlank; -use Thelia\Core\Translation\Translator; -use Thelia\Model\CountryQuery; class TaxRuleCreationForm extends BaseForm { diff --git a/core/lib/Thelia/Form/TaxRuleTaxListUpdateForm.php b/core/lib/Thelia/Form/TaxRuleTaxListUpdateForm.php index 1d96c7e4d..ea2d1f06b 100644 --- a/core/lib/Thelia/Form/TaxRuleTaxListUpdateForm.php +++ b/core/lib/Thelia/Form/TaxRuleTaxListUpdateForm.php @@ -34,7 +34,7 @@ class TaxRuleTaxListUpdateForm extends BaseForm protected function buildForm() { $countryList = array(); - foreach(CountryQuery::create()->find() as $country) { + foreach (CountryQuery::create()->find() as $country) { $countryList[$country->getId()] = $country->getId(); } @@ -96,7 +96,7 @@ class TaxRuleTaxListUpdateForm extends BaseForm public function verifyTaxList($value, ExecutionContextInterface $context) { $jsonType = new JsonType(); - if(!$jsonType->isValid($value)) { + if (!$jsonType->isValid($value)) { $context->addViolation("Tax list is not valid JSON"); } @@ -104,10 +104,10 @@ class TaxRuleTaxListUpdateForm extends BaseForm /* check we have 2 level max */ - foreach($taxList as $taxLevel1) { - if(is_array($taxLevel1)) { - foreach($taxLevel1 as $taxLevel2) { - if(is_array($taxLevel2)) { + foreach ($taxList as $taxLevel1) { + if (is_array($taxLevel1)) { + foreach ($taxLevel1 as $taxLevel2) { + if (is_array($taxLevel2)) { $context->addViolation("Bad tax list JSON"); } else { $taxModel = TaxQuery::create()->findPk($taxLevel2); diff --git a/core/lib/Thelia/Module/BaseModule.php b/core/lib/Thelia/Module/BaseModule.php index 6cfc79d28..83636b921 100755 --- a/core/lib/Thelia/Module/BaseModule.php +++ b/core/lib/Thelia/Module/BaseModule.php @@ -53,10 +53,9 @@ abstract class BaseModule extends ContainerAware } - public function activate($moduleModel = null) { - if(null === $moduleModel) { + if (null === $moduleModel) { $moduleModel = $this->getModuleModel(); } @@ -64,7 +63,7 @@ abstract class BaseModule extends ContainerAware $con = Propel::getWriteConnection(ModuleTableMap::DATABASE_NAME); $con->beginTransaction(); try { - if($this->preActivation($con)) { + if ($this->preActivation($con)) { $moduleModel->setActivate(self::IS_ACTIVATED); $moduleModel->save($con); $this->postActivation($con); @@ -79,14 +78,14 @@ abstract class BaseModule extends ContainerAware public function deActivate($moduleModel = null) { - if(null === $moduleModel) { + if (null === $moduleModel) { $moduleModel = $this->getModuleModel(); } if ($moduleModel->getActivate() == self::IS_ACTIVATED) { $con = Propel::getWriteConnection(ModuleTableMap::DATABASE_NAME); $con->beginTransaction(); try { - if($this->preDeactivation($con)) { + if ($this->preDeactivation($con)) { $moduleModel->setActivate(self::IS_NOT_ACTIVATED); $moduleModel->save($con); $this->postDeactivation($con); @@ -215,7 +214,6 @@ abstract class BaseModule extends ContainerAware return $moduleModel; } - public function getCode() { if (null === $this->reflected) { @@ -225,8 +223,8 @@ abstract class BaseModule extends ContainerAware return basename(dirname($this->reflected->getFileName())); } - public function install(){ - + public function install() + { } public function preActivation(ConnectionInterface $con = null) diff --git a/core/lib/Thelia/Module/Exception/InvalidXmlDocumentException.php b/core/lib/Thelia/Module/Exception/InvalidXmlDocumentException.php index 2d679cfd0..49a7d5a68 100644 --- a/core/lib/Thelia/Module/Exception/InvalidXmlDocumentException.php +++ b/core/lib/Thelia/Module/Exception/InvalidXmlDocumentException.php @@ -23,7 +23,6 @@ namespace Thelia\Module\Exception; - /** * Class InvalidXmlDocumentException * @package Thelia\Module\Exception @@ -32,4 +31,4 @@ namespace Thelia\Module\Exception; class InvalidXmlDocumentException extends \RuntimeException { -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Module/ModuleDescriptorValidator.php b/core/lib/Thelia/Module/ModuleDescriptorValidator.php index 679373e02..8f8c89d4a 100644 --- a/core/lib/Thelia/Module/ModuleDescriptorValidator.php +++ b/core/lib/Thelia/Module/ModuleDescriptorValidator.php @@ -24,13 +24,12 @@ namespace Thelia\Module; use Thelia\Module\Exception\InvalidXmlDocumentException; - /** * Class ModuleDescriptorValidator * @package Thelia\Module * @author Manuel Raynaud */ -class ModuleDescriptorValidator +class ModuleDescriptorValidator { private $xsd_file; @@ -44,7 +43,7 @@ class ModuleDescriptorValidator $dom = new \DOMDocument(); if ($dom->load($xml_file)) { - if($dom->schemaValidate($this->xsd_file)) { + if ($dom->schemaValidate($this->xsd_file)) { return true; } } @@ -52,9 +51,10 @@ class ModuleDescriptorValidator throw new InvalidXmlDocumentException(sprintf("%s file is not a valid file", $xml_file)); } - public function getDescriptor($xml_file) { + public function getDescriptor($xml_file) + { $this->validate($xml_file); return @simplexml_load_file($xml_file); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Module/ModuleManagement.php b/core/lib/Thelia/Module/ModuleManagement.php index 84e6c6457..99cc5ca9f 100644 --- a/core/lib/Thelia/Module/ModuleManagement.php +++ b/core/lib/Thelia/Module/ModuleManagement.php @@ -32,13 +32,12 @@ use Thelia\Model\Module; use Thelia\Model\ModuleI18n; use Thelia\Model\ModuleQuery; - /** * Class ModuleManagement * @package Thelia\Module * @author Manuel Raynaud */ -class ModuleManagement +class ModuleManagement { protected $baseModuleDir; protected $reflected; @@ -59,16 +58,16 @@ class ModuleManagement $descriptorValidator = new ModuleDescriptorValidator(); foreach ($finder as $file) { $content = $descriptorValidator->getDescriptor($file->getRealPath()); - $reflected = new \ReflectionClass((string)$content->fullnamespace); + $reflected = new \ReflectionClass((string) $content->fullnamespace); $code = basename(dirname($reflected->getFileName())); - if(null === ModuleQuery::create()->filterByCode($code)->findOne()) { + if (null === ModuleQuery::create()->filterByCode($code)->findOne()) { $module = new Module(); $con = Propel::getWriteConnection(ModuleTableMap::DATABASE_NAME); $con->beginTransaction(); try { $module ->setCode($code) - ->setFullNamespace((string)$content->fullnamespace) + ->setFullNamespace((string) $content->fullnamespace) ->setType($this->getModuleType($reflected)) ->setActivate(0) ->save($con); @@ -76,7 +75,7 @@ class ModuleManagement $this->saveDescription($module, $content, $con); $con->commit(); - } catch(PropelException $e) { + } catch (PropelException $e) { $con->rollBack(); throw $e; } @@ -88,8 +87,7 @@ class ModuleManagement private function saveDescription(Module $module,\SimpleXMLElement $content, ConnectionInterface $con) { - foreach($content->descriptive as $description) - { + foreach ($content->descriptive as $description) { $locale = $description->attributes()->locale; $moduleI18n = new ModuleI18n(); @@ -107,15 +105,14 @@ class ModuleManagement private function getModuleType(\ReflectionClass $reflected) { - if($reflected->implementsInterface('Thelia\Module\DeliveryModuleInterface')) { + if ($reflected->implementsInterface('Thelia\Module\DeliveryModuleInterface')) { return BaseModule::DELIVERY_MODULE_TYPE; - } else if($reflected->implementsInterface('Thelia\Module\PaymentModuleInterface')) { + } elseif ($reflected->implementsInterface('Thelia\Module\PaymentModuleInterface')) { return BaseModule::PAYMENT_MODULE_TYPE; } else { return BaseModule::CLASSIC_MODULE_TYPE; } - } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/Action/BaseAction.php b/core/lib/Thelia/Tests/Action/BaseAction.php index f0027fd21..c07c07115 100644 --- a/core/lib/Thelia/Tests/Action/BaseAction.php +++ b/core/lib/Thelia/Tests/Action/BaseAction.php @@ -23,7 +23,6 @@ namespace Thelia\Tests\Action; - /** * Class BaseAction * @package Thelia\Tests\Action\ImageTest @@ -41,4 +40,4 @@ class BaseAction extends \PHPUnit_Framework_TestCase return $container; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/Action/ContentTest.php b/core/lib/Thelia/Tests/Action/ContentTest.php index 7aa819346..f527026bf 100644 --- a/core/lib/Thelia/Tests/Action/ContentTest.php +++ b/core/lib/Thelia/Tests/Action/ContentTest.php @@ -36,7 +36,6 @@ use Thelia\Model\ContentFolderQuery; use Thelia\Model\ContentQuery; use Thelia\Model\FolderQuery; - /** * Class ContentTest * @package Thelia\Tests\Action @@ -205,7 +204,7 @@ class ContentTest extends BaseAction $test = ContentFolderQuery::create() ->filterByContent($content) ->filterByFolder($folder); - } while($test->count() > 0); + } while ($test->count() > 0); $event = new ContentAddFolderEvent($content, $folder->getId()); @@ -267,10 +266,10 @@ class ContentTest extends BaseAction ->addAscendingOrderByColumn('RAND()') ->findOne(); - if(null === $folder) { + if (null === $folder) { $this->fail('use fixtures before launching test, there is no folder in database'); } return $folder; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/Action/FolderTest.php b/core/lib/Thelia/Tests/Action/FolderTest.php index 903e1b77b..7ef88aa0d 100644 --- a/core/lib/Thelia/Tests/Action/FolderTest.php +++ b/core/lib/Thelia/Tests/Action/FolderTest.php @@ -31,7 +31,6 @@ use Thelia\Core\Event\Folder\FolderUpdateEvent; use Thelia\Core\Event\UpdatePositionEvent; use Thelia\Model\FolderQuery; - /** * Class FolderTest * @package Thelia\Tests\Action\ImageTest @@ -73,8 +72,6 @@ class FolderTest extends BaseAction { $folder = $this->getRandomFolder(); - - $visible = !$folder->getVisible(); $event = new FolderUpdateEvent($folder->getId()); @@ -147,7 +144,7 @@ class FolderTest extends BaseAction ->filterByPosition(1, Criteria::GREATER_THAN) ->findOne(); - if(null === $folder) { + if (null === $folder) { $this->fail('use fixtures before launching test, there is no folder in database'); } @@ -169,7 +166,7 @@ class FolderTest extends BaseAction ->filterByPosition(1) ->findOne(); - if(null === $folder) { + if (null === $folder) { $this->fail('use fixtures before launching test, there is no folder in database'); } @@ -191,7 +188,7 @@ class FolderTest extends BaseAction ->filterByPosition(1, Criteria::GREATER_THAN) ->findOne(); - if(null === $folder) { + if (null === $folder) { $this->fail('use fixtures before launching test, there is no folder in database'); } @@ -215,10 +212,10 @@ class FolderTest extends BaseAction ->addAscendingOrderByColumn('RAND()') ->findOne(); - if(null === $folder) { + if (null === $folder) { $this->fail('use fixtures before launching test, there is no folder in database'); } return $folder; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/TaxEngine/CalculatorTest.php b/core/lib/Thelia/Tests/TaxEngine/CalculatorTest.php index 0dbbc73bb..1e6f6f258 100755 --- a/core/lib/Thelia/Tests/TaxEngine/CalculatorTest.php +++ b/core/lib/Thelia/Tests/TaxEngine/CalculatorTest.php @@ -127,7 +127,7 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase $taxRulesCollection = new ObjectCollection(); $aProduct = ProductQuery::create()->findOne(); - if(null === $aProduct) { + if (null === $aProduct) { return; } @@ -169,7 +169,7 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase $taxRulesCollection->setModel('\Thelia\Model\Tax'); $aProduct = ProductQuery::create()->findOne(); - if(null === $aProduct) { + if (null === $aProduct) { return; } @@ -214,7 +214,7 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase $taxRulesCollection->append($tax); $aProduct = ProductQuery::create()->findOne(); - if(null === $aProduct) { + if (null === $aProduct) { return; } @@ -270,7 +270,7 @@ class CalculatorTest extends \PHPUnit_Framework_TestCase $taxRulesCollection->append($tax); $aProduct = ProductQuery::create()->findOne(); - if(null === $aProduct) { + if (null === $aProduct) { return; } diff --git a/templates/admin/default/modules.html b/templates/admin/default/modules.html index 57bb14bf1..c94ba8789 100644 --- a/templates/admin/default/modules.html +++ b/templates/admin/default/modules.html @@ -88,7 +88,7 @@ }).done(function(){ $("#loading-event").remove(); }) - .fail(function(jqXHR, textStatus, errorThrown){ + .fail(function(jqXHR, textStatus, errorThrown){ $("#loading-event").remove(); $('#module-failed-body').html(jqXHR.responseJSON.error); $("#module-failed").modal("show");