PHP-CS fixer pass

This commit is contained in:
Franck Allimant
2014-07-01 01:07:56 +02:00
parent f820a09a1a
commit 811e89f740
20 changed files with 48 additions and 63 deletions

View File

@@ -13,7 +13,7 @@ namespace Thelia\Action;
use Thelia\Core\Event\CachedFileEvent; use Thelia\Core\Event\CachedFileEvent;
use Thelia\Core\Event\File\FileCreateOrUpdateEvent; 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\Core\Event\UpdateFilePositionEvent;
use Thelia\Exception\FileException; use Thelia\Exception\FileException;
use Thelia\Files\FileManager; use Thelia\Files\FileManager;
@@ -181,7 +181,6 @@ abstract class BaseCachedFile extends BaseAction
return $path; return $path;
} }
/** /**
* Take care of saving a file in the database and file storage * Take care of saving a file in the database and file storage
* *
@@ -213,7 +212,6 @@ abstract class BaseCachedFile extends BaseAction
$event->setUploadedFile($newUploadedFile); $event->setUploadedFile($newUploadedFile);
} }
/** /**
* Take care of updating file in the database and file storage * Take care of updating file in the database and file storage
* *

View File

@@ -12,13 +12,9 @@
namespace Thelia\Action; namespace Thelia\Action;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; 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\Document\DocumentEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\UpdateFilePositionEvent;
use Thelia\Exception\DocumentException; use Thelia\Exception\DocumentException;
use Thelia\Exception\ImageException;
use Thelia\Model\ConfigQuery; use Thelia\Model\ConfigQuery;
use Thelia\Tools\URL; use Thelia\Tools\URL;

View File

@@ -18,12 +18,8 @@ use Imagine\Image\ImageInterface;
use Imagine\Image\ImagineInterface; use Imagine\Image\ImagineInterface;
use Imagine\Image\Point; use Imagine\Image\Point;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; 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\Image\ImageEvent;
use Thelia\Core\Event\TheliaEvents; use Thelia\Core\Event\TheliaEvents;
use Thelia\Core\Event\UpdateFilePositionEvent;
use Thelia\Exception\ImageException; use Thelia\Exception\ImageException;
use Thelia\Model\ConfigQuery; use Thelia\Model\ConfigQuery;
use Thelia\Tools\URL; 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 * 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 \Thelia\Exception\ImageException
* @throws \InvalidArgumentException * @throws \InvalidArgumentException

View File

@@ -15,7 +15,7 @@ namespace Thelia\Controller\Admin;
use Propel\Runtime\Exception\PropelException; use Propel\Runtime\Exception\PropelException;
use Symfony\Component\HttpFoundation\File\UploadedFile; use Symfony\Component\HttpFoundation\File\UploadedFile;
use Thelia\Core\Event\File\FileCreateOrUpdateEvent; 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\TheliaEvents;
use Thelia\Core\Event\UpdateFilePositionEvent; use Thelia\Core\Event\UpdateFilePositionEvent;
use Thelia\Core\HttpFoundation\Response; use Thelia\Core\HttpFoundation\Response;
@@ -56,10 +56,10 @@ class FileController extends BaseAdminController
/** /**
* Manage how a file collection has to be saved * Manage how a file collection has to be saved
* *
* @param int $parentId Parent id owning files being 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 $parentType Parent Type owning files being saved (product, category, content, etc.)
* @param string $objectType Object type, e.g. image or document * @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 array $validMimeTypes an array of valid mime types. If empty, any mime type is allowed.
* *
* @return Response * @return Response
*/ */
@@ -322,14 +322,13 @@ class FileController extends BaseAdminController
)); ));
} }
/** /**
* Manage how a file is updated * 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 $parentType Parent Type owning file being saved
* @param string $objectType the type of the file, image or document * @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 * @return FileModelInterface
*/ */
@@ -421,7 +420,6 @@ class FileController extends BaseAdminController
return $fileModelInstance; return $fileModelInstance;
} }
/** /**
* Manage how an image is updated * Manage how an image is updated
* *
@@ -471,14 +469,13 @@ class FileController extends BaseAdminController
)); ));
} }
/** /**
* Manage how a image has to be deleted (AJAX) * 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 $parentType Parent Type owning image being deleted
* @param string $objectType the type of the file, image or document * @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 * @return Response
*/ */
@@ -546,7 +543,6 @@ class FileController extends BaseAdminController
return new Response($message); return new Response($message);
} }
/** /**
* Manage how a image has to be deleted (AJAX) * Manage how a image has to be deleted (AJAX)
* *

View File

@@ -215,7 +215,7 @@ class ProductController extends AbstractSeoCrudController
} }
/** /**
* @param Product $object * @param Product $object
* @return ProductModificationForm * @return ProductModificationForm
*/ */
protected function hydrateObjectForm($object) protected function hydrateObjectForm($object)

View File

@@ -35,9 +35,9 @@ class BaseFrontController extends BaseController
/** /**
* Return the route path defined for the givent route ID * 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 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 array $parameters the Route parameters, as a var/value pair array
* @param bool $referenceType Router::ABSOLUTE_PATH or Router::ABSOLUTE_URL * @param bool $referenceType Router::ABSOLUTE_PATH or Router::ABSOLUTE_URL
* *
* @see \Thelia\Controller\BaseController::getRouteFromRouter() * @see \Thelia\Controller\BaseController::getRouteFromRouter()
* *
@@ -51,10 +51,10 @@ class BaseFrontController extends BaseController
/** /**
* Redirect to a specific route. * Redirect to a specific route.
* *
* @param string $routeId the route ID, as found in Config/Resources/routing/admin.xml * @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 $urlParameters the URL parameters, as a var/value pair array
* @param array $routeParameters the Route 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 bool $referenceType Router::ABSOLUTE_PATH or Router::ABSOLUTE_URL
*/ */
public function redirectToRoute($routeId, array $urlParameters = [], array $routeParameters = [], $referenceType = Router::ABSOLUTE_PATH) 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. * Render the given template, and returns the result as a string.
* *
* @param string $templateName the complete template name, with extension * @param string $templateName the complete template name, with extension
* @param array $args the template arguments * @param array $args the template arguments
* @param string$templateDir * @param string$templateDir
* *
* @return string * @return string

View File

@@ -115,12 +115,13 @@ class BrandUpdateEvent extends BrandCreateEvent
} }
/** /**
* @param int $logo_image_id * @param int $logo_image_id
* @return $this * @return $this
*/ */
public function setLogoImageId($logo_image_id) public function setLogoImageId($logo_image_id)
{ {
$this->logo_image_id = $logo_image_id; $this->logo_image_id = $logo_image_id;
return $this; return $this;
} }

View File

@@ -32,8 +32,8 @@ class DocumentCreateOrUpdateEvent extends FileCreateOrUpdateEvent
* Constructor * Constructor
* *
* @param string $documentType Document type * @param string $documentType Document type
* ex : FileManager::TYPE_CATEGORY * ex : FileManager::TYPE_CATEGORY
* @param int $parentId Document parent id * @param int $parentId Document parent id
* @deprecated deprecated since version 2.0.3. Use FileCreateOrUpdateEvent instead * @deprecated deprecated since version 2.0.3. Use FileCreateOrUpdateEvent instead
*/ */
public function __construct($documentType, $parentId) public function __construct($documentType, $parentId)

View File

@@ -12,7 +12,7 @@
namespace Thelia\Core\Event\Document; namespace Thelia\Core\Event\Document;
use Thelia\Core\Event\Image\FileDeleteEvent; use Thelia\Core\Event\File\FileDeleteEvent;
use Thelia\Model\CategoryDocument; use Thelia\Model\CategoryDocument;
use Thelia\Model\ContentDocument; use Thelia\Model\ContentDocument;
use Thelia\Model\FolderDocument; use Thelia\Model\FolderDocument;
@@ -35,8 +35,8 @@ class DocumentDeleteEvent extends FileDeleteEvent
* Constructor * Constructor
* *
* @param CategoryDocument|ProductDocument|ContentDocument|FolderDocument $documentToDelete Document about to be deleted * @param CategoryDocument|ProductDocument|ContentDocument|FolderDocument $documentToDelete Document about to be deleted
* @param string $documentType Document type * @param string $documentType Document type
* ex : FileManager::TYPE_CATEGORY * ex : FileManager::TYPE_CATEGORY
* @deprecated deprecated since version 2.0.3. Use FileDeleteEvent instead * @deprecated deprecated since version 2.0.3. Use FileDeleteEvent instead
*/ */
public function __construct($documentToDelete, $documentType) public function __construct($documentToDelete, $documentType)

View File

@@ -10,7 +10,7 @@
/* file that was distributed with this source code. */ /* 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\Core\Event\ActionEvent;
use Thelia\Files\FileModelInterface; use Thelia\Files\FileModelInterface;

View File

@@ -217,19 +217,21 @@ class ImageEvent extends CachedFileEvent
} }
/** /**
* @param ImageInterface $imageObject * @param ImageInterface $imageObject
* @return $this * @return $this
*/ */
public function setImageObject($imageObject) public function setImageObject($imageObject)
{ {
$this->imageObject = $imageObject; $this->imageObject = $imageObject;
return $this; return $this;
} }
/** /**
* @return ImageInterface * @return ImageInterface
*/ */
public function getImageObject() { public function getImageObject()
{
return $this->imageObject; return $this->imageObject;
} }
} }

View File

@@ -21,7 +21,6 @@ class ProductUpdateEvent extends ProductCreateEvent
protected $postscriptum; protected $postscriptum;
protected $brand_id; protected $brand_id;
public function __construct($product_id) public function __construct($product_id)
{ {
$this->product_id = $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 * @return $this
*/ */
public function setBrandId($brand_id) public function setBrandId($brand_id)
{ {
$this->brand_id = $brand_id; $this->brand_id = $brand_id;
return $this; return $this;
} }

View File

@@ -15,7 +15,6 @@ namespace Thelia\Core\Template\Loop;
use Propel\Runtime\ActiveQuery\Criteria; use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Condition\ConditionFactory; use Thelia\Condition\ConditionFactory;
use Thelia\Condition\Implementation\ConditionInterface; use Thelia\Condition\Implementation\ConditionInterface;
use Thelia\Core\HttpFoundation\Request;
use Thelia\Core\Template\Element\BaseI18nLoop; use Thelia\Core\Template\Element\BaseI18nLoop;
use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResult;
use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Element\LoopResultRow;

View File

@@ -23,7 +23,6 @@ use Propel\Runtime\ActiveQuery\Criteria;
use Thelia\Model\ConfigQuery; use Thelia\Model\ConfigQuery;
use Thelia\Core\Template\Element\LoopResultRow; use Thelia\Core\Template\Element\LoopResultRow;
use Thelia\Core\Template\Element\LoopResult; use Thelia\Core\Template\Element\LoopResult;
use Thelia\Type\EnumType;
use Thelia\Log\Tlog; use Thelia\Log\Tlog;
/** /**

View File

@@ -998,7 +998,7 @@ class Product extends BaseI18nLoop implements PropelSearchLoopInterface, SearchL
/** /**
* @param $loopResultRow * @param $loopResultRow
* @param \Thelia\Model\Product $product * @param \Thelia\Model\Product $product
* @param $default_category_id * @param $default_category_id
* @return mixed * @return mixed
*/ */

View File

@@ -110,8 +110,8 @@ class SmartyParser extends Smarty implements ParserInterface
* *
* The trim level is defined by the configuration variable html_output_trim_level * The trim level is defined by the configuration variable html_output_trim_level
* *
* @param string $source the HTML source * @param string $source the HTML source
* @param \Smarty_Internal_Template $template * @param \Smarty_Internal_Template $template
* @return string * @return string
*/ */
public function trimWhitespaces($source, \Smarty_Internal_Template $template) 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', '#(([a-z0-9]\s*=\s*(["\'])[^\3]*?\3)|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \4',
'/(^[\n]*|[\n]+)[\s\t]*[\n]+/' => "\n" '/(^[\n]*|[\n]+)[\s\t]*[\n]+/' => "\n"
); );
} } elseif ($compressionMode >= 2) {
else if ($compressionMode >= 2) {
if (preg_match_all('#<!--\[[^\]]+\]>.*?<!\[[^\]]+\]-->#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { if (preg_match_all('#<!--\[[^\]]+\]>.*?<!\[[^\]]+\]-->#is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) {
foreach ($matches as $match) { foreach ($matches as $match) {
$store[] = $match[0][0]; $store[] = $match[0][0];
@@ -166,8 +165,7 @@ class SmartyParser extends Smarty implements ParserInterface
'#>\s+$#Ss' => '>', '#>\s+$#Ss' => '>',
); );
} } else {
else {
$expressions = array(); $expressions = array();
} }

View File

@@ -62,7 +62,7 @@ class Category extends BaseCategory implements FileModelParentInterface
/** /**
* Get the root category * Get the root category
* @param int $categoryId * @param int $categoryId
* @return mixed * @return mixed
*/ */
public function getRoot($categoryId) public function getRoot($categoryId)
@@ -70,7 +70,7 @@ class Category extends BaseCategory implements FileModelParentInterface
$category = CategoryQuery::create()->findPk($categoryId); $category = CategoryQuery::create()->findPk($categoryId);
if(0 !== $category->getParent()) { if (0 !== $category->getParent()) {
$parentCategory = CategoryQuery::create()->findPk($category->getParent()); $parentCategory = CategoryQuery::create()->findPk($category->getParent());
if (null !== $parentCategory) { if (null !== $parentCategory) {

View File

@@ -58,7 +58,7 @@ class Folder extends BaseFolder implements FileModelParentInterface
/** /**
* Get the root folder * Get the root folder
* @param int $folderId * @param int $folderId
* @return mixed * @return mixed
*/ */
public function getRoot($folderId) public function getRoot($folderId)
@@ -66,7 +66,7 @@ class Folder extends BaseFolder implements FileModelParentInterface
$folder = FolderQuery::create()->findPk($folderId); $folder = FolderQuery::create()->findPk($folderId);
if(0 !== $folder->getParent()) { if (0 !== $folder->getParent()) {
$parentFolder = FolderQuery::create()->findPk($folder->getParent()); $parentFolder = FolderQuery::create()->findPk($folder->getParent());
if (null !== $parentFolder) { if (null !== $parentFolder) {