mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +00:00
Fix CS
This commit is contained in:
@@ -12,7 +12,6 @@
|
|||||||
namespace Alchemy\Phrasea\Command\Developer;
|
namespace Alchemy\Phrasea\Command\Developer;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Command\Command;
|
use Alchemy\Phrasea\Command\Command;
|
||||||
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
|
||||||
use Alchemy\BinaryDriver\Exception\ExecutionFailureException;
|
use Alchemy\BinaryDriver\Exception\ExecutionFailureException;
|
||||||
use Alchemy\Phrasea\Exception\RuntimeException;
|
use Alchemy\Phrasea\Exception\RuntimeException;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
|
@@ -4,16 +4,7 @@ namespace Alchemy\Phrasea\Command\Developer;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Command\Command;
|
use Alchemy\Phrasea\Command\Command;
|
||||||
use Alchemy\Phrasea\Core\Provider\ORMServiceProvider;
|
use Alchemy\Phrasea\Core\Provider\ORMServiceProvider;
|
||||||
use Doctrine\ORM\Tools\Setup;
|
|
||||||
use Doctrine\ORM\Configuration as ORMConfiguration;
|
|
||||||
use Doctrine\ORM\Tools\SchemaTool;
|
use Doctrine\ORM\Tools\SchemaTool;
|
||||||
use Doctrine\ORM\EntityManager;
|
|
||||||
use Doctrine\Common\Annotations\AnnotationReader;
|
|
||||||
use Doctrine\Common\Annotations\AnnotationRegistry;
|
|
||||||
use Doctrine\Common\Annotations\FileCacheReader;
|
|
||||||
use Doctrine\Common\EventManager;
|
|
||||||
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
|
|
||||||
use Doctrine\ORM\Mapping\Driver\DriverChain;
|
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Filesystem\Filesystem;
|
use Symfony\Component\Filesystem\Filesystem;
|
||||||
|
@@ -1091,7 +1091,7 @@ class Databox implements ControllerProviderInterface
|
|||||||
'medias' => array()
|
'medias' => array()
|
||||||
);
|
);
|
||||||
|
|
||||||
foreach($colDetails as $subdefName => $subdefDetails) {
|
foreach ($colDetails as $subdefName => $subdefDetails) {
|
||||||
$details[$collName]['total_subdefs'] += $subdefDetails['n'];
|
$details[$collName]['total_subdefs'] += $subdefDetails['n'];
|
||||||
$total['total_subdefs'] += $subdefDetails['n'];
|
$total['total_subdefs'] += $subdefDetails['n'];
|
||||||
$details[$collName]['total_size'] += $subdefDetails['siz'];
|
$details[$collName]['total_size'] += $subdefDetails['siz'];
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\Controller\Admin;
|
namespace Alchemy\Phrasea\Controller\Admin;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
|
||||||
use Alchemy\Phrasea\Metadata\TagProvider;
|
use Alchemy\Phrasea\Metadata\TagProvider;
|
||||||
use Alchemy\Phrasea\Vocabulary\Controller as VocabularyController;
|
use Alchemy\Phrasea\Vocabulary\Controller as VocabularyController;
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
|
@@ -601,13 +601,14 @@ class Users implements ControllerProviderInterface
|
|||||||
$columns = array_filter($columnsSanitized, function ($columnName) use (&$out, $equivalenceToMysqlField) {
|
$columns = array_filter($columnsSanitized, function ($columnName) use (&$out, $equivalenceToMysqlField) {
|
||||||
if (!isset($equivalenceToMysqlField[$columnName])) {
|
if (!isset($equivalenceToMysqlField[$columnName])) {
|
||||||
$out['ignored_row'][] = $columnName;
|
$out['ignored_row'][] = $columnName;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
foreach($columns as $columnName) {
|
foreach ($columns as $columnName) {
|
||||||
if ($equivalenceToMysqlField[$columnName] === 'usr_login') {
|
if ($equivalenceToMysqlField[$columnName] === 'usr_login') {
|
||||||
$loginDefined = true;
|
$loginDefined = true;
|
||||||
}
|
}
|
||||||
@@ -667,7 +668,7 @@ class Users implements ControllerProviderInterface
|
|||||||
|
|
||||||
if ($mailToAdd === "") {
|
if ($mailToAdd === "") {
|
||||||
$out['errors'][] = sprintf(_("Mail line %d is empty"), $nbLine + 1);
|
$out['errors'][] = sprintf(_("Mail line %d is empty"), $nbLine + 1);
|
||||||
} else if (false !== \User_Adapter::get_usr_id_from_email($app, $mailToAdd)) {
|
} elseif (false !== \User_Adapter::get_usr_id_from_email($app, $mailToAdd)) {
|
||||||
$out['errors'][] = sprintf(_("Email '%s' for login '%s' already exists in database"), $mailToAdd, $loginToAdd);
|
$out['errors'][] = sprintf(_("Email '%s' for login '%s' already exists in database"), $mailToAdd, $loginToAdd);
|
||||||
} else {
|
} else {
|
||||||
$mailValid = true;
|
$mailValid = true;
|
||||||
|
@@ -136,8 +136,8 @@ class Session implements ControllerProviderInterface
|
|||||||
* Deletes identified session
|
* Deletes identified session
|
||||||
*
|
*
|
||||||
* @param Application $app
|
* @param Application $app
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param integer $id
|
* @param integer $id
|
||||||
*
|
*
|
||||||
* @return RedirectResponse|JsonResponse
|
* @return RedirectResponse|JsonResponse
|
||||||
*/
|
*/
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\Controller\Thesaurus;
|
namespace Alchemy\Phrasea\Controller\Thesaurus;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Silex\ControllerProviderInterface;
|
use Silex\ControllerProviderInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
namespace Alchemy\Phrasea\Core\Event\Subscriber;
|
namespace Alchemy\Phrasea\Core\Event\Subscriber;
|
||||||
|
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Alchemy\Phrasea\Application as PhraseaApplication;
|
|
||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
|
||||||
|
@@ -24,7 +24,7 @@ class MailChecker
|
|||||||
* Returns users with duplicated emails
|
* Returns users with duplicated emails
|
||||||
*
|
*
|
||||||
* @param \Application $app
|
* @param \Application $app
|
||||||
* @param string $table The table name where to look
|
* @param string $table The table name where to look
|
||||||
*
|
*
|
||||||
* @return array An array of User_Adapter
|
* @return array An array of User_Adapter
|
||||||
*/
|
*/
|
||||||
|
@@ -65,6 +65,7 @@ class BytesConverter extends \Twig_Extension
|
|||||||
return round($bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision) . ' ' . $unit[$i];
|
return round($bytes / pow(1024, ($i = floor(log($bytes, 1024)))), $precision) . ' ' . $unit[$i];
|
||||||
default:
|
default:
|
||||||
$i = array_search($suffix, $unit);
|
$i = array_search($suffix, $unit);
|
||||||
|
|
||||||
return round($bytes / pow(1024, $i), $precision) . ' ' . $unit[$i];
|
return round($bytes / pow(1024, $i), $precision) . ' ' . $unit[$i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Exception\SessionNotFound;
|
|
||||||
use Alchemy\Geonames\Exception\ExceptionInterface as GeonamesExceptionInterface;
|
use Alchemy\Geonames\Exception\ExceptionInterface as GeonamesExceptionInterface;
|
||||||
use Entities\FtpCredential;
|
use Entities\FtpCredential;
|
||||||
|
|
||||||
|
@@ -85,7 +85,7 @@ class module_console_fieldsRename extends Command
|
|||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
$data = $stmt->fetch(PDO::FETCH_ASSOC);
|
$data = $stmt->fetch(PDO::FETCH_ASSOC);
|
||||||
$stmt->closeCursor();
|
$stmt->closeCursor();
|
||||||
|
|
||||||
$total = $data['total'];
|
$total = $data['total'];
|
||||||
$start = 0;
|
$start = 0;
|
||||||
$quantity = 100;
|
$quantity = 100;
|
||||||
|
@@ -103,8 +103,7 @@ class patch_3902 implements patchInterface
|
|||||||
$user->setRequestNotificationsActivated(!!$row['request_notifications']);
|
$user->setRequestNotificationsActivated(!!$row['request_notifications']);
|
||||||
$user->setSaltedPassword(!!$row['salted_password']);
|
$user->setSaltedPassword(!!$row['salted_password']);
|
||||||
|
|
||||||
switch ($row['usr_sexe'])
|
switch ($row['usr_sexe']) {
|
||||||
{
|
|
||||||
case 0:
|
case 0:
|
||||||
$gender = User::GENDER_MISS;
|
$gender = User::GENDER_MISS;
|
||||||
break;
|
break;
|
||||||
|
@@ -917,8 +917,8 @@ abstract class task_abstract
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Configuration $config
|
* @param Configuration $config
|
||||||
* @param array $params
|
* @param array $params
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public static function getDefaultSettings(Configuration $config, array $params = array())
|
public static function getDefaultSettings(Configuration $config, array $params = array())
|
||||||
|
@@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace Alchemy\Tests\Phrasea\Controller\Prod;
|
namespace Alchemy\Tests\Phrasea\Controller\Prod;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Controller\RecordsRequest;
|
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
|
||||||
use Entities\Order;
|
use Entities\Order;
|
||||||
use Entities\OrderElement;
|
use Entities\OrderElement;
|
||||||
|
|
||||||
|
@@ -378,7 +378,7 @@ abstract class SearchEngineAbstractTest extends \PhraseanetPHPUnitAuthenticatedA
|
|||||||
foreach (Application::getAvailableLanguages() as $languageCode => $name) {
|
foreach (Application::getAvailableLanguages() as $languageCode => $name) {
|
||||||
$data = explode('_', $languageCode);
|
$data = explode('_', $languageCode);
|
||||||
$code = $data[0];
|
$code = $data[0];
|
||||||
|
|
||||||
if (!isset($examples[$code])) {
|
if (!isset($examples[$code])) {
|
||||||
$this->fail(sprintf('Missing stemm examples for language %s', $code));
|
$this->fail(sprintf('Missing stemm examples for language %s', $code));
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ class UserTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
public function testSetLocale()
|
public function testSetLocale()
|
||||||
{
|
{
|
||||||
foreach(array_keys(Application::getAvailableLanguages()) as $locale) {
|
foreach (array_keys(Application::getAvailableLanguages()) as $locale) {
|
||||||
$this->user->setLocale($locale);
|
$this->user->setLocale($locale);
|
||||||
$this->assertEquals($this->user->getLocale(), $locale);
|
$this->assertEquals($this->user->getLocale(), $locale);
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Alchemy\Phrasea\Controller\RecordsRequest;
|
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
|
||||||
|
|
||||||
class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
class record_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user