diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Root.php b/lib/Alchemy/Phrasea/Controller/Admin/Root.php
index 9874eadfc0..51e1dd9e0e 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/Root.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/Root.php
@@ -30,11 +30,11 @@ class Root implements ControllerProviderInterface
$controllers = $app['controllers_factory'];
- $controllers->before(function(Request $request) use ($app) {
+ $controllers->before(function (Request $request) use ($app) {
$app['firewall']->requireAccessToModule('admin');
});
- $controllers->get('/', function(Application $app, Request $request) {
+ $controllers->get('/', function (Application $app, Request $request) {
try {
\Session_Logger::updateClientInfos($app, 3);
} catch (SessionNotFound $e) {
@@ -315,7 +315,7 @@ class Root implements ControllerProviderInterface
->assert('bit', '\d+')
->bind('database_display_statusbit_form');
- $controllers->post('/statusbit/{databox_id}/status/{bit}/delete/', function(Application $app, Request $request, $databox_id, $bit) {
+ $controllers->post('/statusbit/{databox_id}/status/{bit}/delete/', function (Application $app, Request $request, $databox_id, $bit) {
if (!$request->isXmlHttpRequest() || !array_key_exists($request->getMimeType('json'), array_flip($request->getAcceptableContentTypes()))) {
$app->abort(400, _('Bad request format, only JSON is allowed'));
}
@@ -338,7 +338,7 @@ class Root implements ControllerProviderInterface
->assert('databox_id', '\d+')
->assert('bit', '\d+');
- $controllers->post('/statusbit/{databox_id}/status/{bit}/', function(Application $app, Request $request, $databox_id, $bit) {
+ $controllers->post('/statusbit/{databox_id}/status/{bit}/', function (Application $app, Request $request, $databox_id, $bit) {
if (!$app['acl']->get($app['authentication']->getUser())->has_right_on_sbas($databox_id, 'bas_modify_struct')) {
$app->abort(403);
}
diff --git a/lib/Alchemy/Phrasea/Controller/Lightbox.php b/lib/Alchemy/Phrasea/Controller/Lightbox.php
index 9d727b8808..868ce57ec2 100644
--- a/lib/Alchemy/Phrasea/Controller/Lightbox.php
+++ b/lib/Alchemy/Phrasea/Controller/Lightbox.php
@@ -331,7 +331,6 @@ class Lightbox implements ControllerProviderInterface
->assert('entry_id', '\d+');
$controllers->get('/ajax/LOAD_REPORT/{basket}/', function (SilexApplication $app, Basket $basket) {
-
return new Response($app['twig']->render('lightbox/basket_content_report.html.twig', array('basket' => $basket)));
})
->bind('lightbox_ajax_report')
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Feed.php b/lib/Alchemy/Phrasea/Controller/Prod/Feed.php
index 36372043eb..faf317714f 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Feed.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Feed.php
@@ -205,7 +205,7 @@ class Feed implements ControllerProviderInterface
$app['firewall']->requireRight('bas_chupub');
});
- $controllers->get('/', function(Application $app, Request $request) {
+ $controllers->get('/', function (Application $app, Request $request) {
$request = $app['request'];
$page = (int) $request->query->get('page');
$page = $page > 0 ? $page : 1;
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Upload.php b/lib/Alchemy/Phrasea/Controller/Prod/Upload.php
index 7486df99fb..f2225fc90c 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Upload.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Upload.php
@@ -269,7 +269,7 @@ class Upload implements ControllerProviderInterface
/**
* Get current user's granted collections where he can upload
*
- * @param \ACL $acl The user's ACL.
+ * @param \ACL $acl The user's ACL.
*
* @return array
*/
diff --git a/lib/Alchemy/Phrasea/Core/Provider/CacheServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/CacheServiceProvider.php
index acddd5ad05..ec21c105ab 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/CacheServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/CacheServiceProvider.php
@@ -15,7 +15,6 @@ use Alchemy\Phrasea\Cache\Manager as CacheManager;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Alchemy\Phrasea\Core\Configuration\Compiler;
-use Alchemy\Phrasea\Cache\ConnectionFactory;
use Alchemy\Phrasea\Cache\Factory;
class CacheServiceProvider implements ServiceProviderInterface
diff --git a/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php
index 9f607969eb..13b952abce 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php
@@ -39,7 +39,7 @@ class PhraseanetServiceProvider implements ServiceProviderInterface
return $events;
});
- $app['acl'] = $app->share(function(SilexApplication $app) {
+ $app['acl'] = $app->share(function (SilexApplication $app) {
return new ACLProvider($app);
});
}
diff --git a/lib/Alchemy/Phrasea/Feed/Aggregate.php b/lib/Alchemy/Phrasea/Feed/Aggregate.php
index 65cbb36e9c..a7b2d062fb 100644
--- a/lib/Alchemy/Phrasea/Feed/Aggregate.php
+++ b/lib/Alchemy/Phrasea/Feed/Aggregate.php
@@ -12,7 +12,6 @@
namespace Alchemy\Phrasea\Feed;
use Alchemy\Phrasea\Application;
-use Alchemy\Phrasea\Authentication\ACLProvider;
use Alchemy\Phrasea\Exception\LogicException;
use Doctrine\ORM\EntityManager;
use Alchemy\Phrasea\Model\Entities\AggregateToken;
diff --git a/lib/Alchemy/Phrasea/Model/Manipulator/ACLManipulator.php b/lib/Alchemy/Phrasea/Model/Manipulator/ACLManipulator.php
index 640248f883..8b47cab291 100644
--- a/lib/Alchemy/Phrasea/Model/Manipulator/ACLManipulator.php
+++ b/lib/Alchemy/Phrasea/Model/Manipulator/ACLManipulator.php
@@ -39,13 +39,13 @@ class ACLManipulator implements ManipulatorInterface
/**
* Resets rights for users.
*
- * @param User_Adapter $user
+ * @param User_Adapter $user
*
* @throws InvalidArgumentException
*/
public function resetAdminRights($users)
{
- foreach($this->makeTraversable($users) as $user) {
+ foreach ($this->makeTraversable($users) as $user) {
$this->doResetAdminRights($user);
}
}
diff --git a/lib/Alchemy/Phrasea/Model/Manipulator/UserManipulator.php b/lib/Alchemy/Phrasea/Model/Manipulator/UserManipulator.php
index bab96c566a..5edf389598 100644
--- a/lib/Alchemy/Phrasea/Model/Manipulator/UserManipulator.php
+++ b/lib/Alchemy/Phrasea/Model/Manipulator/UserManipulator.php
@@ -180,9 +180,9 @@ class UserManipulator implements ManipulatorInterface
/**
* Sets a preference setting for a user.
*
- * @param User $user
- * @param string $name
- * @param string $value
+ * @param User $user
+ * @param string $name
+ * @param string $value
*/
public function addUserSetting(User $user, $name, $value)
{
@@ -198,9 +198,9 @@ class UserManipulator implements ManipulatorInterface
/**
* Sets a notification setting for a user.
*
- * @param User $user
- * @param string $name
- * @param string $value
+ * @param User $user
+ * @param string $name
+ * @param string $value
*/
public function addNotificationSetting(User $user, $name, $value)
{
@@ -216,7 +216,7 @@ class UserManipulator implements ManipulatorInterface
/**
* Logs a user query.
*
- * @param User $user
+ * @param User $user
* @param string $query
*/
public function logQuery(User $user, $query)
diff --git a/lib/Alchemy/Phrasea/Model/Repositories/BasketRepository.php b/lib/Alchemy/Phrasea/Model/Repositories/BasketRepository.php
index 08e0d1bcc6..dd9595f534 100644
--- a/lib/Alchemy/Phrasea/Model/Repositories/BasketRepository.php
+++ b/lib/Alchemy/Phrasea/Model/Repositories/BasketRepository.php
@@ -11,11 +11,8 @@
namespace Alchemy\Phrasea\Model\Repositories;
-use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Model\Entities\Basket;
use Doctrine\ORM\EntityRepository;
-use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
/**
*
diff --git a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php
index 74335dc2b9..62b2b4b115 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php
@@ -646,7 +646,7 @@ class SearchEngineOptions
}
if ($app['authentication']->isAuthenticated() && $app['acl']->get($app['authentication']->getUser())->has_right('modifyrecord')) {
- $BF = array_filter($bas, function( $collection) use ($app) {
+ $BF = array_filter($bas, function ($collection) use ($app) {
return $app['acl']->get($app['authentication']->getUser())->has_right_on_base($collection->get_base_id(), 'canmodifrecord');
});
diff --git a/lib/Alchemy/Phrasea/TaskManager/Log/LogFileFactory.php b/lib/Alchemy/Phrasea/TaskManager/Log/LogFileFactory.php
index 8194dc62dd..c7bf86bff5 100644
--- a/lib/Alchemy/Phrasea/TaskManager/Log/LogFileFactory.php
+++ b/lib/Alchemy/Phrasea/TaskManager/Log/LogFileFactory.php
@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\TaskManager\Log;
use Alchemy\Phrasea\Model\Entities\Task;
-class LogFilefactory
+class LogFileFactory
{
private $root;
diff --git a/lib/classes/module/console/checkExtension.php b/lib/classes/module/console/checkExtension.php
index b2c58d4c80..ff4b9dee89 100644
--- a/lib/classes/module/console/checkExtension.php
+++ b/lib/classes/module/console/checkExtension.php
@@ -202,11 +202,9 @@ class module_console_checkExtension extends Command
return 1;
}
-
// test disconnected mode if available
// prepare the test before closing session
- if(function_exists("phrasea_public_query"))
- {
+ if (function_exists("phrasea_public_query")) {
// fill an array for each sbas to query
$tbases = array();
foreach ($phSession["bases"] as $phbase) {
@@ -231,7 +229,6 @@ class module_console_checkExtension extends Command
}
}
-
$output->writeln("\n-- phrasea_close_session --");
$rs = phrasea_close_session($sessid);
@@ -244,11 +241,8 @@ class module_console_checkExtension extends Command
return 1;
}
-
-
// session is closed, test disconnected mode if available
- if(function_exists("phrasea_public_query"))
- {
+ if (function_exists("phrasea_public_query")) {
$output->writeln("\n-- phrasea_public_query(...0, 5,...) --");
$ret = phrasea_public_query(
@@ -262,7 +256,7 @@ class module_console_checkExtension extends Command
, true // verbose output (chrono, sql...)
);
- if(is_array($ret) && array_key_exists("results", $ret) && is_array($ret["results"])) {
+ if (is_array($ret) && array_key_exists("results", $ret) && is_array($ret["results"])) {
$output->writeln( sprintf("Succes ! returned %d answers", count($ret["results"])) );
} else {
$output->writeln("Failed ! ");
@@ -270,9 +264,7 @@ class module_console_checkExtension extends Command
return 1;
}
-
- foreach($ret['results'] as $result)
- {
+ foreach ($ret['results'] as $result) {
$sbid = $result["sbid"];
$rid = $result["rid"];
$q = $tbases["S".$sbid]["arrayq"]; // query tree
diff --git a/tests/Alchemy/Tests/Phrasea/Authentication/ACLProviderTest.php b/tests/Alchemy/Tests/Phrasea/Authentication/ACLProviderTest.php
index 2c2fdc4310..e53a6011ac 100644
--- a/tests/Alchemy/Tests/Phrasea/Authentication/ACLProviderTest.php
+++ b/tests/Alchemy/Tests/Phrasea/Authentication/ACLProviderTest.php
@@ -2,9 +2,6 @@
namespace Alchemy\Tests\Phrasea\Authentication;
-use Alchemy\Phrasea\Application;
-use Alchemy\Phrasea\Authentication\ACLProvider;
-
class ACLProviderTest extends \PhraseanetPHPUnitAbstract
{
public function testGetACL()
diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Prod/ShareTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Prod/ShareTest.php
index f13afb250a..822e4843d4 100644
--- a/tests/Alchemy/Tests/Phrasea/Controller/Prod/ShareTest.php
+++ b/tests/Alchemy/Tests/Phrasea/Controller/Prod/ShareTest.php
@@ -40,7 +40,6 @@ class ShareTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
->method('has_access_to_subdef')
->will($this->returnValue(true));
-
$aclProvider = $this->getMockBuilder('Alchemy\Phrasea\Authentication\ACLProvider')
->disableOriginalConstructor()
->getMock();
@@ -82,7 +81,6 @@ class ShareTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
->method('has_access_to_subdef')
->will($this->returnValue(false));
-
$aclProvider = $this->getMockBuilder('Alchemy\Phrasea\Authentication\ACLProvider')
->disableOriginalConstructor()
->getMock();
diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Root/LoginTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Root/LoginTest.php
index efffe944a5..a8597adc28 100644
--- a/tests/Alchemy/Tests/Phrasea/Controller/Root/LoginTest.php
+++ b/tests/Alchemy/Tests/Phrasea/Controller/Root/LoginTest.php
@@ -1810,7 +1810,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
foreach (self::$DI['app']['phraseanet.appbox']->get_databoxes() as $databox) {
self::$termsOfUse[$databox->get_sbas_id()] = $databox->get_cgus();
- foreach( self::$termsOfUse[$databox->get_sbas_id()]as $lng => $tou) {
+ foreach ( self::$termsOfUse[$databox->get_sbas_id()]as $lng => $tou) {
$databox->update_cgus($lng, '', false);
}
}
@@ -1824,7 +1824,7 @@ class LoginTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
foreach (self::$DI['app']['phraseanet.appbox']->get_databoxes() as $databox) {
self::$termsOfUse[$databox->get_sbas_id()] = $databox->get_cgus();
- foreach( self::$termsOfUse[$databox->get_sbas_id()]as $lng => $tou) {
+ foreach ( self::$termsOfUse[$databox->get_sbas_id()]as $lng => $tou) {
$databox->update_cgus($lng, 'something', false);
}
}
diff --git a/tests/Alchemy/Tests/Phrasea/Controller/SetupTest.php b/tests/Alchemy/Tests/Phrasea/Controller/SetupTest.php
index b2ce3627b0..afd20b5bdf 100644
--- a/tests/Alchemy/Tests/Phrasea/Controller/SetupTest.php
+++ b/tests/Alchemy/Tests/Phrasea/Controller/SetupTest.php
@@ -113,7 +113,6 @@ class SetupTest extends \PhraseanetWebTestCaseAbstract
->method('get_granted_sbas')
->will($this->returnValue(array()));
-
$aclProvider = $this->getMockBuilder('Alchemy\Phrasea\Authentication\ACLProvider')
->disableOriginalConstructor()
->getMock();
diff --git a/tests/Alchemy/Tests/Phrasea/Core/Middleware/MiddlewareProviderTestCase.php b/tests/Alchemy/Tests/Phrasea/Core/Middleware/MiddlewareProviderTestCase.php
index 46bbc2436b..d5b8d06c46 100644
--- a/tests/Alchemy/Tests/Phrasea/Core/Middleware/MiddlewareProviderTestCase.php
+++ b/tests/Alchemy/Tests/Phrasea/Core/Middleware/MiddlewareProviderTestCase.php
@@ -2,9 +2,6 @@
namespace Alchemy\Tests\Phrasea\Core\Middleware;
-use Alchemy\Phrasea\Application;
-use Symfony\Component\HttpFoundation\Request;
-
abstract class MiddlewareProviderTestCase extends \PhraseanetPHPUnitAbstract
{
/**
diff --git a/tests/Alchemy/Tests/Phrasea/Core/Provider/ACLServiceProviderTest.php b/tests/Alchemy/Tests/Phrasea/Core/Provider/ACLServiceProviderTest.php
index 45f60539e2..648ff2235a 100644
--- a/tests/Alchemy/Tests/Phrasea/Core/Provider/ACLServiceProviderTest.php
+++ b/tests/Alchemy/Tests/Phrasea/Core/Provider/ACLServiceProviderTest.php
@@ -2,12 +2,6 @@
namespace Alchemy\Tests\Phrasea\Core\Provider;
-use Alchemy\Phrasea\Application as PhraseaApplication;
-use Alchemy\Phrasea\Core\Provider\TokensServiceProvider;
-use Alchemy\Phrasea\Core\Provider\AuthenticationManagerServiceProvider;
-use Alchemy\Phrasea\Core\Provider\ConfigurationServiceProvider;
-use Silex\Application;
-
class ACLServiceProvidertest extends ServiceProviderTestCase
{
public function provideServiceDescription()
diff --git a/tests/Alchemy/Tests/Phrasea/Model/Converter/BasketConverterTest.php b/tests/Alchemy/Tests/Phrasea/Model/Converter/BasketConverterTest.php
index ab48be7c4e..d5641c29c8 100644
--- a/tests/Alchemy/Tests/Phrasea/Model/Converter/BasketConverterTest.php
+++ b/tests/Alchemy/Tests/Phrasea/Model/Converter/BasketConverterTest.php
@@ -3,7 +3,6 @@
namespace Alchemy\Phrasea\Model\Converter;
use Alchemy\Phrasea\Model\Converter\BasketConverter;
-use Alchemy\Phrasea\Model\Entities\Task;
class BasketConverterTest extends \PhraseanetPHPUnitAbstract
{
diff --git a/tests/Alchemy/Tests/Phrasea/Model/Manipulator/ACLManipulatorTest.php b/tests/Alchemy/Tests/Phrasea/Model/Manipulator/ACLManipulatorTest.php
index fad499c8a8..be615b3e05 100644
--- a/tests/Alchemy/Tests/Phrasea/Model/Manipulator/ACLManipulatorTest.php
+++ b/tests/Alchemy/Tests/Phrasea/Model/Manipulator/ACLManipulatorTest.php
@@ -11,8 +11,6 @@
namespace Alchemy\Tests\Phrasea\Model\Manipulator;
-use Alchemy\Phrasea\Exception\InvalidArgumentException;
-
class ACLManipulatorTest extends \PhraseanetPHPUnitAbstract
{
public function testResetAdminRights()
@@ -23,7 +21,7 @@ class ACLManipulatorTest extends \PhraseanetPHPUnitAbstract
$databoxId = null;
$baseId = null;
- foreach(self::$DI['app']['phraseanet.appbox']->get_databoxes() as $databox) {
+ foreach (self::$DI['app']['phraseanet.appbox']->get_databoxes() as $databox) {
$databoxId = $databox->get_sbas_id();
$acl->update_rights_to_sbas($databoxId, array(
@@ -33,7 +31,7 @@ class ACLManipulatorTest extends \PhraseanetPHPUnitAbstract
'bas_chupub' => '0'
));
- foreach($databox->get_collections() as $collection) {
+ foreach ($databox->get_collections() as $collection) {
$baseId = $collection->get_base_id();
$acl->set_limits($baseId, true);
$acl->set_masks_on_base($baseId, '1', '1', '1', '1');
diff --git a/tests/classes/api/v1/api_v1_adapterTest.php b/tests/classes/api/v1/api_v1_adapterTest.php
index 7b31e20c23..534694b31a 100644
--- a/tests/classes/api/v1/api_v1_adapterTest.php
+++ b/tests/classes/api/v1/api_v1_adapterTest.php
@@ -2,7 +2,6 @@
use Alchemy\Phrasea\Border\File as BorderFile;
use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class API_V1_adapterTest extends PhraseanetPHPUnitAuthenticatedAbstract
{