fix cs
This commit is contained in:
@@ -156,7 +156,7 @@ class FileManager
|
||||
* @param ImageCreateOrUpdateEvent $event Image event
|
||||
* @param FolderImage|ContentImage|CategoryImage|ProductImage $modelImage Image to save
|
||||
*
|
||||
* @return int Nb lines modified
|
||||
* @return int Nb lines modified
|
||||
* @throws \Thelia\Exception\ImageException
|
||||
* @todo refactor make all pictures using propel inheritance and factorise image behaviour into one single clean action
|
||||
*/
|
||||
@@ -215,7 +215,7 @@ class FileManager
|
||||
* @param FolderDocument|ContentDocument|CategoryDocument|ProductDocument $modelDocument Document to save
|
||||
*
|
||||
* @throws \Thelia\Model\Exception\InvalidArgumentException
|
||||
* @return int Nb lines modified
|
||||
* @return int Nb lines modified
|
||||
* @todo refactor make all documents using propel inheritance and factorise image behaviour into one single clean action
|
||||
*/
|
||||
public function saveDocument(DocumentCreateOrUpdateEvent $event, $modelDocument)
|
||||
@@ -296,7 +296,6 @@ class FileManager
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Delete image from file storage and database
|
||||
*
|
||||
@@ -313,7 +312,6 @@ class FileManager
|
||||
$model->delete();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get image model from type
|
||||
*
|
||||
@@ -723,4 +721,4 @@ class FileManager
|
||||
self::TYPE_MODULE,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,8 +23,6 @@
|
||||
|
||||
namespace Thelia\Tools;
|
||||
|
||||
use Propel\Runtime\ActiveQuery\ModelCriteria;
|
||||
use Propel\Runtime\ActiveRecord\ActiveRecordInterface;
|
||||
use Thelia\Model\Lang;
|
||||
|
||||
/**
|
||||
@@ -69,19 +67,19 @@ class I18n
|
||||
$askedLocale
|
||||
)->findOne();
|
||||
/* or default translation */
|
||||
if(null === $i18n) {
|
||||
if (null === $i18n) {
|
||||
$i18n = $i18nQueryClass::create()
|
||||
->filterById($id)
|
||||
->filterByLocale(
|
||||
Lang::getDefaultLanguage()->getLocale()
|
||||
)->findOne();
|
||||
}
|
||||
if(null === $i18n) { // @todo something else ?
|
||||
if (null === $i18n) { // @todo something else ?
|
||||
$i18n = new $i18nClass();;
|
||||
$i18n->setId($id);
|
||||
foreach($needed as $need) {
|
||||
foreach ($needed as $need) {
|
||||
$method = sprintf('set%s', $need);
|
||||
if(method_exists($i18n, $method)) {
|
||||
if (method_exists($i18n, $method)) {
|
||||
$i18n->$method('DEFAULT ' . strtoupper($need));
|
||||
} else {
|
||||
// @todo throw sg ?
|
||||
|
||||
@@ -25,17 +25,16 @@ namespace Thelia\Tools;
|
||||
|
||||
class Image
|
||||
{
|
||||
static public function isImage($filePath, $allowedImageTypes = null)
|
||||
public static function isImage($filePath, $allowedImageTypes = null)
|
||||
{
|
||||
$imageFile = getimagesize($filePath);
|
||||
$imageType = $imageFile[2];
|
||||
|
||||
if(!is_array($allowedImageTypes) && $imageType != IMAGETYPE_UNKNOWN) {
|
||||
if (!is_array($allowedImageTypes) && $imageType != IMAGETYPE_UNKNOWN) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if(in_array($imageType , $allowedImageTypes))
|
||||
{
|
||||
if (in_array($imageType , $allowedImageTypes)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@ class URL
|
||||
|
||||
$schemeAuthority = "$scheme://$host"."$port";
|
||||
}
|
||||
|
||||
return $schemeAuthority.$this->requestContext->getBaseUrl();
|
||||
}
|
||||
|
||||
@@ -240,7 +241,7 @@ class URL
|
||||
} else {
|
||||
$allParametersWithoutView = $request->query->all();
|
||||
$view = $request->attributes->get('_view');
|
||||
if(isset($allOtherParameters['view'])) {
|
||||
if (isset($allOtherParameters['view'])) {
|
||||
unset($allOtherParameters['view']);
|
||||
}
|
||||
$this->retriever->rewrittenUrl = null;
|
||||
|
||||
Reference in New Issue
Block a user