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\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
*

View File

@@ -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;

View File

@@ -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

View File

@@ -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)
*

View File

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

View File

@@ -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

View File

@@ -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;
}

View File

@@ -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)

View File

@@ -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)

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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;
/**

View File

@@ -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
*/

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
*
* @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();
}

View File

@@ -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) {

View File

@@ -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) {