diff --git a/core/lib/Thelia/ImportExport/AbstractHandler.php b/core/lib/Thelia/ImportExport/AbstractHandler.php index e1ecaca95..a54b774f0 100644 --- a/core/lib/Thelia/ImportExport/AbstractHandler.php +++ b/core/lib/Thelia/ImportExport/AbstractHandler.php @@ -30,13 +30,13 @@ abstract class AbstractHandler * * Dependency injection: load the container to be able to get parameters and services */ - public function __construct(ContainerInterface $container) { + public function __construct(ContainerInterface $container) + { $this->defaultLocale = Lang::getDefaultLanguage()->getLocale(); $this->container = $container; } - public function getContainer() { return $this->container; @@ -66,4 +66,4 @@ abstract class AbstractHandler * ); */ abstract public function getHandledTypes(); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/ImportExport/Export/DocumentsExportInterface.php b/core/lib/Thelia/ImportExport/Export/DocumentsExportInterface.php index b9aca7b8d..ad952e2b8 100644 --- a/core/lib/Thelia/ImportExport/Export/DocumentsExportInterface.php +++ b/core/lib/Thelia/ImportExport/Export/DocumentsExportInterface.php @@ -26,4 +26,4 @@ interface DocumentsExportInterface * return an array with the paths to the documents to include in the archive */ public function getDocumentsPaths(); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/ImportExport/Export/ExportHandler.php b/core/lib/Thelia/ImportExport/Export/ExportHandler.php index 8acf4ddc8..5419f957b 100644 --- a/core/lib/Thelia/ImportExport/Export/ExportHandler.php +++ b/core/lib/Thelia/ImportExport/Export/ExportHandler.php @@ -80,7 +80,7 @@ abstract class ExportHandler extends AbstractHandler } /** - * @param \Thelia\Model\Lang $lang + * @param \Thelia\Model\Lang $lang * @return \Thelia\Core\FileFormat\Formatting\FormatterData * * The method builds the FormatterData for the formatter @@ -92,10 +92,8 @@ abstract class ExportHandler extends AbstractHandler $query = $this->buildDataSet($lang); if ($query instanceof ModelCriteria) { - return $data->loadModelCriteria($query); } elseif (is_array($query)) { - return $data->setData($query); } elseif ($query instanceof BaseLoop) { $pagination = null; @@ -160,7 +158,7 @@ abstract class ExportHandler extends AbstractHandler $return = "CONCAT("; $len = strlen($str); - for($i = 0; $i < $len; ++$i) { + for ($i = 0; $i < $len; ++$i) { $return .= "CHAR(".ord($str[$i])."),"; } @@ -212,8 +210,8 @@ abstract class ExportHandler extends AbstractHandler } /** - * @param Lang $lang + * @param Lang $lang * @return ModelCriteria|array|BaseLoop */ abstract public function buildDataSet(Lang $lang); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/ImportExport/Export/ImagesExportInterface.php b/core/lib/Thelia/ImportExport/Export/ImagesExportInterface.php index e075bcb2c..dad485ec5 100644 --- a/core/lib/Thelia/ImportExport/Export/ImagesExportInterface.php +++ b/core/lib/Thelia/ImportExport/Export/ImagesExportInterface.php @@ -11,7 +11,6 @@ /*************************************************************************************/ namespace Thelia\ImportExport\Export; - /** * interface ImagesExportInterface * @package Thelia\ImportExport @@ -27,4 +26,4 @@ interface ImagesExportInterface * return an array with the paths to the images to include in the archive */ public function getImagesPaths(); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/ImportExport/Export/Type/CustomerExport.php b/core/lib/Thelia/ImportExport/Export/Type/CustomerExport.php index e2ffa87ac..ed33077b7 100644 --- a/core/lib/Thelia/ImportExport/Export/Type/CustomerExport.php +++ b/core/lib/Thelia/ImportExport/Export/Type/CustomerExport.php @@ -23,7 +23,6 @@ use Thelia\Model\Map\CountryI18nTableMap; use Thelia\Model\Map\CountryTableMap; use Thelia\Model\Map\CustomerTableMap; use Thelia\Model\Map\CustomerTitleI18nTableMap; -use Thelia\Model\Map\CustomerTitleTableMap; use Thelia\Model\Map\NewsletterTableMap; use Thelia\Model\OrderQuery; @@ -215,7 +214,6 @@ class CustomerExport extends ExportHandler $dateTime = new \DateTime($date); $currentCustomer[CustomerTableMap::CREATED_AT] = $dateTime->format($lang->getDatetimeFormat()); - /** * Then compute everything about the orders */ diff --git a/core/lib/Thelia/ImportExport/Export/Type/MailingExport.php b/core/lib/Thelia/ImportExport/Export/Type/MailingExport.php index 8d397b11d..40621adc8 100644 --- a/core/lib/Thelia/ImportExport/Export/Type/MailingExport.php +++ b/core/lib/Thelia/ImportExport/Export/Type/MailingExport.php @@ -11,7 +11,6 @@ /*************************************************************************************/ namespace Thelia\ImportExport\Export\Type; -use Thelia\Core\FileFormat\Formatting\FormatterData; use Thelia\Core\FileFormat\FormatType; use Thelia\ImportExport\Export\ExportHandler; use Thelia\Model\CustomerQuery; @@ -28,7 +27,7 @@ use Thelia\Model\NewsletterQuery; class MailingExport extends ExportHandler { /** - * @param Lang $lang + * @param Lang $lang * @return array|\Propel\Runtime\ActiveQuery\ModelCriteria */ public function buildDataSet(Lang $lang) @@ -42,7 +41,7 @@ class MailingExport extends ExportHandler ->find() ->toArray() ; - + $customers = CustomerQuery::create() ->select([ CustomerTableMap::EMAIL, @@ -96,4 +95,4 @@ class MailingExport extends ExportHandler FormatType::UNBOUNDED, ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/ImportExport/Export/Type/ProductPricesExport.php b/core/lib/Thelia/ImportExport/Export/Type/ProductPricesExport.php index 059f5544f..1c4589690 100644 --- a/core/lib/Thelia/ImportExport/Export/Type/ProductPricesExport.php +++ b/core/lib/Thelia/ImportExport/Export/Type/ProductPricesExport.php @@ -57,7 +57,7 @@ class ProductPricesExport extends ExportHandler } /** - * @param Lang $lang + * @param Lang $lang * @return FormatterData */ public function buildDataSet(Lang $lang) @@ -126,5 +126,4 @@ class ProductPricesExport extends ExportHandler ]; } - -} \ No newline at end of file +} diff --git a/core/lib/Thelia/ImportExport/Export/Type/ProductSEOExport.php b/core/lib/Thelia/ImportExport/Export/Type/ProductSEOExport.php index f674479fe..66e5ee305 100644 --- a/core/lib/Thelia/ImportExport/Export/Type/ProductSEOExport.php +++ b/core/lib/Thelia/ImportExport/Export/Type/ProductSEOExport.php @@ -13,7 +13,6 @@ namespace Thelia\ImportExport\Export\Type; use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Join; -use Thelia\Core\FileFormat\Formatting\FormatterData; use Thelia\Core\FileFormat\FormatType; use Thelia\ImportExport\Export\ExportHandler; use Thelia\Model\Map\ProductI18nTableMap; @@ -54,7 +53,7 @@ class ProductSEOExport extends ExportHandler } /** - * @param Lang $lang + * @param Lang $lang * @return array|\Propel\Runtime\ActiveQuery\ModelCriteria */ public function buildDataSet(Lang $lang) @@ -126,4 +125,4 @@ class ProductSEOExport extends ExportHandler ]; } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/ImportExport/Import/ImportHandler.php b/core/lib/Thelia/ImportExport/Import/ImportHandler.php index 67d7d9b34..f08d84d14 100644 --- a/core/lib/Thelia/ImportExport/Import/ImportHandler.php +++ b/core/lib/Thelia/ImportExport/Import/ImportHandler.php @@ -77,4 +77,4 @@ abstract class ImportHandler extends AbstractHandler * The method does the import routine from a FormatterData */ abstract public function retrieveFromFormatterData(FormatterData $data); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/ImportExport/Import/Type/ProductPricesImport.php b/core/lib/Thelia/ImportExport/Import/Type/ProductPricesImport.php index 3568f40bc..3bd9405f0 100644 --- a/core/lib/Thelia/ImportExport/Import/Type/ProductPricesImport.php +++ b/core/lib/Thelia/ImportExport/Import/Type/ProductPricesImport.php @@ -112,7 +112,7 @@ class ProductPricesImport extends ImportHandler if (isset($row["promo"])) { $price ->getProductSaleElements() - ->setPromo((int)$row["promo"]) + ->setPromo((int) $row["promo"]) ->save() ; } @@ -133,5 +133,4 @@ class ProductPricesImport extends ImportHandler return ["ref", "price"]; } - } diff --git a/core/lib/Thelia/ImportExport/Import/Type/ProductStockImport.php b/core/lib/Thelia/ImportExport/Import/Type/ProductStockImport.php index 870c18e62..b660b327d 100644 --- a/core/lib/Thelia/ImportExport/Import/Type/ProductStockImport.php +++ b/core/lib/Thelia/ImportExport/Import/Type/ProductStockImport.php @@ -91,4 +91,4 @@ class ProductStockImport extends ImportHandler ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/ContainerAwareTestCase.php b/core/lib/Thelia/Tests/ContainerAwareTestCase.php index 0a5c08f7b..daff73ae6 100644 --- a/core/lib/Thelia/Tests/ContainerAwareTestCase.php +++ b/core/lib/Thelia/Tests/ContainerAwareTestCase.php @@ -75,4 +75,4 @@ abstract class ContainerAwareTestCase extends \PHPUnit_Framework_TestCase * Use this method to build the container with the services that you need. */ abstract protected function buildContainer(ContainerBuilder $container); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/ImportExport/Export/CustomerExportTest.php b/core/lib/Thelia/Tests/ImportExport/Export/CustomerExportTest.php index bd8ec09b0..82db41f6c 100644 --- a/core/lib/Thelia/Tests/ImportExport/Export/CustomerExportTest.php +++ b/core/lib/Thelia/Tests/ImportExport/Export/CustomerExportTest.php @@ -193,4 +193,4 @@ class CustomerExportTest extends \PHPUnit_Framework_TestCase } } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/ImportExport/Export/ExportHandlerTest.php b/core/lib/Thelia/Tests/ImportExport/Export/ExportHandlerTest.php index e08fe32ad..197f16db4 100644 --- a/core/lib/Thelia/Tests/ImportExport/Export/ExportHandlerTest.php +++ b/core/lib/Thelia/Tests/ImportExport/Export/ExportHandlerTest.php @@ -16,7 +16,6 @@ use Thelia\Core\FileFormat\FormatType; use Thelia\Model\AddressQuery; use Thelia\Model\CustomerQuery; use Thelia\Model\Lang; -use Thelia\Model\Map\AddressTableMap; use Thelia\Tests\ContainerAwareTestCase; /** @@ -41,12 +40,10 @@ class ExportHandlerTest extends ContainerAwareTestCase ); } - public function setUp() { parent::setUp(); - $this->handler = $this->getMock( "Thelia\\ImportExport\\Export\\ExportHandler", [ @@ -121,4 +118,4 @@ class ExportHandlerTest extends ContainerAwareTestCase } } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/ImportExport/Export/MailingExportTest.php b/core/lib/Thelia/Tests/ImportExport/Export/MailingExportTest.php index acb0b4271..99be26579 100644 --- a/core/lib/Thelia/Tests/ImportExport/Export/MailingExportTest.php +++ b/core/lib/Thelia/Tests/ImportExport/Export/MailingExportTest.php @@ -49,4 +49,4 @@ class MailingExportTest extends \PHPUnit_Framework_TestCase $this->handler->getHandledTypes() ); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/ImportExport/Export/ProductPricesExportTest.php b/core/lib/Thelia/Tests/ImportExport/Export/ProductPricesExportTest.php index 186f3b27a..71a9c9cc0 100644 --- a/core/lib/Thelia/Tests/ImportExport/Export/ProductPricesExportTest.php +++ b/core/lib/Thelia/Tests/ImportExport/Export/ProductPricesExportTest.php @@ -17,7 +17,6 @@ use Thelia\ImportExport\Export\Type\ProductPricesExport; use Thelia\Model\Base\ProductSaleElementsQuery; use Thelia\Model\CurrencyQuery; use Thelia\Model\Lang; -use Thelia\Model\LangQuery; /** * Class ProductPricesExportTest @@ -47,8 +46,7 @@ class ProductPricesExportTest extends \PHPUnit_Framework_TestCase $max = 50; } - for ($i = 0; $i < $max; ++$i) - { + for ($i = 0; $i < $max; ++$i) { $row = $rawData[$i]; $rowKeys = array_keys($row); @@ -87,4 +85,4 @@ class ProductPricesExportTest extends \PHPUnit_Framework_TestCase $this->assertEquals($attributes, $rowAttributes); } } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/ImportExport/Export/ProductSEOExportTest.php b/core/lib/Thelia/Tests/ImportExport/Export/ProductSEOExportTest.php index 62a2fdac8..5325de093 100644 --- a/core/lib/Thelia/Tests/ImportExport/Export/ProductSEOExportTest.php +++ b/core/lib/Thelia/Tests/ImportExport/Export/ProductSEOExportTest.php @@ -14,11 +14,7 @@ namespace Thelia\Tests\ImportExport\Export; use Symfony\Component\DependencyInjection\Container; use Thelia\Core\Translation\Translator; use Thelia\ImportExport\Export\Type\ProductSEOExport; -use Thelia\Model\Base\ProductAssociatedContentQuery; -use Thelia\Model\ContentI18nQuery; -use Thelia\Model\ContentQuery; use Thelia\Model\Lang; -use Thelia\Model\ProductAssociatedContent; use Thelia\Model\ProductQuery; /** @@ -49,8 +45,7 @@ class ProductSEOExportTest extends \PHPUnit_Framework_TestCase $max = 50; } - for ($i = 0; $i < $max; ++$i) - { + for ($i = 0; $i < $max; ++$i) { $row = $rawData[$i]; $rowKeys = array_keys($row); @@ -69,4 +64,4 @@ class ProductSEOExportTest extends \PHPUnit_Framework_TestCase $this->assertEquals($product->getRewrittenUrl("en_US"), $row["url"]); } } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/ImportExport/Import/ProductPricesImportTest.php b/core/lib/Thelia/Tests/ImportExport/Import/ProductPricesImportTest.php index e62e0450e..8bf56ee54 100644 --- a/core/lib/Thelia/Tests/ImportExport/Import/ProductPricesImportTest.php +++ b/core/lib/Thelia/Tests/ImportExport/Import/ProductPricesImportTest.php @@ -18,7 +18,6 @@ use Thelia\ImportExport\Import\Type\ProductPricesImport; use Thelia\Model\Currency; use Thelia\Model\ProductSaleElementsQuery; use Thelia\Tests\Controller\ControllerTestBase; -use Thelia\Tests\Controller\ImportExportControllerTrait; /** * Class ProductPricesImportTest @@ -35,7 +34,6 @@ class ProductPricesImportTest extends ControllerTestBase } - /** * @return \Thelia\Controller\BaseController The controller you want to test */ @@ -44,7 +42,6 @@ class ProductPricesImportTest extends ControllerTestBase return new ImportController(); } - public function setUp() { parent::setUp(); @@ -112,4 +109,4 @@ class ProductPricesImportTest extends ControllerTestBase } } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Tests/ImportExport/Import/ProductStockImportTest.php b/core/lib/Thelia/Tests/ImportExport/Import/ProductStockImportTest.php index 27c5c18df..dded4e914 100644 --- a/core/lib/Thelia/Tests/ImportExport/Import/ProductStockImportTest.php +++ b/core/lib/Thelia/Tests/ImportExport/Import/ProductStockImportTest.php @@ -35,7 +35,6 @@ class ProductStockImportTest extends ControllerTestBase return new ImportController(); } - public function setUp() { parent::setUp(); @@ -92,4 +91,4 @@ class ProductStockImportTest extends ControllerTestBase ); } } -} \ No newline at end of file +}