diff --git a/core/lib/Thelia/Action/BaseCachedFile.php b/core/lib/Thelia/Action/BaseCachedFile.php index 42e67f5c8..3c8f98061 100644 --- a/core/lib/Thelia/Action/BaseCachedFile.php +++ b/core/lib/Thelia/Action/BaseCachedFile.php @@ -13,7 +13,7 @@ namespace Thelia\Action; use Thelia\Core\Event\CachedFileEvent; use Thelia\Core\Event\File\FileCreateOrUpdateEvent; -use Thelia\Core\Event\Image\FileDeleteEvent; +use Thelia\Core\Event\File\FileDeleteEvent; use Thelia\Core\Event\UpdateFilePositionEvent; use Thelia\Exception\FileException; use Thelia\Files\FileManager; @@ -181,7 +181,6 @@ abstract class BaseCachedFile extends BaseAction return $path; } - /** * Take care of saving a file in the database and file storage * @@ -213,7 +212,6 @@ abstract class BaseCachedFile extends BaseAction $event->setUploadedFile($newUploadedFile); } - /** * Take care of updating file in the database and file storage * diff --git a/core/lib/Thelia/Action/Document.php b/core/lib/Thelia/Action/Document.php index 8499fd087..187552944 100644 --- a/core/lib/Thelia/Action/Document.php +++ b/core/lib/Thelia/Action/Document.php @@ -12,13 +12,9 @@ namespace Thelia\Action; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Thelia\Core\Event\Document\DocumentCreateOrUpdateEvent; -use Thelia\Core\Event\Document\DocumentDeleteEvent; use Thelia\Core\Event\Document\DocumentEvent; use Thelia\Core\Event\TheliaEvents; -use Thelia\Core\Event\UpdateFilePositionEvent; use Thelia\Exception\DocumentException; -use Thelia\Exception\ImageException; use Thelia\Model\ConfigQuery; use Thelia\Tools\URL; diff --git a/core/lib/Thelia/Action/Image.php b/core/lib/Thelia/Action/Image.php index eb338e219..481ba850d 100644 --- a/core/lib/Thelia/Action/Image.php +++ b/core/lib/Thelia/Action/Image.php @@ -18,12 +18,8 @@ use Imagine\Image\ImageInterface; use Imagine\Image\ImagineInterface; use Imagine\Image\Point; use Symfony\Component\EventDispatcher\EventSubscriberInterface; -use Thelia\Core\Event\File\FileCreateOrUpdateEvent; -use Thelia\Core\Event\Image\ImageCreateOrUpdateEvent; -use Thelia\Core\Event\Image\ImageDeleteEvent; use Thelia\Core\Event\Image\ImageEvent; use Thelia\Core\Event\TheliaEvents; -use Thelia\Core\Event\UpdateFilePositionEvent; use Thelia\Exception\ImageException; use Thelia\Model\ConfigQuery; use Thelia\Tools\URL; @@ -86,7 +82,7 @@ class Image extends BaseCachedFile implements EventSubscriberInterface * * This method updates the cache_file_path and file_url attributes of the event * - * @param ImageEvent $event + * @param ImageEvent $event * * @throws \Thelia\Exception\ImageException * @throws \InvalidArgumentException diff --git a/core/lib/Thelia/Controller/Admin/FileController.php b/core/lib/Thelia/Controller/Admin/FileController.php index a89234350..b4f373413 100644 --- a/core/lib/Thelia/Controller/Admin/FileController.php +++ b/core/lib/Thelia/Controller/Admin/FileController.php @@ -15,7 +15,7 @@ namespace Thelia\Controller\Admin; use Propel\Runtime\Exception\PropelException; use Symfony\Component\HttpFoundation\File\UploadedFile; use Thelia\Core\Event\File\FileCreateOrUpdateEvent; -use Thelia\Core\Event\Image\FileDeleteEvent; +use Thelia\Core\Event\File\FileDeleteEvent; use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\UpdateFilePositionEvent; use Thelia\Core\HttpFoundation\Response; @@ -56,10 +56,10 @@ class FileController extends BaseAdminController /** * Manage how a file collection has to be saved * - * @param int $parentId Parent id owning files being saved - * @param string $parentType Parent Type owning files being saved (product, category, content, etc.) - * @param string $objectType Object type, e.g. image or document - * @param array $validMimeTypes an array of valid mime types. If empty, any mime type is allowed. + * @param int $parentId Parent id owning files being saved + * @param string $parentType Parent Type owning files being saved (product, category, content, etc.) + * @param string $objectType Object type, e.g. image or document + * @param array $validMimeTypes an array of valid mime types. If empty, any mime type is allowed. * * @return Response */ @@ -322,14 +322,13 @@ class FileController extends BaseAdminController )); } - /** * Manage how a file is updated * - * @param int $fileId File identifier + * @param int $fileId File identifier * @param string $parentType Parent Type owning file being saved * @param string $objectType the type of the file, image or document - * @param string $eventName the event type. + * @param string $eventName the event type. * * @return FileModelInterface */ @@ -421,7 +420,6 @@ class FileController extends BaseAdminController return $fileModelInstance; } - /** * Manage how an image is updated * @@ -471,14 +469,13 @@ class FileController extends BaseAdminController )); } - /** * Manage how a image has to be deleted (AJAX) * - * @param int $fileId Parent id owning image being deleted + * @param int $fileId Parent id owning image being deleted * @param string $parentType Parent Type owning image being deleted * @param string $objectType the type of the file, image or document - * @param string $eventName the event type. + * @param string $eventName the event type. * * @return Response */ @@ -546,7 +543,6 @@ class FileController extends BaseAdminController return new Response($message); } - /** * Manage how a image has to be deleted (AJAX) * @@ -632,4 +628,4 @@ class FileController extends BaseAdminController return $this->updateFilePositionAction($parentType, $documentId, 'document', TheliaEvents::DOCUMENT_UPDATE_POSITION); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Controller/Admin/ProductController.php b/core/lib/Thelia/Controller/Admin/ProductController.php index f3a625807..ba78c830e 100644 --- a/core/lib/Thelia/Controller/Admin/ProductController.php +++ b/core/lib/Thelia/Controller/Admin/ProductController.php @@ -215,7 +215,7 @@ class ProductController extends AbstractSeoCrudController } /** - * @param Product $object + * @param Product $object * @return ProductModificationForm */ protected function hydrateObjectForm($object) diff --git a/core/lib/Thelia/Controller/Front/BaseFrontController.php b/core/lib/Thelia/Controller/Front/BaseFrontController.php index 2919d3a3f..c951aec32 100644 --- a/core/lib/Thelia/Controller/Front/BaseFrontController.php +++ b/core/lib/Thelia/Controller/Front/BaseFrontController.php @@ -35,9 +35,9 @@ class BaseFrontController extends BaseController /** * Return the route path defined for the givent route ID * - * @param string $routeId the route ID, as found in Config/Resources/routing/admin.xml - * @param array $parameters the Route parameters, as a var/value pair array - * @param bool $referenceType Router::ABSOLUTE_PATH or Router::ABSOLUTE_URL + * @param string $routeId the route ID, as found in Config/Resources/routing/admin.xml + * @param array $parameters the Route parameters, as a var/value pair array + * @param bool $referenceType Router::ABSOLUTE_PATH or Router::ABSOLUTE_URL * * @see \Thelia\Controller\BaseController::getRouteFromRouter() * @@ -51,10 +51,10 @@ class BaseFrontController extends BaseController /** * Redirect to a specific route. * - * @param string $routeId the route ID, as found in Config/Resources/routing/admin.xml - * @param array $urlParameters the URL parameters, as a var/value pair array - * @param array $routeParameters the Route parameters, as a var/value pair array - * @param bool $referenceType Router::ABSOLUTE_PATH or Router::ABSOLUTE_URL + * @param string $routeId the route ID, as found in Config/Resources/routing/admin.xml + * @param array $urlParameters the URL parameters, as a var/value pair array + * @param array $routeParameters the Route parameters, as a var/value pair array + * @param bool $referenceType Router::ABSOLUTE_PATH or Router::ABSOLUTE_URL */ public function redirectToRoute($routeId, array $urlParameters = [], array $routeParameters = [], $referenceType = Router::ABSOLUTE_PATH) { @@ -140,7 +140,7 @@ class BaseFrontController extends BaseController * Render the given template, and returns the result as a string. * * @param string $templateName the complete template name, with extension - * @param array $args the template arguments + * @param array $args the template arguments * @param string$templateDir * * @return string diff --git a/core/lib/Thelia/Core/Event/Brand/BrandUpdateEvent.php b/core/lib/Thelia/Core/Event/Brand/BrandUpdateEvent.php index 7b9398622..2fc42267c 100644 --- a/core/lib/Thelia/Core/Event/Brand/BrandUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Brand/BrandUpdateEvent.php @@ -115,12 +115,13 @@ class BrandUpdateEvent extends BrandCreateEvent } /** - * @param int $logo_image_id + * @param int $logo_image_id * @return $this */ public function setLogoImageId($logo_image_id) { $this->logo_image_id = $logo_image_id; + return $this; } diff --git a/core/lib/Thelia/Core/Event/Document/DocumentCreateOrUpdateEvent.php b/core/lib/Thelia/Core/Event/Document/DocumentCreateOrUpdateEvent.php index b0c603e8d..175813b05 100644 --- a/core/lib/Thelia/Core/Event/Document/DocumentCreateOrUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Document/DocumentCreateOrUpdateEvent.php @@ -32,8 +32,8 @@ class DocumentCreateOrUpdateEvent extends FileCreateOrUpdateEvent * Constructor * * @param string $documentType Document type - * ex : FileManager::TYPE_CATEGORY - * @param int $parentId Document parent id + * ex : FileManager::TYPE_CATEGORY + * @param int $parentId Document parent id * @deprecated deprecated since version 2.0.3. Use FileCreateOrUpdateEvent instead */ public function __construct($documentType, $parentId) @@ -128,4 +128,4 @@ class DocumentCreateOrUpdateEvent extends FileCreateOrUpdateEvent { return parent::getOldModel(); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Document/DocumentDeleteEvent.php b/core/lib/Thelia/Core/Event/Document/DocumentDeleteEvent.php index a258eb0b1..20735c490 100644 --- a/core/lib/Thelia/Core/Event/Document/DocumentDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Document/DocumentDeleteEvent.php @@ -12,7 +12,7 @@ namespace Thelia\Core\Event\Document; -use Thelia\Core\Event\Image\FileDeleteEvent; +use Thelia\Core\Event\File\FileDeleteEvent; use Thelia\Model\CategoryDocument; use Thelia\Model\ContentDocument; use Thelia\Model\FolderDocument; @@ -35,8 +35,8 @@ class DocumentDeleteEvent extends FileDeleteEvent * Constructor * * @param CategoryDocument|ProductDocument|ContentDocument|FolderDocument $documentToDelete Document about to be deleted - * @param string $documentType Document type - * ex : FileManager::TYPE_CATEGORY + * @param string $documentType Document type + * ex : FileManager::TYPE_CATEGORY * @deprecated deprecated since version 2.0.3. Use FileDeleteEvent instead */ public function __construct($documentToDelete, $documentType) @@ -94,4 +94,4 @@ class DocumentDeleteEvent extends FileDeleteEvent return parent::getFileToDelete(); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/File/FileDeleteEvent.php b/core/lib/Thelia/Core/Event/File/FileDeleteEvent.php index 38fd3203f..48a519dbf 100644 --- a/core/lib/Thelia/Core/Event/File/FileDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/File/FileDeleteEvent.php @@ -10,7 +10,7 @@ /* file that was distributed with this source code. */ /*************************************************************************************/ -namespace Thelia\Core\Event\Image; +namespace Thelia\Core\Event\File; use Thelia\Core\Event\ActionEvent; use Thelia\Files\FileModelInterface; diff --git a/core/lib/Thelia/Core/Event/Image/ImageDeleteEvent.php b/core/lib/Thelia/Core/Event/Image/ImageDeleteEvent.php index 266875e67..b0b5098d9 100644 --- a/core/lib/Thelia/Core/Event/Image/ImageDeleteEvent.php +++ b/core/lib/Thelia/Core/Event/Image/ImageDeleteEvent.php @@ -93,4 +93,4 @@ class ImageDeleteEvent extends FileDeleteEvent return parent::getFileToDelete(); } -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Event/Image/ImageEvent.php b/core/lib/Thelia/Core/Event/Image/ImageEvent.php index 318265c26..392662436 100644 --- a/core/lib/Thelia/Core/Event/Image/ImageEvent.php +++ b/core/lib/Thelia/Core/Event/Image/ImageEvent.php @@ -217,19 +217,21 @@ class ImageEvent extends CachedFileEvent } /** - * @param ImageInterface $imageObject + * @param ImageInterface $imageObject * @return $this */ public function setImageObject($imageObject) { $this->imageObject = $imageObject; + return $this; } /** * @return ImageInterface */ - public function getImageObject() { + public function getImageObject() + { return $this->imageObject; } } diff --git a/core/lib/Thelia/Core/Event/Product/ProductUpdateEvent.php b/core/lib/Thelia/Core/Event/Product/ProductUpdateEvent.php index 4a20b491c..0dd38fdd1 100644 --- a/core/lib/Thelia/Core/Event/Product/ProductUpdateEvent.php +++ b/core/lib/Thelia/Core/Event/Product/ProductUpdateEvent.php @@ -21,7 +21,6 @@ class ProductUpdateEvent extends ProductCreateEvent protected $postscriptum; protected $brand_id; - public function __construct($product_id) { $this->product_id = $product_id; @@ -76,12 +75,13 @@ class ProductUpdateEvent extends ProductCreateEvent } /** - * @param int $brand_id + * @param int $brand_id * @return $this */ public function setBrandId($brand_id) { $this->brand_id = $brand_id; + return $this; } diff --git a/core/lib/Thelia/Core/Template/Element/BaseLoop.php b/core/lib/Thelia/Core/Template/Element/BaseLoop.php index e08d13dd6..1038541de 100644 --- a/core/lib/Thelia/Core/Template/Element/BaseLoop.php +++ b/core/lib/Thelia/Core/Template/Element/BaseLoop.php @@ -536,4 +536,4 @@ abstract class BaseLoop */ abstract protected function getArgDefinitions(); -} \ No newline at end of file +} diff --git a/core/lib/Thelia/Core/Template/Loop/Coupon.php b/core/lib/Thelia/Core/Template/Loop/Coupon.php index 310a760e2..d1d26c905 100644 --- a/core/lib/Thelia/Core/Template/Loop/Coupon.php +++ b/core/lib/Thelia/Core/Template/Loop/Coupon.php @@ -15,7 +15,6 @@ namespace Thelia\Core\Template\Loop; use Propel\Runtime\ActiveQuery\Criteria; use Thelia\Condition\ConditionFactory; use Thelia\Condition\Implementation\ConditionInterface; -use Thelia\Core\HttpFoundation\Request; use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResultRow; diff --git a/core/lib/Thelia/Core/Template/Loop/Document.php b/core/lib/Thelia/Core/Template/Loop/Document.php index 5a129afd6..2d5a7fbfb 100644 --- a/core/lib/Thelia/Core/Template/Loop/Document.php +++ b/core/lib/Thelia/Core/Template/Loop/Document.php @@ -23,7 +23,6 @@ use Propel\Runtime\ActiveQuery\Criteria; use Thelia\Model\ConfigQuery; use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Element\LoopResult; -use Thelia\Type\EnumType; use Thelia\Log\Tlog; /** diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index 5417446ac..06585240a 100644 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -998,7 +998,7 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL /** * @param $loopResultRow - * @param \Thelia\Model\Product $product + * @param \Thelia\Model\Product $product * @param $default_category_id * @return mixed */ diff --git a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php index 580da808e..188ccfcce 100644 --- a/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php +++ b/core/lib/Thelia/Core/Template/Smarty/SmartyParser.php @@ -110,8 +110,8 @@ class SmartyParser extends Smarty implements ParserInterface * * The trim level is defined by the configuration variable html_output_trim_level * - * @param string $source the HTML source - * @param \Smarty_Internal_Template $template + * @param string $source the HTML source + * @param \Smarty_Internal_Template $template * @return string */ public function trimWhitespaces($source, \Smarty_Internal_Template $template) @@ -136,8 +136,7 @@ class SmartyParser extends Smarty implements ParserInterface '#(([a-z0-9]\s*=\s*(["\'])[^\3]*?\3)|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \4', '/(^[\n]*|[\n]+)[\s\t]*[\n]+/' => "\n" ); - } - else if ($compressionMode >= 2) { + } elseif ($compressionMode >= 2) { if (preg_match_all('##is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { foreach ($matches as $match) { $store[] = $match[0][0]; @@ -166,8 +165,7 @@ class SmartyParser extends Smarty implements ParserInterface '#>\s+$#Ss' => '>', ); - } - else { + } else { $expressions = array(); } diff --git a/core/lib/Thelia/Model/Category.php b/core/lib/Thelia/Model/Category.php index 8e188c265..efa96c245 100644 --- a/core/lib/Thelia/Model/Category.php +++ b/core/lib/Thelia/Model/Category.php @@ -62,7 +62,7 @@ class Category extends BaseCategory implements FileModelParentInterface /** * Get the root category - * @param int $categoryId + * @param int $categoryId * @return mixed */ public function getRoot($categoryId) @@ -70,7 +70,7 @@ class Category extends BaseCategory implements FileModelParentInterface $category = CategoryQuery::create()->findPk($categoryId); - if(0 !== $category->getParent()) { + if (0 !== $category->getParent()) { $parentCategory = CategoryQuery::create()->findPk($category->getParent()); if (null !== $parentCategory) { diff --git a/core/lib/Thelia/Model/Folder.php b/core/lib/Thelia/Model/Folder.php index e722a560c..13ca25040 100644 --- a/core/lib/Thelia/Model/Folder.php +++ b/core/lib/Thelia/Model/Folder.php @@ -58,7 +58,7 @@ class Folder extends BaseFolder implements FileModelParentInterface /** * Get the root folder - * @param int $folderId + * @param int $folderId * @return mixed */ public function getRoot($folderId) @@ -66,7 +66,7 @@ class Folder extends BaseFolder implements FileModelParentInterface $folder = FolderQuery::create()->findPk($folderId); - if(0 !== $folder->getParent()) { + if (0 !== $folder->getParent()) { $parentFolder = FolderQuery::create()->findPk($folder->getParent()); if (null !== $parentFolder) {