diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php index 4da2437bd5..c6cb14acc9 100644 --- a/lib/Alchemy/Phrasea/Application.php +++ b/lib/Alchemy/Phrasea/Application.php @@ -185,7 +185,7 @@ class Application extends SilexApplication $this['charset'] = 'UTF-8'; - $this['debug'] = $this->share(function(Application $app) { + $this['debug'] = $this->share(function (Application $app) { return Application::ENV_PROD !== $app->getEnvironment(); }); @@ -214,7 +214,7 @@ class Application extends SilexApplication }); $this->register(new MediaAlchemystServiceProvider()); - $this['media-alchemyst.configuration'] = $this->share(function(Application $app) { + $this['media-alchemyst.configuration'] = $this->share(function (Application $app) { $configuration = array(); foreach (array( @@ -245,7 +245,7 @@ class Application extends SilexApplication return $configuration; }); - $this['media-alchemyst.logger'] = $this->share(function(Application $app) { + $this['media-alchemyst.logger'] = $this->share(function (Application $app) { return $app['monolog']; }); @@ -351,7 +351,7 @@ class Application extends SilexApplication return $transport; }); - $this['imagine.factory'] = $this->share(function(Application $app) { + $this['imagine.factory'] = $this->share(function (Application $app) { if ($app['phraseanet.registry']->get('GV_imagine_driver') != '') { return $app['phraseanet.registry']->get('GV_imagine_driver'); } @@ -369,7 +369,7 @@ class Application extends SilexApplication }); $app = $this; - $this['phraseanet.logger'] = $this->protect(function($databox) use ($app) { + $this['phraseanet.logger'] = $this->protect(function ($databox) use ($app) { try { return \Session_Logger::load($app, $databox); } catch (\Exception_Session_LoggerNotFound $e) { @@ -377,12 +377,12 @@ class Application extends SilexApplication } }); - $this['date-formatter'] = $this->share(function(Application $app) { + $this['date-formatter'] = $this->share(function (Application $app) { return new \phraseadate($app); }); $this['xpdf.pdftotext'] = $this->share( - $this->extend('xpdf.pdftotext', function(PdfToText $pdftotext, Application $app){ + $this->extend('xpdf.pdftotext', function (PdfToText $pdftotext, Application $app) { if ($app['phraseanet.registry']->get('GV_pdfmaxpages')) { $pdftotext->setPageQuantity($app['phraseanet.registry']->get('GV_pdfmaxpages')); } @@ -392,7 +392,7 @@ class Application extends SilexApplication ); $this['dispatcher'] = $this->share( - $this->extend('dispatcher', function($dispatcher, Application $app){ + $this->extend('dispatcher', function ($dispatcher, Application $app) { $dispatcher->addListener(KernelEvents::REQUEST, array($app, 'initSession'), 254); $dispatcher->addListener(KernelEvents::RESPONSE, array($app, 'addUTF8Charset'), -128); $dispatcher->addSubscriber(new LogoutSubscriber()); @@ -542,7 +542,7 @@ class Application extends SilexApplication private function setupUrlGenerator() { - $this['url_generator'] = $this->share($this->extend('url_generator', function($urlGenerator, $app) { + $this['url_generator'] = $this->share($this->extend('url_generator', function ($urlGenerator, $app) { if ($app['phraseanet.configuration']->isSetup()) { $data = parse_url($app['phraseanet.configuration']['main']['servername']); diff --git a/lib/Alchemy/Phrasea/Application/Api.php b/lib/Alchemy/Phrasea/Application/Api.php index 81d73a1389..06160932b9 100644 --- a/lib/Alchemy/Phrasea/Application/Api.php +++ b/lib/Alchemy/Phrasea/Application/Api.php @@ -22,7 +22,7 @@ use Alchemy\Phrasea\Core\Event\Subscriber\ApiExceptionHandlerSubscriber; use Silex\Application as SilexApplication; use Symfony\Component\HttpFoundation\Request; -return call_user_func(function($environment = PhraseaApplication::ENV_PROD) { +return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) { $app = new PhraseaApplication($environment); $app->loadPlugins(); @@ -34,7 +34,7 @@ return call_user_func(function($environment = PhraseaApplication::ENV_PROD) { $app->register(new \API_V1_Timer()); $app['dispatcher']->dispatch(PhraseaEvents::API_LOAD_START, new ApiLoadStartEvent()); - $app->get('/api/', function(Request $request, SilexApplication $app) { + $app->get('/api/', function (Request $request, SilexApplication $app) { $apiAdapter = new \API_V1_adapter($app); $result = new \API_V1_result($app, $request, $apiAdapter); diff --git a/lib/Alchemy/Phrasea/Application/Root.php b/lib/Alchemy/Phrasea/Application/Root.php index 35a10c21dd..2a973fc148 100644 --- a/lib/Alchemy/Phrasea/Application/Root.php +++ b/lib/Alchemy/Phrasea/Application/Root.php @@ -20,7 +20,7 @@ use Alchemy\Phrasea\Core\Event\Subscriber\DebuggerSubscriber; use Silex\Provider\WebProfilerServiceProvider; use Symfony\Component\HttpFoundation\Request; -return call_user_func(function($environment = PhraseaApplication::ENV_PROD) { +return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) { $app = new PhraseaApplication($environment); $app->loadPlugins(); @@ -57,7 +57,7 @@ return call_user_func(function($environment = PhraseaApplication::ENV_PROD) { } $app['dispatcher'] = $app->share( - $app->extend('dispatcher', function($dispatcher, PhraseaApplication $app){ + $app->extend('dispatcher', function ($dispatcher, PhraseaApplication $app) { $dispatcher->addSubscriber(new BridgeExceptionSubscriber($app)); $dispatcher->addSubscriber(new FirewallSubscriber()); $dispatcher->addSubscriber(new JsonRequestSubscriber()); diff --git a/lib/Alchemy/Phrasea/CLI.php b/lib/Alchemy/Phrasea/CLI.php index 941da7b16a..8032c144fb 100644 --- a/lib/Alchemy/Phrasea/CLI.php +++ b/lib/Alchemy/Phrasea/CLI.php @@ -48,7 +48,7 @@ class CLI extends Application return new Console\Application($name, $version); }); - $this['dispatcher']->addListener('phraseanet.notification.sent', function() use ($app) { + $this['dispatcher']->addListener('phraseanet.notification.sent', function () use ($app) { $app['swiftmailer.spooltransport']->getSpool()->flushQueue($app['swiftmailer.transport']); }); diff --git a/lib/Alchemy/Phrasea/Command/Command.php b/lib/Alchemy/Phrasea/Command/Command.php index 8f93434b91..95141285a5 100644 --- a/lib/Alchemy/Phrasea/Command/Command.php +++ b/lib/Alchemy/Phrasea/Command/Command.php @@ -55,14 +55,14 @@ abstract class Command extends SymfoCommand implements CommandInterface $handler = new StreamHandler('php://stdout', $level); $this->container['monolog'] = $this->container->share( - $this->container->extend('monolog', function($logger, $app) use ($handler) { + $this->container->extend('monolog', function ($logger, $app) use ($handler) { $logger->pushHandler($handler); return $logger; }) ); $this->container['task-manager.logger'] = $this->container->share( - $this->container->extend('task-manager.logger', function($logger, $app) use ($handler) { + $this->container->extend('task-manager.logger', function ($logger, $app) use ($handler) { $logger->pushHandler($handler); return $logger; diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Collection.php b/lib/Alchemy/Phrasea/Controller/Admin/Collection.php index 88b11a0136..3d28155a17 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Collection.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Collection.php @@ -26,7 +26,7 @@ class Collection implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAccessToModule('admin') ->requireRightOnBase($app['request']->attributes->get('bas_id'), 'canadmin'); }); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php b/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php index 43ccba1c93..d3217d5aab 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php @@ -24,7 +24,7 @@ class ConnectedUsers implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAccessToModule('Admin'); }); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Dashboard.php b/lib/Alchemy/Phrasea/Controller/Admin/Dashboard.php index 484b1e976e..e64b3dd740 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Dashboard.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Dashboard.php @@ -32,7 +32,7 @@ class Dashboard implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAdmin(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Databox.php b/lib/Alchemy/Phrasea/Controller/Admin/Databox.php index ed8a2fac87..3cc89a33f8 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Databox.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Databox.php @@ -29,7 +29,7 @@ class Databox implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAccessToModule('admin') ->requireAccessToSbas($request->attributes->get('databox_id')); }); @@ -40,117 +40,117 @@ class Databox implements ControllerProviderInterface $controllers->post('/{databox_id}/delete/', 'controller.admin.databox:deleteBase') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_delete'); $controllers->post('/{databox_id}/unmount/', 'controller.admin.databox:unmountDatabase') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_unmount'); $controllers->post('/{databox_id}/empty/', 'controller.admin.databox:emptyDatabase') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_empty'); $controllers->get('/{databox_id}/collections/order/', 'controller.admin.databox:getReorder') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_display_collections_order'); $controllers->post('/{databox_id}/collections/order/', 'controller.admin.databox:setReorder') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_submit_collections_order'); $controllers->post('/{databox_id}/collection/', 'controller.admin.databox:createCollection') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); }) ->bind('admin_database_submit_collection'); $controllers->get('/{databox_id}/cgus/', 'controller.admin.databox:getDatabaseCGU') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_modify_struct'); })->bind('admin_database_display_cgus'); $controllers->post('/{databox_id}/labels/', 'controller.admin.databox:setLabels') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_databox_labels'); $controllers->post('/{databox_id}/cgus/', 'controller.admin.databox:updateDatabaseCGU') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_modify_struct'); })->bind('admin_database_submit_cgus'); $controllers->get('/{databox_id}/informations/documents/', 'controller.admin.databox:progressBarInfos') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_display_document_information'); $controllers->get('/{databox_id}/informations/details/', 'controller.admin.databox:getDetails') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_display_document_details'); $controllers->post('/{databox_id}/collection/{collection_id}/mount/', 'controller.admin.databox:mountCollection') ->assert('databox_id', '\d+') ->assert('collection_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_mount_collection'); $controllers->get('/{databox_id}/collection/', 'controller.admin.databox:getNewCollection') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_display_new_collection_form'); $controllers->post('/{databox_id}/logo/', 'controller.admin.databox:sendLogoPdf') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_submit_logo'); $controllers->post('/{databox_id}/logo/delete/', 'controller.admin.databox:deleteLogoPdf') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_delete_logo'); $controllers->post('/{databox_id}/clear-logs/', 'controller.admin.databox:clearLogs') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_clear_logs'); $controllers->post('/{databox_id}/reindex/', 'controller.admin.databox:reindex') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_reindex'); $controllers->post('/{databox_id}/indexable/', 'controller.admin.databox:setIndexable') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_set_indexable'); $controllers->post('/{databox_id}/view-name/', 'controller.admin.databox:changeViewName') ->assert('databox_id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas($request->attributes->get('databox_id'), 'bas_manage'); })->bind('admin_database_rename'); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php b/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php index 0761f55319..4ba18d1140 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php @@ -31,7 +31,7 @@ class Databoxes implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAccessToModule('admin'); }); @@ -40,19 +40,19 @@ class Databoxes implements ControllerProviderInterface $controllers->post('/', 'controller.admin.databoxes:createDatabase') ->bind('admin_database_new') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireAdmin(); }); $controllers->post('/mount/', 'controller.admin.databoxes:databaseMount') ->bind('admin_database_mount') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireAdmin(); }); $controllers->post('/upgrade/', 'controller.admin.databoxes:databasesUpgrade') ->bind('admin_databases_upgrade') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireAdmin(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Fields.php b/lib/Alchemy/Phrasea/Controller/Admin/Fields.php index f73207d17a..90d0889e4a 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Fields.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Fields.php @@ -27,7 +27,7 @@ class Fields implements ControllerProviderInterface $app['admin.fields.controller'] = $this; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall'] ->requireAccessToModule('admin') ->requireRight('bas_modify_struct'); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Root.php b/lib/Alchemy/Phrasea/Controller/Admin/Root.php index 3e926f9647..fab9bd3723 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) { @@ -102,7 +102,7 @@ class Root implements ControllerProviderInterface )); })->bind('admin'); - $controllers->get('/tree/', function(Application $app, Request $request) { + $controllers->get('/tree/', function (Application $app, Request $request) { try { \Session_Logger::updateClientInfos($app, 3); } catch (SessionNotFound $e) { @@ -162,7 +162,7 @@ class Root implements ControllerProviderInterface return $app['twig']->render('admin/tree.html.twig', $params); })->bind('admin_display_tree'); - $controllers->get('/test-paths/', function(Application $app, Request $request) { + $controllers->get('/test-paths/', function (Application $app, Request $request) { if (!$request->isXmlHttpRequest() || !array_key_exists($request->getMimeType('json'), array_flip($request->getAcceptableContentTypes()))) { $app->abort(400, _('Bad request format, only JSON is allowed')); @@ -196,7 +196,7 @@ class Root implements ControllerProviderInterface }) ->bind('admin_test_paths'); - $controllers->get('/structure/{databox_id}/', function(Application $app, Request $request, $databox_id) { + $controllers->get('/structure/{databox_id}/', function (Application $app, Request $request, $databox_id) { if (!$app['authentication']->getUser()->ACL()->has_right_on_sbas($databox_id, 'bas_modify_struct')) { $app->abort(403); } @@ -223,7 +223,7 @@ class Root implements ControllerProviderInterface })->assert('databox_id', '\d+') ->bind('database_display_stucture'); - $controllers->post('/structure/{databox_id}/', function(Application $app, Request $request, $databox_id) { + $controllers->post('/structure/{databox_id}/', function (Application $app, Request $request, $databox_id) { if (!$app['authentication']->getUser()->ACL()->has_right_on_sbas($databox_id, 'bas_modify_struct')) { $app->abort(403); } @@ -249,7 +249,7 @@ class Root implements ControllerProviderInterface })->assert('databox_id', '\d+') ->bind('database_submit_stucture'); - $controllers->get('/statusbit/{databox_id}/', function(Application $app, Request $request, $databox_id) { + $controllers->get('/statusbit/{databox_id}/', function (Application $app, Request $request, $databox_id) { if (!$app['authentication']->getUser()->ACL()->has_right_on_sbas($databox_id, 'bas_modify_struct')) { $app->abort(403); } @@ -260,7 +260,7 @@ class Root implements ControllerProviderInterface })->assert('databox_id', '\d+') ->bind('database_display_statusbit'); - $controllers->get('/statusbit/{databox_id}/status/{bit}/', function(Application $app, Request $request, $databox_id, $bit) { + $controllers->get('/statusbit/{databox_id}/status/{bit}/', function (Application $app, Request $request, $databox_id, $bit) { if (!$app['authentication']->getUser()->ACL()->has_right_on_sbas($databox_id, 'bas_modify_struct')) { $app->abort(403); } @@ -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['authentication']->getUser()->ACL()->has_right_on_sbas($databox_id, 'bas_modify_struct')) { $app->abort(403); } diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Setup.php b/lib/Alchemy/Phrasea/Controller/Admin/Setup.php index d4c2724ec3..29351a180a 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Setup.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Setup.php @@ -36,7 +36,7 @@ class Setup implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAdmin(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php b/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php index 2e5d72616d..32db55af72 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php @@ -28,12 +28,12 @@ class Subdefs implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAccessToModule('admin') ->requireRightOnSbas($request->attributes->get('sbas_id'), 'bas_modify_struct'); }); - $controllers->get('/{sbas_id}/', function(Application $app, $sbas_id) { + $controllers->get('/{sbas_id}/', function (Application $app, $sbas_id) { $databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id); return $app['twig']->render('admin/subdefs.html.twig', array( @@ -44,7 +44,7 @@ class Subdefs implements ControllerProviderInterface ->bind('admin_subdefs_subdef') ->assert('sbas_id', '\d+'); - $controllers->post('/{sbas_id}/', function(Application $app, Request $request, $sbas_id) { + $controllers->post('/{sbas_id}/', function (Application $app, Request $request, $sbas_id) { $delete_subdef = $request->request->get('delete_subdef'); $toadd_subdef = $request->request->get('add_subdef'); $Parmsubdefs = $request->request->get('subdefs', array()); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Users.php b/lib/Alchemy/Phrasea/Controller/Admin/Users.php index e59e8fd352..224b2f8eba 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Users.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Users.php @@ -31,24 +31,24 @@ class Users implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAccessToModule('admin') ->requireRight('manageusers'); }); - $controllers->post('/rights/', function(Application $app) { + $controllers->post('/rights/', function (Application $app) { $rights = new UserHelper\Edit($app, $app['request']); return $app['twig']->render('admin/editusers.html.twig', $rights->get_users_rights()); }); - $controllers->get('/rights/', function(Application $app) { + $controllers->get('/rights/', function (Application $app) { $rights = new UserHelper\Edit($app, $app['request']); return $app['twig']->render('admin/editusers.html.twig', $rights->get_users_rights()); }); - $controllers->post('/rights/reset/', function(Application $app, Request $request) { + $controllers->post('/rights/reset/', function (Application $app, Request $request) { try { $datas = array('error' => false); @@ -62,14 +62,14 @@ class Users implements ControllerProviderInterface return $app->json($datas); })->bind('admin_users_rights_reset'); - $controllers->post('/delete/', function(Application $app) { + $controllers->post('/delete/', function (Application $app) { $module = new UserHelper\Edit($app, $app['request']); $module->delete_users(); return $app->redirectPath('admin_users_search'); }); - $controllers->post('/rights/apply/', function(Application $app) { + $controllers->post('/rights/apply/', function (Application $app) { $datas = array('error' => true); try { @@ -90,58 +90,58 @@ class Users implements ControllerProviderInterface return $app->json($datas); })->bind('admin_users_rights_apply'); - $controllers->post('/rights/quotas/', function(Application $app) { + $controllers->post('/rights/quotas/', function (Application $app) { $rights = new UserHelper\Edit($app, $app['request']); return $app['twig']->render('admin/editusers_quotas.html.twig', $rights->get_quotas()); }); - $controllers->post('/rights/quotas/apply/', function(Application $app) { + $controllers->post('/rights/quotas/apply/', function (Application $app) { $rights = new UserHelper\Edit($app, $app['request']); $rights->apply_quotas(); return $app->json(array('message' => '', 'error' => false)); }); - $controllers->post('/rights/time/', function(Application $app) { + $controllers->post('/rights/time/', function (Application $app) { $rights = new UserHelper\Edit($app, $app['request']); return $app['twig']->render('admin/editusers_timelimit.html.twig', $rights->get_time()); }); - $controllers->post('/rights/time/sbas/', function(Application $app) { + $controllers->post('/rights/time/sbas/', function (Application $app) { $rights = new UserHelper\Edit($app, $app['request']); return $app['twig']->render('admin/editusers_timelimit_sbas.html.twig', $rights->get_time_sbas()); }); - $controllers->post('/rights/time/apply/', function(Application $app) { + $controllers->post('/rights/time/apply/', function (Application $app) { $rights = new UserHelper\Edit($app, $app['request']); $rights->apply_time(); return $app->json(array('message' => '', 'error' => false)); }); - $controllers->post('/rights/masks/', function(Application $app) { + $controllers->post('/rights/masks/', function (Application $app) { $rights = new UserHelper\Edit($app, $app['request']); return $app['twig']->render('admin/editusers_masks.html.twig', $rights->get_masks()); }); - $controllers->post('/rights/masks/apply/', function(Application $app) { + $controllers->post('/rights/masks/apply/', function (Application $app) { $rights = new UserHelper\Edit($app, $app['request']); $rights->apply_masks(); return $app->json(array('message' => '', 'error' => false)); }); - $controllers->match('/search/', function(Application $app) { + $controllers->match('/search/', function (Application $app) { $users = new UserHelper\Manage($app, $app['request']); return $app['twig']->render('admin/users.html.twig', $users->search()); })->bind('admin_users_search'); - $controllers->post('/search/export/', function() use ($app) { + $controllers->post('/search/export/', function () use ($app) { $request = $app['request']; $users = new UserHelper\Manage($app, $app['request']); @@ -197,7 +197,7 @@ class Users implements ControllerProviderInterface return $response; })->bind('admin_users_search_export'); - $controllers->post('/apply_template/', function() use ($app) { + $controllers->post('/apply_template/', function () use ($app) { $users = new UserHelper\Edit($app, $app['request']); $users->apply_template(); @@ -205,7 +205,7 @@ class Users implements ControllerProviderInterface return $app->redirectPath('admin_users_search'); })->bind('admin_users_apply_template'); - $controllers->get('/typeahead/search/', function(Application $app) { + $controllers->get('/typeahead/search/', function (Application $app) { $request = $app['request']; $user_query = new \User_Query($app); @@ -243,7 +243,7 @@ class Users implements ControllerProviderInterface return $app->json($datas); }); - $controllers->post('/create/', function(Application $app) { + $controllers->post('/create/', function (Application $app) { $datas = array('error' => false, 'message' => '', 'data' => null); try { @@ -266,7 +266,7 @@ class Users implements ControllerProviderInterface return $app->json($datas); }); - $controllers->post('/export/csv/', function(Application $app) { + $controllers->post('/export/csv/', function (Application $app) { $request = $app['request']; $user_query = new \User_Query($app); @@ -341,7 +341,7 @@ class Users implements ControllerProviderInterface return $response; })->bind('admin_users_export_csv'); - $controllers->get('/demands/', function(Application $app, Request $request) { + $controllers->get('/demands/', function (Application $app, Request $request) { $lastMonth = time() - (3 * 4 * 7 * 24 * 60 * 60); $sql = "DELETE FROM demand WHERE date_modif < :date"; @@ -398,7 +398,7 @@ class Users implements ControllerProviderInterface )); })->bind('users_display_demands'); - $controllers->post('/demands/', function(Application $app, Request $request) { + $controllers->post('/demands/', function (Application $app, Request $request) { $templates = $deny = $accept = $options = array(); @@ -573,11 +573,11 @@ class Users implements ControllerProviderInterface return $app->redirectPath('users_display_demands', array('success' => 1)); })->bind('users_submit_demands'); - $controllers->get('/import/file/', function(Application $app, Request $request) { + $controllers->get('/import/file/', function (Application $app, Request $request) { return $app['twig']->render('admin/user/import/file.html.twig'); })->bind('users_display_import_file'); - $controllers->post('/import/file/', function(Application $app, Request $request) { + $controllers->post('/import/file/', function (Application $app, Request $request) { if ((null === $file = $request->files->get('files')) || !$file->isValid()) { return $app->redirectPath('users_display_import_file', array('error' => 'file-invalid')); } @@ -595,7 +595,7 @@ class Users implements ControllerProviderInterface $roughColumns = array_shift($lines); - $columnsSanitized = array_map(function($columnName) { + $columnsSanitized = array_map(function ($columnName) { return trim(mb_strtolower($columnName)); }, $roughColumns); @@ -729,7 +729,7 @@ class Users implements ControllerProviderInterface )); })->bind('users_submit_import_file'); - $controllers->post('/import/', function(Application $app, Request $request) { + $controllers->post('/import/', function (Application $app, Request $request) { $nbCreation = 0; if ((null === $serializedColumns = $request->request->get('sr_columns')) || ('' === $serializedColumns)) { @@ -861,7 +861,7 @@ class Users implements ControllerProviderInterface return $app->redirectPath('admin_users_search', array('user-updated' => $nbCreation)); })->bind('users_submit_import'); - $controllers->get('/import/example/csv/', function(Application $app, Request $request) { + $controllers->get('/import/example/csv/', function (Application $app, Request $request) { $file = new \SplFileInfo($app['root.path'] . '/lib/Fixtures/exampleImportUsers.csv'); @@ -880,7 +880,7 @@ class Users implements ControllerProviderInterface return $response; })->bind('users_import_csv'); - $controllers->get('/import/example/rtf/', function(Application $app, Request $request) { + $controllers->get('/import/example/rtf/', function (Application $app, Request $request) { $file = new \SplFileInfo($app['root.path'] . '/lib/Fixtures/Fields.rtf'); diff --git a/lib/Alchemy/Phrasea/Controller/Api/Oauth2.php b/lib/Alchemy/Phrasea/Controller/Api/Oauth2.php index f7f95598b9..2dc9c8e714 100644 --- a/lib/Alchemy/Phrasea/Controller/Api/Oauth2.php +++ b/lib/Alchemy/Phrasea/Controller/Api/Oauth2.php @@ -30,7 +30,7 @@ class Oauth2 implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $app['oauth'] = $app->share(function($app) { + $app['oauth'] = $app->share(function ($app) { return new \API_OAuth2_Adapter($app); }); @@ -40,7 +40,7 @@ class Oauth2 implements ControllerProviderInterface * Authorization endpoint - used to obtain authorization from the * resource owner via user-agent redirection. */ - $authorize_func = function() use ($app) { + $authorize_func = function () use ($app) { $request = $app['request']; $oauth2_adapter = $app['oauth']; @@ -147,7 +147,7 @@ class Oauth2 implements ControllerProviderInterface * TOKEN ENDPOINT * Token endpoint - used to exchange an authorization grant for an access token. */ - $controllers->post('/token', function(\Silex\Application $app, Request $request) { + $controllers->post('/token', function (\Silex\Application $app, Request $request) { if ( ! $request->isSecure()) { throw new HttpException(400, 'This route requires the use of the https scheme', null, array('content-type' => 'application/json')); } diff --git a/lib/Alchemy/Phrasea/Controller/Client/Baskets.php b/lib/Alchemy/Phrasea/Controller/Client/Baskets.php index 1efc72f85e..40a9cc72cc 100644 --- a/lib/Alchemy/Phrasea/Controller/Client/Baskets.php +++ b/lib/Alchemy/Phrasea/Controller/Client/Baskets.php @@ -27,7 +27,7 @@ class Baskets implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function() use ($app) { + $controllers->before(function () use ($app) { $app['firewall']->requireAuthentication(); }); @@ -184,7 +184,7 @@ class Baskets implements ControllerProviderInterface $selectedBasket = $app['EM']->getRepository('Alchemy\Phrasea\Model\Entities\Basket')->findUserBasket($app, $selectedBasketId, $app['authentication']->getUser(), true); } - $basketCollections = $baskets->partition(function($key, $basket) { + $basketCollections = $baskets->partition(function ($key, $basket) { return (Boolean) $basket->getPusherId(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Client/Root.php b/lib/Alchemy/Phrasea/Controller/Client/Root.php index 8b452e7047..1234fea097 100644 --- a/lib/Alchemy/Phrasea/Controller/Client/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Client/Root.php @@ -30,7 +30,7 @@ class Root implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { if (!$app['authentication']->isAuthenticated() && null !== $request->query->get('nolog')) { return $app->redirectPath('login_authenticate_as_guest', array('redirect' => 'client')); } @@ -101,9 +101,9 @@ class Root implements ControllerProviderInterface } foreach ($options->getDataboxes() as $databox) { - $colls = array_map(function(\collection $collection) { + $colls = array_map(function (\collection $collection) { return $collection->get_coll_id(); - }, array_filter($options->getCollections(), function(\collection $collection) use ($databox) { + }, array_filter($options->getCollections(), function (\collection $collection) use ($databox) { return $collection->get_databox()->get_sbas_id() == $databox->get_sbas_id(); })); @@ -356,7 +356,7 @@ class Root implements ControllerProviderInterface $iterator = $finder ->directories() ->depth(0) - ->filter(function(\SplFileInfo $fileinfo) { + ->filter(function (\SplFileInfo $fileinfo) { return ctype_xdigit($fileinfo->getBasename()); }) ->in($cssPath); diff --git a/lib/Alchemy/Phrasea/Controller/Datafiles.php b/lib/Alchemy/Phrasea/Controller/Datafiles.php index 9a7b7ebebb..804c36edc1 100644 --- a/lib/Alchemy/Phrasea/Controller/Datafiles.php +++ b/lib/Alchemy/Phrasea/Controller/Datafiles.php @@ -32,13 +32,13 @@ class Datafiles extends AbstractDelivery $that = $this; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { if (!$app['authentication']->isAuthenticated()) { $app->abort(403, 'You are not autorized to see this'); } }); - $controllers->get('/{sbas_id}/{record_id}/{subdef}/', function($sbas_id, $record_id, $subdef, PhraseaApplication $app) use ($that) { + $controllers->get('/{sbas_id}/{record_id}/{subdef}/', function ($sbas_id, $record_id, $subdef, PhraseaApplication $app) use ($that) { $databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id); $record = new \record_adapter($app, $sbas_id, $record_id); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/BasketController.php b/lib/Alchemy/Phrasea/Controller/Prod/BasketController.php index 8d0c59dff7..1df0fa4626 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/BasketController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/BasketController.php @@ -34,7 +34,7 @@ class BasketController implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php b/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php index b12d38aa98..f04a362d46 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php @@ -25,7 +25,7 @@ class Bridge implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireRight('bas_chupub'); }); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Download.php b/lib/Alchemy/Phrasea/Controller/Prod/Download.php index 51334749e2..8f44b98a93 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Download.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Download.php @@ -27,7 +27,7 @@ class Download implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Edit.php b/lib/Alchemy/Phrasea/Controller/Prod/Edit.php index c120c34318..ba4086303a 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Edit.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Edit.php @@ -31,13 +31,13 @@ class Edit implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall'] ->requireNotGuest() ->requireRight('modifyrecord'); }); - $controllers->post('/', function(Application $app, Request $request) { + $controllers->post('/', function (Application $app, Request $request) { $records = RecordsRequest::fromRequest($app, $request, RecordsRequest::FLATTEN_YES_PRESERVE_STORIES, array('canmodifrecord')); @@ -229,7 +229,7 @@ class Edit implements ControllerProviderInterface return $app['twig']->render('prod/actions/edit_default.html.twig', $params); }); - $controllers->get('/vocabulary/{vocabulary}/', function(Application $app, Request $request, $vocabulary) { + $controllers->get('/vocabulary/{vocabulary}/', function (Application $app, Request $request, $vocabulary) { $datas = array('success' => false, 'message' => '', 'results' => array()); $sbas_id = (int) $request->query->get('sbas_id'); @@ -268,7 +268,7 @@ class Edit implements ControllerProviderInterface return $app->json($datas); }); - $controllers->post('/apply/', function(Application $app, Request $request) { + $controllers->post('/apply/', function (Application $app, Request $request) { $records = RecordsRequest::fromRequest($app, $request, RecordsRequest::FLATTEN_YES_PRESERVE_STORIES, array('canmodifrecord')); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Export.php b/lib/Alchemy/Phrasea/Controller/Prod/Export.php index e859426f0c..fccb4772b2 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Export.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Export.php @@ -32,7 +32,7 @@ class Export implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireNotGuest(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Language.php b/lib/Alchemy/Phrasea/Controller/Prod/Language.php index cb9234eb62..ea50197e9d 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Language.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Language.php @@ -27,7 +27,7 @@ class Language implements ControllerProviderInterface $controller = $app['controllers_factory']; - $controller->get("/", function(Application $app) { + $controller->get("/", function (Application $app) { $out = array(); $out['thesaurusBasesChanged'] = _('prod::recherche: Attention : la liste des bases selectionnees pour la recherche a ete changee.'); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php index 086e3df449..7a85d43661 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php @@ -43,7 +43,7 @@ class Lazaret implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication() ->requireRight('addrecord'); }); @@ -191,7 +191,7 @@ class Lazaret implements ControllerProviderInterface /* @var $record \record_adapter */ //Post record creation - $callBack = function($element, $visa, $code) use (&$record) { + $callBack = function ($element, $visa, $code) use (&$record) { $record = $element; }; diff --git a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php index 37824f32bc..7264697717 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php @@ -29,7 +29,7 @@ class MoveCollection implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication() ->requireRight('addrecord') ->requireRight('deleterecord'); @@ -48,7 +48,7 @@ class MoveCollection implements ControllerProviderInterface { $records = RecordsRequest::fromRequest($app, $request, false, array('candeleterecord')); - $sbas_ids = array_map(function(\databox $databox) { + $sbas_ids = array_map(function (\databox $databox) { return $databox->get_sbas_id(); }, $records->databoxes()); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Printer.php b/lib/Alchemy/Phrasea/Controller/Prod/Printer.php index d543fd50b7..c9f1e96213 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Printer.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Printer.php @@ -30,14 +30,14 @@ class Printer implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->post('/', function(Application $app) { + $controllers->post('/', function (Application $app) { $printer = new RecordHelper\Printer($app, $app['request']); return $app['twig']->render('prod/actions/printer_default.html.twig', array('printer' => $printer, 'message' => '')); } ); - $controllers->post('/print.pdf', function(Application $app) { + $controllers->post('/print.pdf', function (Application $app) { $printer = new RecordHelper\Printer($app, $app['request']); $request = $app['request']; diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Property.php b/lib/Alchemy/Phrasea/Controller/Prod/Property.php index aa931b342f..96f581c5d8 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Property.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Property.php @@ -29,7 +29,7 @@ class Property implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireNotGuest(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Query.php b/lib/Alchemy/Phrasea/Controller/Prod/Query.php index 6a5df0e1de..437e7efcd8 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Query.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Query.php @@ -32,7 +32,7 @@ class Query implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication(); }); @@ -93,9 +93,9 @@ class Query implements ControllerProviderInterface } foreach ($options->getDataboxes() as $databox) { - $colls = array_map(function(\collection $collection) { + $colls = array_map(function (\collection $collection) { return $collection->get_coll_id(); - }, array_filter($options->getCollections(), function(\collection $collection) use ($databox) { + }, array_filter($options->getCollections(), function (\collection $collection) use ($databox) { return $collection->get_databox()->get_sbas_id() == $databox->get_sbas_id(); })); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Records.php b/lib/Alchemy/Phrasea/Controller/Prod/Records.php index 9696030ea3..6a9551fb16 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Records.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Records.php @@ -29,7 +29,7 @@ class Records implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireNotGuest(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Root.php b/lib/Alchemy/Phrasea/Controller/Prod/Root.php index 53941e0106..61a323b023 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Root.php @@ -33,7 +33,7 @@ class Root implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { if (!$app['authentication']->isAuthenticated() && null !== $request->query->get('nolog')) { return $app->redirectPath('login_authenticate_as_guest'); } @@ -41,7 +41,7 @@ class Root implements ControllerProviderInterface $app['firewall']->requireAuthentication(); }); - $controllers->get('/', function(Application $app) { + $controllers->get('/', function (Application $app) { try { \Session_Logger::updateClientInfos($app, 1); } catch (SessionNotFound $e) { @@ -58,7 +58,7 @@ class Root implements ControllerProviderInterface $iterator = $finder ->directories() ->depth(0) - ->filter(function(\SplFileInfo $fileinfo) { + ->filter(function (\SplFileInfo $fileinfo) { return ctype_xdigit($fileinfo->getBasename()); }) ->in($cssPath); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Story.php b/lib/Alchemy/Phrasea/Controller/Prod/Story.php index 0d8a211257..749129b8ca 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Story.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Story.php @@ -33,15 +33,15 @@ class Story implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication(); }); - $controllers->get('/create/', function(Application $app) { + $controllers->get('/create/', function (Application $app) { return $app['twig']->render('prod/Story/Create.html.twig', array()); })->bind('prod_stories_create'); - $controllers->post('/', function(Application $app, Request $request) { + $controllers->post('/', function (Application $app, Request $request) { /* @var $request \Symfony\Component\HttpFoundation\Request */ $collection = \collection::get_from_base_id($app, $request->request->get('base_id')); @@ -109,7 +109,7 @@ class Story implements ControllerProviderInterface } })->bind('prod_stories_do_create'); - $controllers->get('/{sbas_id}/{record_id}/', function(Application $app, $sbas_id, $record_id) { + $controllers->get('/{sbas_id}/{record_id}/', function (Application $app, $sbas_id, $record_id) { $Story = new \record_adapter($app, $sbas_id, $record_id); $html = $app['twig']->render('prod/WorkZone/Story.html.twig', array('Story' => $Story)); @@ -120,7 +120,7 @@ class Story implements ControllerProviderInterface ->assert('sbas_id', '\d+') ->assert('record_id', '\d+'); - $controllers->post('/{sbas_id}/{record_id}/addElements/', function(Application $app, Request $request, $sbas_id, $record_id) { + $controllers->post('/{sbas_id}/{record_id}/addElements/', function (Application $app, Request $request, $sbas_id, $record_id) { $Story = new \record_adapter($app, $sbas_id, $record_id); if (!$app['authentication']->getUser()->ACL()->has_right_on_base($Story->get_base_id(), 'canmodifrecord')) @@ -151,7 +151,7 @@ class Story implements ControllerProviderInterface } })->assert('sbas_id', '\d+')->assert('record_id', '\d+'); - $controllers->post('/{sbas_id}/{record_id}/delete/{child_sbas_id}/{child_record_id}/', function(Application $app, Request $request, $sbas_id, $record_id, $child_sbas_id, $child_record_id) { + $controllers->post('/{sbas_id}/{record_id}/delete/{child_sbas_id}/{child_record_id}/', function (Application $app, Request $request, $sbas_id, $record_id, $child_sbas_id, $child_record_id) { $Story = new \record_adapter($app, $sbas_id, $record_id); $record = new \record_adapter($app, $child_sbas_id, $child_record_id); @@ -181,7 +181,7 @@ class Story implements ControllerProviderInterface /** * Get the Basket reorder form */ - $controllers->get('/{sbas_id}/{record_id}/reorder/', function(Application $app, $sbas_id, $record_id) { + $controllers->get('/{sbas_id}/{record_id}/reorder/', function (Application $app, $sbas_id, $record_id) { $story = new \record_adapter($app, $sbas_id, $record_id); if (!$story->is_grouping()) { @@ -199,7 +199,7 @@ class Story implements ControllerProviderInterface ->assert('sbas_id', '\d+') ->assert('record_id', '\d+'); - $controllers->post('/{sbas_id}/{record_id}/reorder/', function(Application $app, $sbas_id, $record_id) { + $controllers->post('/{sbas_id}/{record_id}/reorder/', function (Application $app, $sbas_id, $record_id) { $ret = array('success' => false, 'message' => _('An error occured')); try { diff --git a/lib/Alchemy/Phrasea/Controller/Prod/TOU.php b/lib/Alchemy/Phrasea/Controller/Prod/TOU.php index d262bffbbe..f84f648982 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/TOU.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/TOU.php @@ -32,7 +32,7 @@ class TOU implements ControllerProviderInterface $controllers->post('/deny/{sbas_id}/', 'controller.prod.tou:denyTermsOfUse') ->bind('deny_tou') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php index 7e10221e92..11c31b58c7 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php @@ -32,12 +32,12 @@ class Tools implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication() ->requireRight('doctools'); }); - $controllers->get('/', function(Application $app, Request $request) { + $controllers->get('/', function (Application $app, Request $request) { $records = RecordsRequest::fromRequest($app, $request, false); @@ -68,7 +68,7 @@ class Tools implements ControllerProviderInterface return $app['twig']->render('prod/actions/Tools/index.html.twig', $var); }); - $controllers->post('/rotate/', function(Application $app, Request $request) { + $controllers->post('/rotate/', function (Application $app, Request $request) { $return = array('success' => true, 'errorMessage' => ''); $records = RecordsRequest::fromRequest($app, $request, false); @@ -91,7 +91,7 @@ class Tools implements ControllerProviderInterface return $app->json($return); })->bind('prod_tools_rotate'); - $controllers->post('/image/', function(Application $app, Request $request) { + $controllers->post('/image/', function (Application $app, Request $request) { $return = array('success' => true); $selection = RecordsRequest::fromRequest($app, $request, false, array('canmodifrecord')); @@ -114,7 +114,7 @@ class Tools implements ControllerProviderInterface return $app->json($return); })->bind('prod_tools_image'); - $controllers->post('/hddoc/', function(Application $app, Request $request) { + $controllers->post('/hddoc/', function (Application $app, Request $request) { $success = false; $message = _('An error occured'); @@ -175,7 +175,7 @@ class Tools implements ControllerProviderInterface )); })->bind('prod_tools_hd_substitution'); - $controllers->post('/chgthumb/', function(Application $app, Request $request) { + $controllers->post('/chgthumb/', function (Application $app, Request $request) { $success = false; $message = _('An error occured'); @@ -229,7 +229,7 @@ class Tools implements ControllerProviderInterface )); })->bind('prod_tools_thumbnail_substitution'); - $controllers->post('/thumb-extractor/confirm-box/', function(Application $app, Request $request) { + $controllers->post('/thumb-extractor/confirm-box/', function (Application $app, Request $request) { $return = array('error' => false, 'datas' => ''); $template = 'prod/actions/Tools/confirm.html.twig'; @@ -248,7 +248,7 @@ class Tools implements ControllerProviderInterface return $app->json($return); }); - $controllers->post('/thumb-extractor/apply/', function(Application $app, Request $request) { + $controllers->post('/thumb-extractor/apply/', function (Application $app, Request $request) { $return = array('success' => false, 'message' => ''); try { diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php b/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php index 9f6e29893b..91bdf13601 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php @@ -29,7 +29,7 @@ class Tooltip implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Upload.php b/lib/Alchemy/Phrasea/Controller/Prod/Upload.php index c92ad7c03f..5e22040a9a 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Upload.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Upload.php @@ -46,7 +46,7 @@ class Upload implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication() ->requireRight('addrecord'); }); @@ -188,7 +188,7 @@ class Upload implements ControllerProviderInterface $reasons = array(); $elementCreated = null; - $callback = function($element, $visa, $code) use (&$reasons, &$elementCreated) { + $callback = function ($element, $visa, $code) use (&$reasons, &$elementCreated) { foreach ($visa->getResponses() as $response) { if (!$response->isOk()) { $reasons[] = $response->getMessage(); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php b/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php index 628ac58ca4..62b5455ff0 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php @@ -34,7 +34,7 @@ class UsrLists implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php b/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php index b210623932..0ceb02d0df 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php @@ -33,7 +33,7 @@ class WorkZone implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication(); }); diff --git a/lib/Alchemy/Phrasea/Controller/RecordsRequest.php b/lib/Alchemy/Phrasea/Controller/RecordsRequest.php index 1a78fef26a..3546d5a64c 100644 --- a/lib/Alchemy/Phrasea/Controller/RecordsRequest.php +++ b/lib/Alchemy/Phrasea/Controller/RecordsRequest.php @@ -141,7 +141,7 @@ class RecordsRequest extends ArrayCollection public function stories() { return new ArrayCollection( - array_filter($this->toArray(), function(\record_adapter $record) { + array_filter($this->toArray(), function (\record_adapter $record) { return $record->is_grouping(); }) ); diff --git a/lib/Alchemy/Phrasea/Controller/Report/Activity.php b/lib/Alchemy/Phrasea/Controller/Report/Activity.php index a03b1a9b46..49c3e579b9 100644 --- a/lib/Alchemy/Phrasea/Controller/Report/Activity.php +++ b/lib/Alchemy/Phrasea/Controller/Report/Activity.php @@ -25,7 +25,7 @@ class Activity implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function() use ($app) { + $controllers->before(function () use ($app) { $app['firewall']->requireAuthentication(); $app['firewall']->requireAccessToModule('report'); }); diff --git a/lib/Alchemy/Phrasea/Controller/Report/Export.php b/lib/Alchemy/Phrasea/Controller/Report/Export.php index ef350fe209..38e8cec583 100644 --- a/lib/Alchemy/Phrasea/Controller/Report/Export.php +++ b/lib/Alchemy/Phrasea/Controller/Report/Export.php @@ -25,7 +25,7 @@ class Export implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function() use ($app) { + $controllers->before(function () use ($app) { $app['firewall']->requireAuthentication(); $app['firewall']->requireAccessToModule('report'); }); diff --git a/lib/Alchemy/Phrasea/Controller/Report/Informations.php b/lib/Alchemy/Phrasea/Controller/Report/Informations.php index bfb105e23b..1fd2136673 100644 --- a/lib/Alchemy/Phrasea/Controller/Report/Informations.php +++ b/lib/Alchemy/Phrasea/Controller/Report/Informations.php @@ -24,7 +24,7 @@ class Informations implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function() use ($app) { + $controllers->before(function () use ($app) { $app['firewall']->requireAuthentication(); $app['firewall']->requireAccessToModule('report'); }); diff --git a/lib/Alchemy/Phrasea/Controller/Report/Root.php b/lib/Alchemy/Phrasea/Controller/Report/Root.php index 3703ef6e95..1d0959dc88 100644 --- a/lib/Alchemy/Phrasea/Controller/Report/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Report/Root.php @@ -25,12 +25,12 @@ class Root implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function() use ($app) { + $controllers->before(function () use ($app) { $app['firewall']->requireAuthentication(); $app['firewall']->requireAccessToModule('report'); }); - $controllers->get('/', function(Application $app) { + $controllers->get('/', function (Application $app) { return $app->redirectPath('report_dashboard'); })->bind('report'); diff --git a/lib/Alchemy/Phrasea/Controller/Root/Account.php b/lib/Alchemy/Phrasea/Controller/Root/Account.php index 51cbfc1298..0633c143f2 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/Account.php +++ b/lib/Alchemy/Phrasea/Controller/Root/Account.php @@ -33,7 +33,7 @@ class Account implements ControllerProviderInterface $app['account.controller'] = $this; - $controllers->before(function() use ($app) { + $controllers->before(function () use ($app) { $app['firewall']->requireAuthentication(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Root/Developers.php b/lib/Alchemy/Phrasea/Controller/Root/Developers.php index a09c52f78c..79a925fe83 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/Developers.php +++ b/lib/Alchemy/Phrasea/Controller/Root/Developers.php @@ -31,7 +31,7 @@ class Developers implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function() use ($app) { + $controllers->before(function () use ($app) { $app['firewall']->requireAuthentication(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php index cac8255082..39b55ab609 100644 --- a/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php +++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php @@ -24,7 +24,7 @@ class Thesaurus implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function() use ($app) { + $controllers->before(function () use ($app) { $app['firewall']->requireAuthentication(); $app['firewall']->requireAccessToModule('thesaurus'); }); diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php index 373b72772c..a3730b9c4b 100644 --- a/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php +++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php @@ -26,7 +26,7 @@ class Xmlhttp implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function() use ($app) { + $controllers->before(function () use ($app) { $app['firewall']->requireAuthentication(); $app['firewall']->requireAccessToModule('thesaurus'); }); diff --git a/lib/Alchemy/Phrasea/Controller/User/Notifications.php b/lib/Alchemy/Phrasea/Controller/User/Notifications.php index 746ed7119b..77081a2238 100644 --- a/lib/Alchemy/Phrasea/Controller/User/Notifications.php +++ b/lib/Alchemy/Phrasea/Controller/User/Notifications.php @@ -28,7 +28,7 @@ class Notifications implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireNotGuest(); }); diff --git a/lib/Alchemy/Phrasea/Controller/User/Preferences.php b/lib/Alchemy/Phrasea/Controller/User/Preferences.php index 44d2b9ecd4..318cb2bcf5 100644 --- a/lib/Alchemy/Phrasea/Controller/User/Preferences.php +++ b/lib/Alchemy/Phrasea/Controller/User/Preferences.php @@ -28,7 +28,7 @@ class Preferences implements ControllerProviderInterface $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication(); }); diff --git a/lib/Alchemy/Phrasea/Controller/Utils/ConnectionTest.php b/lib/Alchemy/Phrasea/Controller/Utils/ConnectionTest.php index 404380f8ec..7296201b8e 100644 --- a/lib/Alchemy/Phrasea/Controller/Utils/ConnectionTest.php +++ b/lib/Alchemy/Phrasea/Controller/Utils/ConnectionTest.php @@ -30,7 +30,7 @@ class ConnectionTest implements ControllerProviderInterface /** * @todo : check this as it would lead to a security issue */ - $controllers->get('/mysql/', function(Application $app) { + $controllers->get('/mysql/', function (Application $app) { $request = $app['request']; $hostname = $request->query->get('hostname', '127.0.0.1'); diff --git a/lib/Alchemy/Phrasea/Controller/Utils/PathFileTest.php b/lib/Alchemy/Phrasea/Controller/Utils/PathFileTest.php index 76cdb2d51f..469772431c 100644 --- a/lib/Alchemy/Phrasea/Controller/Utils/PathFileTest.php +++ b/lib/Alchemy/Phrasea/Controller/Utils/PathFileTest.php @@ -31,7 +31,7 @@ class PathFileTest implements ControllerProviderInterface /** * @todo : check this as it would lead to a security issue */ - $controllers->get('/path/', function(Application $app, Request $request) { + $controllers->get('/path/', function (Application $app, Request $request) { return $app->json(array( 'exists' => file_exists($request->query->get('path')) , 'file' => is_file($request->query->get('path')) @@ -42,7 +42,7 @@ class PathFileTest implements ControllerProviderInterface )); }); - $controllers->get('/url/', function(Application $app, Request $request) { + $controllers->get('/url/', function (Application $app, Request $request) { return $app->json(array('code' => \http_query::getHttpCodeFromUrl($request->query->get('url')))); }); diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaLocaleSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaLocaleSubscriber.php index d2d9bdfddd..227b858c03 100644 --- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaLocaleSubscriber.php +++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaLocaleSubscriber.php @@ -71,7 +71,7 @@ class PhraseaLocaleSubscriber implements EventSubscriberInterface ) ); - $this->app['locale'] = $this->app->share(function(Application $app) use ($event) { + $this->app['locale'] = $this->app->share(function (Application $app) use ($event) { if (isset($app['phraseanet.registry'])) { $event->getRequest()->setDefaultLocale( $app['phraseanet.registry']->get('GV_default_lng', 'en_GB') diff --git a/lib/Alchemy/Phrasea/Core/Provider/AuthenticationManagerServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/AuthenticationManagerServiceProvider.php index f51e581fe1..7c2c23c438 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/AuthenticationManagerServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/AuthenticationManagerServiceProvider.php @@ -32,15 +32,15 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface { public function register(Application $app) { - $app['authentication'] = $app->share(function (Application $app){ + $app['authentication'] = $app->share(function (Application $app) { return new Authenticator($app, $app['browser'], $app['session'], $app['EM']); }); - $app['authentication.token-validator'] = $app->share(function (Application $app){ + $app['authentication.token-validator'] = $app->share(function (Application $app) { return new TokenValidator($app); }); - $app['authentication.persistent-manager'] = $app->share(function (Application $app){ + $app['authentication.persistent-manager'] = $app->share(function (Application $app) { return new CookieManager($app['auth.password-encoder'], $app['EM'], $app['browser']); }); @@ -128,7 +128,7 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface public function boot(Application $app) { $app['dispatcher'] = $app->share( - $app->extend('dispatcher', function($dispatcher, Application $app){ + $app->extend('dispatcher', function ($dispatcher, Application $app) { $dispatcher->addSubscriber(new PersistentCookieSubscriber($app)); return $dispatcher; diff --git a/lib/Alchemy/Phrasea/Core/Provider/BorderManagerServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/BorderManagerServiceProvider.php index 4915f43351..6e63514bcc 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/BorderManagerServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/BorderManagerServiceProvider.php @@ -21,7 +21,7 @@ class BorderManagerServiceProvider implements ServiceProviderInterface public function register(Application $app) { - $app['border-manager'] = $app->share(function(Application $app) { + $app['border-manager'] = $app->share(function (Application $app) { $borderManager = new Manager($app); try { diff --git a/lib/Alchemy/Phrasea/Core/Provider/BrowserServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/BrowserServiceProvider.php index 93ed6f0de7..47cf4e6527 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/BrowserServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/BrowserServiceProvider.php @@ -19,7 +19,7 @@ class BrowserServiceProvider implements ServiceProviderInterface public function register(Application $app) { - $app['browser'] = $app->share(function($app) { + $app['browser'] = $app->share(function ($app) { return new \Browser(); }); } diff --git a/lib/Alchemy/Phrasea/Core/Provider/CacheServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/CacheServiceProvider.php index 6075d47f60..c6a85dc85b 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/CacheServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/CacheServiceProvider.php @@ -32,7 +32,7 @@ class CacheServiceProvider implements ServiceProviderInterface return new Factory(); }); - $app['phraseanet.cache-service'] = $app->share(function(Application $app) { + $app['phraseanet.cache-service'] = $app->share(function (Application $app) { return new CacheManager( $app['phraseanet.cache-compiler'], $app['phraseanet.cache-registry'], @@ -41,13 +41,13 @@ class CacheServiceProvider implements ServiceProviderInterface ); }); - $app['cache'] = $app->share(function(Application $app) { + $app['cache'] = $app->share(function (Application $app) { $conf = $app['phraseanet.configuration']['main']['cache']; return $app['phraseanet.cache-service']->factory('cache', $conf['type'], $conf['options']); }); - $app['opcode-cache'] = $app->share(function(Application $app) { + $app['opcode-cache'] = $app->share(function (Application $app) { $conf = $app['phraseanet.configuration']['main']['opcodecache']; return $app['phraseanet.cache-service']->factory('cache', $conf['type'], $conf['options']); diff --git a/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php index 2fd985f31d..fe9b4e1da3 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php @@ -31,7 +31,7 @@ class ConfigurationServiceProvider implements ServiceProviderInterface $app['phraseanet.configuration.config-path'] = $app['root.path'] . '/config/configuration.yml'; $app['phraseanet.configuration.config-compiled-path'] = $app['root.path'] . '/tmp/configuration-compiled.php'; - $app['phraseanet.configuration'] = $app->share(function(SilexApplication $app) { + $app['phraseanet.configuration'] = $app->share(function (SilexApplication $app) { return new Configuration( $app['phraseanet.configuration.yaml-parser'], $app['phraseanet.configuration.compiler'], @@ -48,7 +48,7 @@ class ConfigurationServiceProvider implements ServiceProviderInterface public function boot(SilexApplication $app) { $app['dispatcher'] = $app->share( - $app->extend('dispatcher', function($dispatcher, SilexApplication $app){ + $app->extend('dispatcher', function ($dispatcher, SilexApplication $app) { $dispatcher->addSubscriber(new TrustedProxySubscriber($app['phraseanet.configuration'])); return $dispatcher; diff --git a/lib/Alchemy/Phrasea/Core/Provider/ConfigurationTesterServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/ConfigurationTesterServiceProvider.php index 7499761d9b..ac61a2234c 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/ConfigurationTesterServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/ConfigurationTesterServiceProvider.php @@ -22,7 +22,7 @@ class ConfigurationTesterServiceProvider implements ServiceProviderInterface public function register(SilexApplication $app) { - $app['phraseanet.configuration-tester'] = $app->share(function(Application $app) { + $app['phraseanet.configuration-tester'] = $app->share(function (Application $app) { return new ConfigurationTester($app); }); diff --git a/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php index 8327f0ba6d..1de47f6431 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php @@ -24,7 +24,7 @@ class FileServeServiceProvider implements ServiceProviderInterface */ public function register(Application $app) { - $app['phraseanet.xsendfile-factory'] = $app->share(function($app) { + $app['phraseanet.xsendfile-factory'] = $app->share(function ($app) { return XSendFileFactory::create($app); }); @@ -39,7 +39,7 @@ class FileServeServiceProvider implements ServiceProviderInterface public function boot(Application $app) { $app['dispatcher'] = $app->share( - $app->extend('dispatcher', function($dispatcher, Application $app){ + $app->extend('dispatcher', function ($dispatcher, Application $app) { $dispatcher->addSubscriber(new XSendFileSubscriber($app)); return $dispatcher; diff --git a/lib/Alchemy/Phrasea/Core/Provider/LocaleServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/LocaleServiceProvider.php index be1209d223..47954e8500 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/LocaleServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/LocaleServiceProvider.php @@ -19,17 +19,17 @@ class LocaleServiceProvider implements ServiceProviderInterface { public function register(Application $app) { - $app['locale'] = $app->share(function(Application $app){ + $app['locale'] = $app->share(function (Application $app) { return $app['phraseanet.registry']->get('GV_default_lng', 'en_GB'); }); - $app['locale.I18n'] = function(Application $app){ + $app['locale.I18n'] = function (Application $app) { $data = explode('_', $app['locale']); return $data[0]; }; - $app['locale.l10n'] = function(Application $app){ + $app['locale.l10n'] = function (Application $app) { $data = explode('_', $app['locale']); return $data[1]; diff --git a/lib/Alchemy/Phrasea/Core/Provider/NotificationDelivererServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/NotificationDelivererServiceProvider.php index a4ad20facb..4f2a6cf58f 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/NotificationDelivererServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/NotificationDelivererServiceProvider.php @@ -22,7 +22,7 @@ class NotificationDelivererServiceProvider implements ServiceProviderInterface return $app['phraseanet.registry']->get('GV_email_prefix'); }); - $app['notification.deliverer'] = $app->share(function($app) { + $app['notification.deliverer'] = $app->share(function ($app) { return new Deliverer( $app['mailer'], $app['dispatcher'], diff --git a/lib/Alchemy/Phrasea/Core/Provider/PhraseaVersionServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/PhraseaVersionServiceProvider.php index ca7c68dbc5..25a87de18f 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/PhraseaVersionServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/PhraseaVersionServiceProvider.php @@ -19,7 +19,7 @@ class PhraseaVersionServiceProvider implements ServiceProviderInterface { public function register(SilexApplication $app) { - $app['phraseanet.version'] = $app->share(function(SilexApplication $app) { + $app['phraseanet.version'] = $app->share(function (SilexApplication $app) { return new Version(); }); } diff --git a/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php index 311a1e2d13..9ac3896522 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php @@ -19,19 +19,19 @@ class PhraseanetServiceProvider implements ServiceProviderInterface { public function register(SilexApplication $app) { - $app['phraseanet.appbox'] = $app->share(function(SilexApplication $app) { + $app['phraseanet.appbox'] = $app->share(function (SilexApplication $app) { return new \appbox($app); }); - $app['phraseanet.registry'] = $app->share(function(SilexApplication $app) { + $app['phraseanet.registry'] = $app->share(function (SilexApplication $app) { return new \registry($app); }); - $app['firewall'] = $app->share(function(SilexApplication $app) { + $app['firewall'] = $app->share(function (SilexApplication $app) { return new Firewall($app); }); - $app['events-manager'] = $app->share(function(SilexApplication $app) { + $app['events-manager'] = $app->share(function (SilexApplication $app) { $events = new \eventsmanager_broker($app); $events->start(); diff --git a/lib/Alchemy/Phrasea/Core/Provider/PluginServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/PluginServiceProvider.php index 6eae3d1617..4f1deeee40 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/PluginServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/PluginServiceProvider.php @@ -23,7 +23,7 @@ class PluginServiceProvider implements ServiceProviderInterface public function boot(Application $app) { $app['twig'] = $app->share( - $app->extend('twig', function($twig, Application $app){ + $app->extend('twig', function ($twig, Application $app) { $function = new \Twig_SimpleFunction('plugin_asset', array('Alchemy\Phrasea\Plugin\Management\AssetsManager', 'twigPluginAsset')); $twig->addFunction($function); diff --git a/lib/Alchemy/Phrasea/Core/Provider/RegistrationServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/RegistrationServiceProvider.php index 204f67de93..47af1add74 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/RegistrationServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/RegistrationServiceProvider.php @@ -20,11 +20,11 @@ class RegistrationServiceProvider implements ServiceProviderInterface { public function register(Application $app) { - $app['registration.fields'] = $app->share(function (Application $app){ + $app['registration.fields'] = $app->share(function (Application $app) { return isset($app['phraseanet.configuration']['registration-fields']) ? $app['phraseanet.configuration']['registration-fields'] : array(); }); - $app['registration.enabled'] = $app->share(function (Application $app){ + $app['registration.enabled'] = $app->share(function (Application $app) { require_once __DIR__ . '/../../../../classes/deprecated/inscript.api.php'; $bases = giveMeBases($app); diff --git a/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php index 56e5d48f3c..f33aa3df0c 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php @@ -22,7 +22,7 @@ class SearchEngineServiceProvider implements ServiceProviderInterface public function register(Application $app) { - $app['phraseanet.SE'] = $app->share(function($app) { + $app['phraseanet.SE'] = $app->share(function ($app) { $engineClass = $app['phraseanet.configuration']['main']['search-engine']['type']; $engineOptions = $app['phraseanet.configuration']['main']['search-engine']['options']; @@ -34,7 +34,7 @@ class SearchEngineServiceProvider implements ServiceProviderInterface return $engineClass::create($app, $engineOptions); }); - $app['phraseanet.SE.logger'] = $app->share(function(Application $app) { + $app['phraseanet.SE.logger'] = $app->share(function (Application $app) { return new SearchEngineLogger($app); }); } diff --git a/lib/Alchemy/Phrasea/Core/Provider/TokensServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/TokensServiceProvider.php index 96aca2a7dc..9fda0bad52 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/TokensServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/TokensServiceProvider.php @@ -18,7 +18,7 @@ class TokensServiceProvider implements ServiceProviderInterface { public function register(Application $app) { - $app['tokens'] = $app->share(function($app) { + $app['tokens'] = $app->share(function ($app) { return new \random($app); }); } diff --git a/lib/Alchemy/Phrasea/Core/Provider/UnicodeServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/UnicodeServiceProvider.php index f6be16b89a..d9231b32db 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/UnicodeServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/UnicodeServiceProvider.php @@ -18,7 +18,7 @@ class UnicodeServiceProvider implements ServiceProviderInterface { public function register(Application $app) { - $app['unicode'] = $app->share(function($app) { + $app['unicode'] = $app->share(function ($app) { return new \unicode(); }); } diff --git a/lib/Alchemy/Phrasea/Helper/Record/Printer.php b/lib/Alchemy/Phrasea/Helper/Record/Printer.php index dc9c30b4c2..a610e072af 100644 --- a/lib/Alchemy/Phrasea/Helper/Record/Printer.php +++ b/lib/Alchemy/Phrasea/Helper/Record/Printer.php @@ -39,7 +39,7 @@ class Printer extends RecordHelper { parent::__construct($app, $Request); - $grep = function(\record_adapter $record) { + $grep = function (\record_adapter $record) { try { return $record->get_thumbnail()->get_type() == \media_subdef::TYPE_IMAGE || diff --git a/lib/Alchemy/Phrasea/Metadata/TagProvider.php b/lib/Alchemy/Phrasea/Metadata/TagProvider.php index 216cfdf6be..ad888ccdd3 100644 --- a/lib/Alchemy/Phrasea/Metadata/TagProvider.php +++ b/lib/Alchemy/Phrasea/Metadata/TagProvider.php @@ -19,7 +19,7 @@ class TagProvider extends ExiftoolTagProvider { parent::__construct(); - $this['Phraseanet'] = $this->share(function(){ + $this['Phraseanet'] = $this->share(function () { return array( 'PdfText' => new \Alchemy\Phrasea\Metadata\Tag\PdfText(), 'TfArchivedate' => new \Alchemy\Phrasea\Metadata\Tag\TfArchivedate(), diff --git a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngine.php b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngine.php index 044ee3231b..03b6081ea6 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngine.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngine.php @@ -694,16 +694,16 @@ class PhraseaEngine implements SearchEngineInterface } } if ($this->options->getFields()) { - $this->queries[$sbas] .= ' IN (' . implode(' OR ', array_map(function(\databox_field $field) { + $this->queries[$sbas] .= ' IN (' . implode(' OR ', array_map(function (\databox_field $field) { return $field->get_name(); }, $this->options->getFields())) . ')'; } if (($this->options->getMinDate() || $this->options->getMaxDate()) && $this->options->getDateFields()) { if ($this->options->getMinDate()) { - $this->queries[$sbas] .= ' AND ( ' . implode(' >= ' . $this->options->getMinDate()->format('Y-m-d') . ' OR ', array_map(function(\databox_field $field){ return $field->get_name(); }, $this->options->getDateFields())) . ' >= ' . $this->options->getMinDate()->format('Y-m-d') . ' ) '; + $this->queries[$sbas] .= ' AND ( ' . implode(' >= ' . $this->options->getMinDate()->format('Y-m-d') . ' OR ', array_map(function (\databox_field $field) { return $field->get_name(); }, $this->options->getDateFields())) . ' >= ' . $this->options->getMinDate()->format('Y-m-d') . ' ) '; } if ($this->options->getMaxDate()) { - $this->queries[$sbas] .= ' AND ( ' . implode(' <= ' . $this->options->getMaxDate()->format('Y-m-d') . ' OR ', array_map(function(\databox_field $field){ return $field->get_name(); }, $this->options->getDateFields())) . ' <= ' . $this->options->getMaxDate()->format('Y-m-d') . ' ) '; + $this->queries[$sbas] .= ' AND ( ' . implode(' <= ' . $this->options->getMaxDate()->format('Y-m-d') . ' OR ', array_map(function (\databox_field $field) { return $field->get_name(); }, $this->options->getDateFields())) . ' <= ' . $this->options->getMaxDate()->format('Y-m-d') . ' ) '; } } } @@ -714,7 +714,7 @@ class PhraseaEngine implements SearchEngineInterface $this->singleParse($sbas, $this->queries[$sbas]); } - $base_ids = array_map(function(\collection $collection) { + $base_ids = array_map(function (\collection $collection) { return $collection->get_base_id(); }, $this->options->getCollections()); diff --git a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineLogger.php b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineLogger.php index 149b9317e4..69d5c34f73 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineLogger.php +++ b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineLogger.php @@ -38,7 +38,7 @@ class SearchEngineLogger ':date' => date("Y-m-d H:i:s"), ':query' => $query, ':nbresults' => $answers, - ':colls' => implode(',', array_map(function($coll_id) { + ':colls' => implode(',', array_map(function ($coll_id) { return (int) $coll_id; }, $coll_ids)), )); diff --git a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php index 795ed58277..8be3d460a2 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php +++ b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php @@ -473,12 +473,12 @@ class SearchEngineOptions $value = $value->format(DATE_ATOM); } if (in_array($key, array('date_fields', 'fields'))) { - $value = array_map(function(\databox_field $field) { + $value = array_map(function (\databox_field $field) { return $field->get_databox()->get_sbas_id() . '_' . $field->get_id(); }, $value); } if (in_array($key, array('collections', 'business_fields'))) { - $value = array_map(function($collection) { + $value = array_map(function ($collection) { return $collection->get_base_id(); }, $value); } @@ -529,7 +529,7 @@ class SearchEngineOptions } break; case in_array($key, array('date_fields', 'fields')): - $value = array_map(function($serialized) use ($app) { + $value = array_map(function ($serialized) use ($app) { $data = explode('_', $serialized); return \databox_field::get_instance($app, $app['phraseanet.appbox']->get_databox($data[0]), $data[1]); @@ -537,7 +537,7 @@ class SearchEngineOptions }, $value); break; case in_array($key, array('collections', 'business_fields')): - $value = array_map(function($base_id) use ($app) { + $value = array_map(function ($base_id) use ($app) { return \collection::get_from_base_id($app, $base_id); }, $value); break; @@ -620,7 +620,7 @@ class SearchEngineOptions $options->setLocale($app['locale.I18n']); if (is_array($request->get('bases'))) { - $bas = array_map(function($base_id) use ($app) { + $bas = array_map(function ($base_id) use ($app) { return \collection::get_from_base_id($app, $base_id); }, $request->get('bases')); } elseif (!$app['authentication']->isAuthenticated()) { @@ -629,7 +629,7 @@ class SearchEngineOptions $bas = $app['authentication']->getUser()->ACL()->get_granted_base(); } - $bas = array_filter($bas, function($collection) use ($app) { + $bas = array_filter($bas, function ($collection) use ($app) { if ($app['authentication']->isAuthenticated()) { return $app['authentication']->getUser()->ACL()->has_access_to_base($collection->get_base_id()); } else { @@ -646,7 +646,7 @@ class SearchEngineOptions } if ($app['authentication']->isAuthenticated() && $app['authentication']->getUser()->ACL()->has_right('modifyrecord')) { - $BF = array_filter($bas, function($collection) use ($app) { + $BF = array_filter($bas, function ($collection) use ($app) { return $app['authentication']->getUser()->ACL()->has_right_on_base($collection->get_base_id(), 'canmodifrecord'); }); diff --git a/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngine.php b/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngine.php index e2c5016b72..611c3677d5 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngine.php +++ b/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngine.php @@ -626,7 +626,7 @@ class SphinxSearchEngine implements SearchEngineInterface $this->sphinx->SetFilter('parent_record_id', array($options->getSearchType())); if ($options->getDateFields() && ($options->getMaxDate() || $options->getMinDate())) { - foreach (array_unique(array_map(function(\databox_field $field) { + foreach (array_unique(array_map(function (\databox_field $field) { return $field->get_name(); }, $options->getDateFields())) as $field) { diff --git a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php index 758478c354..4f40d208db 100644 --- a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php +++ b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php @@ -35,7 +35,7 @@ class Migration31 implements MigrationInterface require __DIR__ . '/../../../../../../config/_GV.php'; $GV = require __DIR__ . '/../../../../../../lib/conf.d/_GV_template.inc'; - $retrieve_old_credentials = function() { + $retrieve_old_credentials = function () { require __DIR__ . '/../../../../../../config/connexion.inc'; return array( diff --git a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration35.php b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration35.php index 56812fa069..64a8c2d01e 100644 --- a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration35.php +++ b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration35.php @@ -35,7 +35,7 @@ class Migration35 implements MigrationInterface $config['registration-fields'][$key]['required'] = (boolean) $field['required']; } - $retrieve_old_credentials = function() { + $retrieve_old_credentials = function () { require __DIR__ . '/../../../../../../config/connexion.inc'; return array( @@ -52,7 +52,7 @@ class Migration35 implements MigrationInterface $config['main']['database'][$key] = (string) $value; } - $retrieve_old_parameters = function() { + $retrieve_old_parameters = function () { require __DIR__ . '/../../../../../../config/config.inc'; return array( diff --git a/lib/classes/API/OAuth2/Exception/Redirect/TemporaryUnavailable.php b/lib/classes/API/OAuth2/Exception/Redirect/TemporaryUnavailable.php index af63f28d0c..ab885b4442 100644 --- a/lib/classes/API/OAuth2/Exception/Redirect/TemporaryUnavailable.php +++ b/lib/classes/API/OAuth2/Exception/Redirect/TemporaryUnavailable.php @@ -20,7 +20,7 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ -class API_OAuth2_Exception_Redirect_Unauthorized extends API_OAuth2_Exception_Redirect +class API_OAuth2_Exception_Redirect_TemporaryUnavailable extends API_OAuth2_Exception_Redirect { /** * @@ -36,10 +36,10 @@ class API_OAuth2_Exception_Redirect_Unauthorized extends API_OAuth2_Exception_Re /** * - * @param string $redirect_uri - * @param string $state - * @param string $error_uri - * @return API_OAuth2_Exception_Redirect_Unauthorized + * @param string $redirect_uri + * @param string $state + * @param string $error_uri + * @return API_OAuth2_Exception_Redirect_TemporaryUnavailable */ public function __construct($redirect_uri, $state = null, $error_uri = null) { diff --git a/lib/classes/API/V1/adapter.php b/lib/classes/API/V1/adapter.php index ad5e1767aa..5ecc54d349 100644 --- a/lib/classes/API/V1/adapter.php +++ b/lib/classes/API/V1/adapter.php @@ -680,7 +680,7 @@ class API_V1_adapter extends API_V1_Abstract $reasons = $output = null; - $callback = function($element, $visa, $code) use (&$reasons, &$output) { + $callback = function ($element, $visa, $code) use (&$reasons, &$output) { if (!$visa->isValid()) { $reasons = array(); @@ -900,9 +900,9 @@ class API_V1_adapter extends API_V1_Abstract $this->app['EM']->flush(); foreach ($options->getDataboxes() as $databox) { - $colls = array_map(function(\collection $collection) { + $colls = array_map(function (\collection $collection) { return $collection->get_coll_id(); - }, array_filter($options->getCollections(), function(\collection $collection) use ($databox) { + }, array_filter($options->getCollections(), function (\collection $collection) use ($databox) { return $collection->get_databox()->get_sbas_id() == $databox->get_sbas_id(); })); @@ -1908,7 +1908,7 @@ class API_V1_adapter extends API_V1_Abstract $caption = $story->get_caption(); - $format = function(caption_record $caption, $dcField) { + $format = function (caption_record $caption, $dcField) { $field = $caption->get_dc_field($dcField); diff --git a/lib/classes/Bridge/Api.php b/lib/classes/Bridge/Api.php index f430e8eccf..69ce9f96a0 100644 --- a/lib/classes/Bridge/Api.php +++ b/lib/classes/Bridge/Api.php @@ -173,7 +173,7 @@ class Bridge_Api */ public function list_elements($type, $offset_start = 0, $quantity = 10) { - $action = function(Bridge_Api $obj) use ($type, $offset_start, $quantity ) { + $action = function (Bridge_Api $obj) use ($type, $offset_start, $quantity) { return $obj->get_connector()->list_elements($type, $offset_start, $quantity); }; @@ -189,7 +189,7 @@ class Bridge_Api */ public function list_containers($type, $offset_start = 0, $quantity = 10) { - $action = function(Bridge_Api $obj) use ($type, $offset_start, $quantity ) { + $action = function (Bridge_Api $obj) use ($type, $offset_start, $quantity) { return $obj->get_connector()->list_containers($type, $offset_start, $quantity); }; @@ -205,7 +205,7 @@ class Bridge_Api */ public function update_element($object, $object_id, Array $datas) { - $action = function(Bridge_Api $obj) use ($object, $object_id, $datas) { + $action = function (Bridge_Api $obj) use ($object, $object_id, $datas) { return $obj->get_connector()->update_element($object, $object_id, $datas); }; @@ -220,7 +220,7 @@ class Bridge_Api */ public function create_container($container_type, Request $request) { - $action = function(Bridge_Api $obj) use ($container_type, $request) { + $action = function (Bridge_Api $obj) use ($container_type, $request) { return $obj->get_connector()->create_container($container_type, $request); }; @@ -237,7 +237,7 @@ class Bridge_Api */ public function add_element_to_container($element_type, $element_id, $destination, $container_id) { - $action = function(Bridge_Api $obj) use ($element_type, $element_id, $destination, $container_id) { + $action = function (Bridge_Api $obj) use ($element_type, $element_id, $destination, $container_id) { return $obj->get_connector()->add_element_to_container($element_type, $element_id, $destination, $container_id); }; @@ -252,7 +252,7 @@ class Bridge_Api */ public function delete_object($object, $object_id) { - $action = function(Bridge_Api $obj) use ($object, $object_id) { + $action = function (Bridge_Api $obj) use ($object, $object_id) { return $obj->get_connector()->delete_object($object, $object_id); }; @@ -265,7 +265,7 @@ class Bridge_Api */ public function acceptable_records() { - $action = function(Bridge_Api $obj) { + $action = function (Bridge_Api $obj) { return $obj->get_connector()->acceptable_records(); }; @@ -280,7 +280,7 @@ class Bridge_Api */ public function get_element_from_id($element_id, $type) { - $action = function(Bridge_Api $obj) use ($element_id, $type) { + $action = function (Bridge_Api $obj) use ($element_id, $type) { return $obj->get_connector()->get_element_from_id($element_id, $type); }; @@ -295,7 +295,7 @@ class Bridge_Api */ public function get_container_from_id($element_id, $type) { - $action = function(Bridge_Api $obj) use ($element_id, $type) { + $action = function (Bridge_Api $obj) use ($element_id, $type) { return $obj->get_connector()->get_container_from_id($element_id, $type); }; @@ -308,7 +308,7 @@ class Bridge_Api */ public function get_category_list() { - $action = function(Bridge_Api $obj) { + $action = function (Bridge_Api $obj) { return $obj->get_connector()->get_category_list(); }; @@ -323,7 +323,7 @@ class Bridge_Api */ public function get_element_status(Bridge_Element $element) { - $action = function(Bridge_Api $obj) use ($element) { + $action = function (Bridge_Api $obj) use ($element) { return $obj->get_connector()->get_element_status($element); }; @@ -337,7 +337,7 @@ class Bridge_Api */ public function map_connector_to_element_status($status) { - $action = function(Bridge_Api $obj) use ($status) { + $action = function (Bridge_Api $obj) use ($status) { return $obj->get_connector()->map_connector_to_element_status($status); }; @@ -351,7 +351,7 @@ class Bridge_Api */ public function get_error_message_from_status($connector_status) { - $action = function(Bridge_Api $obj) use ($connector_status) { + $action = function (Bridge_Api $obj) use ($connector_status) { return $obj->get_connector()->get_error_message_from_status($connector_status); }; @@ -366,7 +366,7 @@ class Bridge_Api */ public function upload(record_adapter $record, array $options = array()) { - $action = function(Bridge_Api $obj) use ($record, $options) { + $action = function (Bridge_Api $obj) use ($record, $options) { return $obj->get_connector()->upload($record, $options); }; diff --git a/lib/classes/Bridge/Api/Dailymotion.php b/lib/classes/Bridge/Api/Dailymotion.php index 7c1099b23a..1ceea2f94b 100644 --- a/lib/classes/Bridge/Api/Dailymotion.php +++ b/lib/classes/Bridge/Api/Dailymotion.php @@ -370,7 +370,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I ); if ( ! $this->is_valid_object_id($object_id)) - throw new Bridge_Exception_InvalidObjectId($object_id); + throw new Bridge_Exception_ActionInvalidObjectId($object_id); switch ($object) { case self::ELEMENT_TYPE_VIDEO : @@ -804,7 +804,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I public function check_upload_constraints(Array $datas, record_adapter $record) { $errors = $this->check_record_constraints($record); - $check = function($field) use (&$errors, $datas, $record) { + $check = function ($field) use (&$errors, $datas, $record) { $key = $record->get_serialize_key(); $required = ! ! $field["required"]; $name = $field["name"]; @@ -830,7 +830,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I public function check_update_constraints(Array $datas) { $errors = array(); - $check = function($field) use (&$errors, $datas) { + $check = function ($field) use (&$errors, $datas) { $required = ! ! $field["required"]; $name = $field["name"]; $length = (int) $field["length"]; diff --git a/lib/classes/Bridge/Api/Flickr.php b/lib/classes/Bridge/Api/Flickr.php index 3b5ac101e3..91c7ccd3bf 100644 --- a/lib/classes/Bridge/Api/Flickr.php +++ b/lib/classes/Bridge/Api/Flickr.php @@ -697,7 +697,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf public function check_upload_constraints(array $datas, record_adapter $record) { $errors = $this->check_record_constraints($record); - $check = function($field) use (&$errors, $datas, $record) { + $check = function ($field) use (&$errors, $datas, $record) { $key = $record->get_serialize_key(); $name = $field['name']; $length = (int) $field['length']; @@ -720,7 +720,7 @@ class Bridge_Api_Flickr extends Bridge_Api_Abstract implements Bridge_Api_Interf public function check_update_constraints(Array $datas) { $errors = array(); - $check = function($field) use (&$errors, $datas) { + $check = function ($field) use (&$errors, $datas) { $name = $field['name']; $length = (int) $field['length']; $required = ! ! $field['required']; diff --git a/lib/classes/Bridge/Api/Youtube.php b/lib/classes/Bridge/Api/Youtube.php index 5a9dd092ba..32bd8bcfe5 100644 --- a/lib/classes/Bridge/Api/Youtube.php +++ b/lib/classes/Bridge/Api/Youtube.php @@ -304,7 +304,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter } if ( ! $this->is_valid_object_id($object_id)) - throw new Bridge_Exception_InvalidObjectId($object_id); + throw new Bridge_Exception_ActionInvalidObjectId($object_id); switch ($object) { case "video" : @@ -911,7 +911,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter { $errors = $this->check_record_constraints($record); - $check = function($field) use (&$errors, $datas, $record) { + $check = function ($field) use (&$errors, $datas, $record) { $key = $record->get_serialize_key(); $name = $field['name']; $length = (int) $field['length']; @@ -938,7 +938,7 @@ class Bridge_Api_Youtube extends Bridge_Api_Abstract implements Bridge_Api_Inter public function check_update_constraints(Array $datas) { $errors = array(); - $check = function($field) use (&$errors, $datas) { + $check = function ($field) use (&$errors, $datas) { $name = $field['name']; $length = (int) $field['length']; $required = ! ! $field['required']; diff --git a/lib/classes/Bridge/Exception/ActionInvalidObjectId.php b/lib/classes/Bridge/Exception/ActionInvalidObjectId.php index 2533f856d1..b09e1c4790 100644 --- a/lib/classes/Bridge/Exception/ActionInvalidObjectId.php +++ b/lib/classes/Bridge/Exception/ActionInvalidObjectId.php @@ -15,7 +15,7 @@ * @license http://opensource.org/licenses/gpl-3.0 GPLv3 * @link www.phraseanet.com */ -class Bridge_Exception_InvalidObjectId extends Bridge_Exception +class Bridge_Exception_ActionInvalidObjectId extends Bridge_Exception { } diff --git a/lib/classes/Browser.php b/lib/classes/Browser.php index 317276b3b1..6609f0b48e 100644 --- a/lib/classes/Browser.php +++ b/lib/classes/Browser.php @@ -737,7 +737,7 @@ class Browser } return true; - } else if(stripos($this->_agent, 'trident') !== false) { + } elseif (stripos($this->_agent, 'trident') !== false) { // >= IE 11 $this->setBrowser(self::BROWSER_IE); diff --git a/lib/classes/patch/3819.php b/lib/classes/patch/3819.php index cb44bc11e4..d5c7556042 100644 --- a/lib/classes/patch/3819.php +++ b/lib/classes/patch/3819.php @@ -10,7 +10,6 @@ */ use Alchemy\Phrasea\Application; -use Symfony\Component\Process\ExecutableFinder; class patch_3819 implements patchInterface { diff --git a/lib/classes/patch/3820.php b/lib/classes/patch/3820.php index 26d14f7a90..153d486d5b 100644 --- a/lib/classes/patch/3820.php +++ b/lib/classes/patch/3820.php @@ -10,7 +10,6 @@ */ use Alchemy\Phrasea\Application; -use Symfony\Component\Process\ExecutableFinder; class patch_3820 implements patchInterface { diff --git a/tests/Alchemy/Tests/Phrasea/Application/ApiAbstract.php b/tests/Alchemy/Tests/Phrasea/Application/ApiAbstract.php index e5663b212c..8b2a6ee258 100644 --- a/tests/Alchemy/Tests/Phrasea/Application/ApiAbstract.php +++ b/tests/Alchemy/Tests/Phrasea/Application/ApiAbstract.php @@ -67,14 +67,14 @@ abstract class ApiAbstract extends \PhraseanetWebTestCaseAbstract { parent::setUp(); - self::$DI['app'] = self::$DI->share(function() { + self::$DI['app'] = self::$DI->share(function () { $environment = 'test'; $app = require __DIR__ . '/../../../../../lib/Alchemy/Phrasea/Application/Api.php'; $app['debug'] = true; - $app['EM'] = $app->share($app->extend('EM', function($em) { + $app['EM'] = $app->share($app->extend('EM', function ($em) { @unlink('/tmp/db.sqlite'); copy(__DIR__ . '/../../../../db-ref.sqlite', '/tmp/db.sqlite'); diff --git a/tests/Alchemy/Tests/Phrasea/Application/ApiRootTest.php b/tests/Alchemy/Tests/Phrasea/Application/ApiRootTest.php index 395dd3b51b..4a18688e0d 100644 --- a/tests/Alchemy/Tests/Phrasea/Application/ApiRootTest.php +++ b/tests/Alchemy/Tests/Phrasea/Application/ApiRootTest.php @@ -17,7 +17,7 @@ class ApiRootTest extends \PhraseanetWebTestCaseAbstract { parent::setUp(); - self::$DI['app'] = self::$DI->share(function() { + self::$DI['app'] = self::$DI->share(function () { $environment = 'test'; $app = require __DIR__ . '/../../../../../lib/Alchemy/Phrasea/Application/Api.php'; diff --git a/tests/Alchemy/Tests/Phrasea/ApplicationTest.php b/tests/Alchemy/Tests/Phrasea/ApplicationTest.php index 28929a0f71..fa8e7d7975 100644 --- a/tests/Alchemy/Tests/Phrasea/ApplicationTest.php +++ b/tests/Alchemy/Tests/Phrasea/ApplicationTest.php @@ -154,7 +154,7 @@ class ApplicationTest extends \PhraseanetPHPUnitAbstract { $app = new Application('test'); $sessionId = null; - $app->post('/prod/upload/', function(Application $app) use (&$sessionId) { + $app->post('/prod/upload/', function (Application $app) use (&$sessionId) { $sessionId = $app['session']->getId(); }); @@ -315,7 +315,7 @@ class ApplicationTest extends \PhraseanetPHPUnitAbstract unlink($app['phraseanet.configuration.config-compiled-path']); } - $app->get('/', function(Application $app, Request $request) { + $app->get('/', function (Application $app, Request $request) { return 'Hello'; }); @@ -342,7 +342,7 @@ class ApplicationTest extends \PhraseanetPHPUnitAbstract { $app = new Application('test'); - $app->get('/', function(Application $app, Request $request) { + $app->get('/', function (Application $app, Request $request) { return $app['locale']; }); unset($app['exception_handler']); @@ -363,7 +363,7 @@ class ApplicationTest extends \PhraseanetPHPUnitAbstract private function getApp() { $app = new Application('test'); - $app->get('/', function(Application $app, Request $request) { + $app->get('/', function (Application $app, Request $request) { $app['session']->set('usr_id', 5); diff --git a/tests/Alchemy/Tests/Phrasea/Controller/MinifierTest.php b/tests/Alchemy/Tests/Phrasea/Controller/MinifierTest.php index e69ec09fd1..d9dfd1099d 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/MinifierTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/MinifierTest.php @@ -35,7 +35,7 @@ class MinifierTest extends \PhraseanetPHPUnitAbstract { $groups = require __DIR__ . '/../../../../../lib/conf.d/minifyGroupsConfig.php'; - return array_map(function($group){return array($group);}, array_keys($groups)); + return array_map(function ($group) {return array($group);}, array_keys($groups)); } /** diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Prod/ExportTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Prod/ExportTest.php index e00748d3a7..2ac18721f0 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Prod/ExportTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Prod/ExportTest.php @@ -37,7 +37,7 @@ class ExportTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testTestFtpConnexion() { $framework = $this; - self::$DI['app']['phraseanet.ftp.client'] = self::$DI['app']->protect(function($host, $port = 21, $timeout = 90, $ssl = false, $proxy = false, $proxyport = false) use ($framework) { + self::$DI['app']['phraseanet.ftp.client'] = self::$DI['app']->protect(function ($host, $port = 21, $timeout = 90, $ssl = false, $proxy = false, $proxyport = false) use ($framework) { return $framework->getMockBuilder('\ftpclient') ->setMethods(array('login', 'close')) ->disableOriginalConstructor() @@ -59,7 +59,7 @@ class ExportTest extends \PhraseanetWebTestCaseAuthenticatedAbstract public function testFtpConnexionNoXMLHTTPRequests() { $framework = $this; - self::$DI['app']['phraseanet.ftp.client'] = self::$DI['app']->protect(function($host, $port = 21, $timeout = 90, $ssl = false, $proxy = false, $proxyport = false) use ($framework) { + self::$DI['app']['phraseanet.ftp.client'] = self::$DI['app']->protect(function ($host, $port = 21, $timeout = 90, $ssl = false, $proxy = false, $proxyport = false) use ($framework) { $ftpStub = $framework->getMockBuilder('\ftpclient') ->setMethods(array('login', 'close')) ->disableOriginalConstructor() diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Root/RootTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Root/RootTest.php index 441cfdc056..a1ff36e894 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Root/RootTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Root/RootTest.php @@ -87,7 +87,7 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $boolean = false; - $app->get('/unit-test-route', function(Application $app) use (&$boolean) { + $app->get('/unit-test-route', function (Application $app) use (&$boolean) { $boolean = $app['authentication']->isAuthenticated(); return new Response(); @@ -136,7 +136,7 @@ class RootTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $boolean = false; - $app->get('/unit-test-route', function(Application $app) use (&$boolean) { + $app->get('/unit-test-route', function (Application $app) use (&$boolean) { $boolean = $app['authentication']->isAuthenticated(); return new Response(); diff --git a/tests/Alchemy/Tests/Phrasea/Core/Event/Subscriber/PhraseaLocaleSubscriberTest.php b/tests/Alchemy/Tests/Phrasea/Core/Event/Subscriber/PhraseaLocaleSubscriberTest.php index 65f587c661..c9f5c92dad 100644 --- a/tests/Alchemy/Tests/Phrasea/Core/Event/Subscriber/PhraseaLocaleSubscriberTest.php +++ b/tests/Alchemy/Tests/Phrasea/Core/Event/Subscriber/PhraseaLocaleSubscriberTest.php @@ -63,8 +63,8 @@ class PhraseaLocaleSubscriberTest extends \PhraseanetPHPUnitAbstract $client->request('GET', '/', array(), array(), array('HTTP_ACCEPT_LANGUAGE' => 'fr-FR,fr;q=0.9')); $settedCookie = null; - foreach($client->getResponse()->headers->getCookies() as $cookie) { - if($cookie->getName() === 'locale') { + foreach ($client->getResponse()->headers->getCookies() as $cookie) { + if ($cookie->getName() === 'locale') { $settedCookie = $cookie; break; } @@ -114,7 +114,7 @@ class PhraseaLocaleSubscriberTest extends \PhraseanetPHPUnitAbstract $app['dispatcher']->addSubscriber(new PhraseaLocaleSubscriber($app)); - $app->get('/', function(Application $app, Request $request) { + $app->get('/', function (Application $app, Request $request) { return $app['locale'] ? $app['locale'] : ''; }); diff --git a/tests/Alchemy/Tests/Phrasea/Notification/DelivererTest.php b/tests/Alchemy/Tests/Phrasea/Notification/DelivererTest.php index da848a3a60..36f599e5bf 100644 --- a/tests/Alchemy/Tests/Phrasea/Notification/DelivererTest.php +++ b/tests/Alchemy/Tests/Phrasea/Notification/DelivererTest.php @@ -61,7 +61,7 @@ class DelivererTest extends \PHPUnit_Framework_TestCase $mailer = $this->getMailerMock(); $mailer->expects($this->once()) ->method('send') - ->will($this->returnCallback(function($email) use (&$catchEmail) { + ->will($this->returnCallback(function ($email) use (&$catchEmail) { $catchEmail = $email; })); @@ -125,7 +125,7 @@ class DelivererTest extends \PHPUnit_Framework_TestCase $mailer = $this->getMailerMock(); $mailer->expects($this->once()) ->method('send') - ->will($this->returnCallback(function($email) use (&$catchEmail) { + ->will($this->returnCallback(function ($email) use (&$catchEmail) { $catchEmail = $email; })); @@ -158,7 +158,7 @@ class DelivererTest extends \PHPUnit_Framework_TestCase $mailer = $this->getMailerMock(); $mailer->expects($this->once()) ->method('send') - ->will($this->returnCallback(function($email) use (&$catchEmail) { + ->will($this->returnCallback(function ($email) use (&$catchEmail) { $catchEmail = $email; })); @@ -191,7 +191,7 @@ class DelivererTest extends \PHPUnit_Framework_TestCase $mailer = $this->getMailerMock(); $mailer->expects($this->once()) ->method('send') - ->will($this->returnCallback(function($email) use (&$catchEmail) { + ->will($this->returnCallback(function ($email) use (&$catchEmail) { $catchEmail = $email; })); @@ -233,7 +233,7 @@ class DelivererTest extends \PHPUnit_Framework_TestCase $mailer = $this->getMailerMock(); $mailer->expects($this->once()) ->method('send') - ->will($this->returnCallback(function($email) use (&$catchEmail) { + ->will($this->returnCallback(function ($email) use (&$catchEmail) { $catchEmail = $email; })); @@ -272,7 +272,7 @@ class DelivererTest extends \PHPUnit_Framework_TestCase $mailer = $this->getMailerMock(); $mailer->expects($this->once()) ->method('send') - ->will($this->returnCallback(function($email) use (&$catchEmail) { + ->will($this->returnCallback(function ($email) use (&$catchEmail) { $catchEmail = $email; })); @@ -315,7 +315,7 @@ class DelivererTest extends \PHPUnit_Framework_TestCase $mailer = $this->getMailerMock(); $mailer->expects($this->once()) ->method('send') - ->will($this->returnCallback(function($email) use (&$catchEmail) { + ->will($this->returnCallback(function ($email) use (&$catchEmail) { $catchEmail = $email; })); diff --git a/tests/Alchemy/Tests/Phrasea/Setup/AbstractSetupTester.php b/tests/Alchemy/Tests/Phrasea/Setup/AbstractSetupTester.php index 30b18cdac8..e40dc50f27 100644 --- a/tests/Alchemy/Tests/Phrasea/Setup/AbstractSetupTester.php +++ b/tests/Alchemy/Tests/Phrasea/Setup/AbstractSetupTester.php @@ -21,7 +21,7 @@ abstract class AbstractSetupTester extends \PHPUnit_Framework_TestCase { rename(__DIR__ . '/../../../../../config/configuration.yml', __DIR__ . '/../../../../../config/configuration.yml.test'); - $this->tearDownHandlers[] = function() { + $this->tearDownHandlers[] = function () { rename(__DIR__ . '/../../../../../config/configuration.yml.test', __DIR__ . '/../../../../../config/configuration.yml'); }; } @@ -45,7 +45,7 @@ abstract class AbstractSetupTester extends \PHPUnit_Framework_TestCase \$dbname = 'ab_unitTests'; "); - $this->tearDownHandlers[] = function() { + $this->tearDownHandlers[] = function () { @unlink(__DIR__ . '/../../../../../config/_GV.php'); @unlink(__DIR__ . '/../../../../../config/connexion.inc'); }; @@ -67,7 +67,7 @@ abstract class AbstractSetupTester extends \PHPUnit_Framework_TestCase \$dbname = '".$credentials['dbname']."'; "); - $this->tearDownHandlers[] = function() { + $this->tearDownHandlers[] = function () { @unlink(__DIR__ . '/../../../../../config/config.inc'); @unlink(__DIR__ . '/../../../../../config/connexion.inc'); }; diff --git a/tests/classes/PhraseanetWebTestCaseAuthenticatedAbstract.php b/tests/classes/PhraseanetWebTestCaseAuthenticatedAbstract.php index 2d0f08a936..8bfdf66233 100644 --- a/tests/classes/PhraseanetWebTestCaseAuthenticatedAbstract.php +++ b/tests/classes/PhraseanetWebTestCaseAuthenticatedAbstract.php @@ -83,7 +83,7 @@ abstract class PhraseanetWebTestCaseAuthenticatedAbstract extends PhraseanetPHPU self::$DI['app']['authentication']->setUser($stubAuthenticatedUser); - self::$DI['client'] = self::$DI->share(function($DI) { + self::$DI['client'] = self::$DI->share(function ($DI) { return new Client($DI['app'], array()); }); } diff --git a/tests/classes/databox/databox_fieldTest.php b/tests/classes/databox/databox_fieldTest.php index 1be34b6a20..51f248c9b1 100644 --- a/tests/classes/databox/databox_fieldTest.php +++ b/tests/classes/databox/databox_fieldTest.php @@ -348,7 +348,7 @@ class databox_fieldTest extends PhraseanetPHPUnitAbstract $this->object_mono->set_label($code, null)->save(); $this->assertEquals($this->object_mono->get_name(), $this->object_mono->get_label($code)); - + $this->object_mono->set_label($code, '')->save(); $this->assertEquals($this->object_mono->get_name(), $this->object_mono->get_label($code)); }