diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php index 294c764fda..3f63f12ecd 100644 --- a/lib/Alchemy/Phrasea/Application.php +++ b/lib/Alchemy/Phrasea/Application.php @@ -182,7 +182,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(); }); @@ -209,7 +209,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( @@ -240,7 +240,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']; }); @@ -344,7 +344,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'); } @@ -362,7 +362,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) { @@ -370,12 +370,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')); } @@ -385,7 +385,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()); @@ -535,7 +535,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 40a0c7de84..1b60f44805 100644 --- a/lib/Alchemy/Phrasea/CLI.php +++ b/lib/Alchemy/Phrasea/CLI.php @@ -46,7 +46,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 bef04eb73a..abe2123ffd 100644 --- a/lib/Alchemy/Phrasea/Command/Command.php +++ b/lib/Alchemy/Phrasea/Command/Command.php @@ -39,14 +39,14 @@ abstract class Command extends SymfoCommand implements CommandInterface $handler = new StreamHandler('php://stdout'); $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 b1db0c1a60..102ace0cbd 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Collection.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Collection.php @@ -25,7 +25,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 06faee873c..11d89b5732 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php @@ -23,7 +23,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 00c3afcf81..b31e5d4f63 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Dashboard.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Dashboard.php @@ -31,7 +31,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 172b7fce5d..501ea5a4bb 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Databox.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Databox.php @@ -28,7 +28,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')); }); @@ -65,7 +65,7 @@ class Databox implements ControllerProviderInterface */ $controllers->post('/{databox_id}/delete/', $this->call('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'); @@ -84,7 +84,7 @@ class Databox implements ControllerProviderInterface */ $controllers->post('/{databox_id}/unmount/', $this->call('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'); @@ -103,7 +103,7 @@ class Databox implements ControllerProviderInterface */ $controllers->post('/{databox_id}/empty/', $this->call('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'); @@ -122,7 +122,7 @@ class Databox implements ControllerProviderInterface */ $controllers->get('/{databox_id}/collections/order/', $this->call('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'); @@ -141,7 +141,7 @@ class Databox implements ControllerProviderInterface */ $controllers->post('/{databox_id}/collections/order/', $this->call('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'); @@ -160,7 +160,7 @@ class Databox implements ControllerProviderInterface */ $controllers->post('/{databox_id}/collection/', $this->call('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'); @@ -180,13 +180,13 @@ class Databox implements ControllerProviderInterface */ $controllers->get('/{databox_id}/cgus/', $this->call('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/', $this->call('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'); @@ -205,7 +205,7 @@ class Databox implements ControllerProviderInterface */ $controllers->post('/{databox_id}/cgus/', $this->call('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'); @@ -224,7 +224,7 @@ class Databox implements ControllerProviderInterface */ $controllers->get('/{databox_id}/informations/documents/', $this->call('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'); @@ -243,7 +243,7 @@ class Databox implements ControllerProviderInterface */ $controllers->get('/{databox_id}/informations/details/', $this->call('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'); @@ -263,7 +263,7 @@ class Databox implements ControllerProviderInterface $controllers->post('/{databox_id}/collection/{collection_id}/mount/', $this->call('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'); @@ -282,7 +282,7 @@ class Databox implements ControllerProviderInterface */ $controllers->get('/{databox_id}/collection/', $this->call('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'); @@ -301,7 +301,7 @@ class Databox implements ControllerProviderInterface */ $controllers->post('/{databox_id}/logo/', $this->call('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'); @@ -320,7 +320,7 @@ class Databox implements ControllerProviderInterface */ $controllers->post('/{databox_id}/logo/delete/', $this->call('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'); @@ -339,7 +339,7 @@ class Databox implements ControllerProviderInterface */ $controllers->post('/{databox_id}/clear-logs/', $this->call('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'); @@ -358,7 +358,7 @@ class Databox implements ControllerProviderInterface */ $controllers->post('/{databox_id}/reindex/', $this->call('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'); @@ -377,7 +377,7 @@ class Databox implements ControllerProviderInterface */ $controllers->post('/{databox_id}/indexable/', $this->call('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'); @@ -396,7 +396,7 @@ class Databox implements ControllerProviderInterface */ $controllers->post('/{databox_id}/view-name/', $this->call('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 3b1f93a861..d917ef3c72 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php @@ -29,7 +29,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'); }); @@ -64,7 +64,7 @@ class Databoxes implements ControllerProviderInterface */ $controllers->post('/', $this->call('createDatabase')) ->bind('admin_database_new') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireAdmin(); }); @@ -83,7 +83,7 @@ class Databoxes implements ControllerProviderInterface */ $controllers->post('/mount/', $this->call('databaseMount')) ->bind('admin_database_mount') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireAdmin(); }); @@ -102,7 +102,7 @@ class Databoxes implements ControllerProviderInterface */ $controllers->post('/upgrade/', $this->call('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/Publications.php b/lib/Alchemy/Phrasea/Controller/Admin/Publications.php index 5ad1cfdead..bed4b83827 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Publications.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Publications.php @@ -29,12 +29,12 @@ class Publications 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('bas_chupub'); }); - $controllers->get('/list/', function(PhraseaApplication $app) { + $controllers->get('/list/', function (PhraseaApplication $app) { $feeds = \Feed_Collection::load_all( $app, $app['authentication']->getUser() @@ -44,7 +44,7 @@ class Publications implements ControllerProviderInterface ->render('admin/publications/list.html.twig', array('feeds' => $feeds)); })->bind('admin_feeds_list'); - $controllers->post('/create/', function(PhraseaApplication $app, Request $request) { + $controllers->post('/create/', function (PhraseaApplication $app, Request $request) { $feed = \Feed_Adapter::create( $app, $app['authentication']->getUser(), $request->request->get('title'), $request->request->get('subtitle') @@ -59,7 +59,7 @@ class Publications implements ControllerProviderInterface return $app->redirectPath('admin_feeds_list'); })->bind('admin_feeds_create'); - $controllers->get('/feed/{id}/', function(PhraseaApplication $app, Request $request, $id) { + $controllers->get('/feed/{id}/', function (PhraseaApplication $app, Request $request, $id) { $feed = new \Feed_Adapter($app, $id); return $app['twig'] @@ -68,7 +68,7 @@ class Publications implements ControllerProviderInterface ->bind('admin_feeds_feed') ->assert('id', '\d+'); - $controllers->post('/feed/{id}/update/', function(PhraseaApplication $app, Request $request, $id) { + $controllers->post('/feed/{id}/update/', function (PhraseaApplication $app, Request $request, $id) { $feed = new \Feed_Adapter($app, $id); @@ -84,7 +84,7 @@ class Publications implements ControllerProviderInterface $feed->set_public($request->request->get('public')); return $app->redirectPath('admin_feeds_list'); - })->before(function(Request $request) use ($app) { + })->before(function (Request $request) use ($app) { $feed = new \Feed_Adapter($app, $request->attributes->get('id')); if (!$feed->is_owner($app['authentication']->getUser())) { @@ -94,7 +94,7 @@ class Publications implements ControllerProviderInterface ->bind('admin_feeds_feed_update') ->assert('id', '\d+'); - $controllers->post('/feed/{id}/iconupload/', function(PhraseaApplication $app, Request $request, $id) { + $controllers->post('/feed/{id}/iconupload/', function (PhraseaApplication $app, Request $request, $id) { $datas = array( 'success' => false, 'message' => '', @@ -162,7 +162,7 @@ class Publications implements ControllerProviderInterface ->bind('admin_feeds_feed_icon') ->assert('id', '\d+'); - $controllers->post('/feed/{id}/addpublisher/', function(PhraseaApplication $app, $id) { + $controllers->post('/feed/{id}/addpublisher/', function (PhraseaApplication $app, $id) { $error = ''; try { $request = $app['request']; @@ -178,7 +178,7 @@ class Publications implements ControllerProviderInterface ->bind('admin_feeds_feed_add_publisher') ->assert('id', '\d+'); - $controllers->post('/feed/{id}/removepublisher/', function(PhraseaApplication $app, $id) { + $controllers->post('/feed/{id}/removepublisher/', function (PhraseaApplication $app, $id) { try { $request = $app['request']; @@ -196,7 +196,7 @@ class Publications implements ControllerProviderInterface ->bind('admin_feeds_feed_remove_publisher') ->assert('id', '\d+'); - $controllers->post('/feed/{id}/delete/', function(PhraseaApplication $app, $id) { + $controllers->post('/feed/{id}/delete/', function (PhraseaApplication $app, $id) { $feed = new \Feed_Adapter($app, $id); $feed->delete(); diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Root.php b/lib/Alchemy/Phrasea/Controller/Admin/Root.php index d068654b63..7a9d2a2b3d 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Root.php @@ -29,11 +29,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 { \User_Adapter::updateClientInfos($app, 3); } catch (SessionNotFound $e) { @@ -101,7 +101,7 @@ class Root implements ControllerProviderInterface )); })->bind('admin'); - $controllers->get('/tree/', function(Application $app, Request $request) { + $controllers->get('/tree/', function (Application $app, Request $request) { try { \User_Adapter::updateClientInfos($app, 3); } catch (SessionNotFound $e) { @@ -161,7 +161,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')); @@ -195,7 +195,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); } @@ -222,7 +222,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); } @@ -248,7 +248,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); } @@ -259,7 +259,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); } @@ -314,7 +314,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')); } @@ -337,7 +337,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 d13174956e..1b92566394 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Setup.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Setup.php @@ -35,7 +35,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 71aed53852..bbc8aa7a40 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/TaskManager.php b/lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php index 6de02ae451..8b6bb8e1e2 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php @@ -25,15 +25,15 @@ class TaskManager implements ControllerProviderInterface { $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireRight('taskmanager'); }); - $controllers->get('/', function(Application $app, Request $request) { + $controllers->get('/', function (Application $app, Request $request) { return $app->redirectPath('admin_tasks_list'); })->bind('admin_tasks'); - $controllers->get('/tasks/', function(Application $app, Request $request) { + $controllers->get('/tasks/', function (Application $app, Request $request) { if ($request->getContentType() == 'json') { return $app->json($app['task-manager']->toArray()); @@ -48,7 +48,7 @@ class TaskManager implements ControllerProviderInterface } })->bind('admin_tasks_list'); - $controllers->post('/tasks/create/', function(Application $app, Request $request) { + $controllers->post('/tasks/create/', function (Application $app, Request $request) { if (!class_exists($className = $request->request->get('tcl'))) { $app->abort(400, sprintf('Unknown task %s', $className)); } @@ -68,7 +68,7 @@ class TaskManager implements ControllerProviderInterface /* * route /admin/scheduler/stop */ - $controllers->get('/scheduler/stop', function(Application $app, Request $request) use ($app) { + $controllers->get('/scheduler/stop', function (Application $app, Request $request) use ($app) { try { $app['task-manager']->setSchedulerState(\task_manager::STATE_TOSTOP); @@ -80,7 +80,7 @@ class TaskManager implements ControllerProviderInterface return $app->json(array('success' => false)); })->bind('admin_tasks_scheduler_stop'); - $controllers->get('/scheduler/log', function(Application $app, Request $request) { + $controllers->get('/scheduler/log', function (Application $app, Request $request) { $logdir = $app['root.path'] . '/logs/'; $rname = '/scheduler((\.log)|(-.*\.log))$/'; @@ -102,7 +102,7 @@ class TaskManager implements ControllerProviderInterface return $app->redirectPath('admin_tasks_scheduler_log'); } - return $app->stream(function() use ($finder, $app) { + return $app->stream(function () use ($finder, $app) { foreach ($finder->getIterator() as $file) { printf("

%s\n", $file->getRealPath()); printf(" path('admin_tasks_scheduler_log', array('clr' => $file->getFilename()))."\">%s" @@ -118,7 +118,7 @@ class TaskManager implements ControllerProviderInterface }, 200, array('Content-Type' => 'text/html')); })->bind('admin_tasks_scheduler_log'); - $controllers->get('/task/{id}/log', function(Application $app, Request $request, $id) { + $controllers->get('/task/{id}/log', function (Application $app, Request $request, $id) { $logdir = $app['root.path'] . '/logs/'; $rname = '/task_' . $id . '((\.log)|(-.*\.log))$/'; @@ -140,7 +140,7 @@ class TaskManager implements ControllerProviderInterface return $app->redirectPath('admin_tasks_task_log', array('id' => $id)); } - return $app->stream(function() use ($finder, $id) { + return $app->stream(function () use ($finder, $id) { foreach ($finder->getIterator() as $file) { printf("

%s\n", $file->getRealPath()); printf(" %s" @@ -158,7 +158,7 @@ class TaskManager implements ControllerProviderInterface }); })->bind('admin_tasks_task_log'); - $controllers->get('/task/{id}/delete', function(Application $app, Request $request, $id) { + $controllers->get('/task/{id}/delete', function (Application $app, Request $request, $id) { try { $task = $app['task-manager']->getTask($id); @@ -175,7 +175,7 @@ class TaskManager implements ControllerProviderInterface } })->bind('admin_tasks_task_delete'); - $controllers->get('/task/{id}/tostart', function(Application $app, Request $request, $id) { + $controllers->get('/task/{id}/tostart', function (Application $app, Request $request, $id) { $ret = false; try { @@ -192,7 +192,7 @@ class TaskManager implements ControllerProviderInterface return $app->json($ret); })->bind('admin_tasks_task_start'); - $controllers->get('/task/{id}/tostop', function(Application $app, Request $request, $id) { + $controllers->get('/task/{id}/tostop', function (Application $app, Request $request, $id) { $ret = false; try { @@ -213,7 +213,7 @@ class TaskManager implements ControllerProviderInterface return $app->json($ret); })->bind('admin_tasks_task_stop'); - $controllers->get('/task/{id}/resetcrashcounter/', function(Application $app, Request $request, $id) { + $controllers->get('/task/{id}/resetcrashcounter/', function (Application $app, Request $request, $id) { try { $task = $app['task-manager']->getTask($id); @@ -230,7 +230,7 @@ class TaskManager implements ControllerProviderInterface * route /admin/task-manager/task/{id}/save * return json */ - $controllers->post('/task/{id}/save/', function(Application $app, Request $request, $id) { + $controllers->post('/task/{id}/save/', function (Application $app, Request $request, $id) { $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->strictErrorChecking = true; @@ -259,7 +259,7 @@ class TaskManager implements ControllerProviderInterface * route /admin/task-manager/task/{id}/facility/ * call callback(s) of a task, for ex. to transform gui(form) to xml settings */ - $controllers->post('/task/{id}/facility/', function(Application $app, Request $request, $id) { + $controllers->post('/task/{id}/facility/', function (Application $app, Request $request, $id) { $ret = ''; try { @@ -299,7 +299,7 @@ class TaskManager implements ControllerProviderInterface return $ret; })->bind('admin_tasks_task_facility'); - $controllers->get('/task/{id}', function(Application $app, Request $request, $id) { + $controllers->get('/task/{id}', function (Application $app, Request $request, $id) { $task = $app['task-manager']->getTask($id); @@ -315,7 +315,7 @@ class TaskManager implements ControllerProviderInterface * route /admin/task/checkxml/ * check if the xml is valid */ - $controllers->post('/task/checkxml/', function(Application $app, Request $request) { + $controllers->post('/task/checkxml/', function (Application $app, Request $request) { $ret = array('ok' => true, 'err' => null); $dom = new \DOMDocument('1.0', 'UTF-8'); $dom->strictErrorChecking = true; diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Users.php b/lib/Alchemy/Phrasea/Controller/Admin/Users.php index 09c969597b..cbf373e1b8 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/Users.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/Users.php @@ -29,24 +29,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); @@ -60,14 +60,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 { @@ -88,58 +88,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']); @@ -195,7 +195,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(); @@ -203,7 +203,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); @@ -241,7 +241,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 { @@ -264,7 +264,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); @@ -339,7 +339,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"; @@ -396,7 +396,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(); @@ -571,11 +571,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')); } @@ -593,7 +593,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); @@ -727,7 +727,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)) { @@ -859,7 +859,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'); @@ -878,7 +878,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 4dbff772d4..8949e8fd8a 100644 --- a/lib/Alchemy/Phrasea/Controller/Api/Oauth2.php +++ b/lib/Alchemy/Phrasea/Controller/Api/Oauth2.php @@ -28,7 +28,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); }); @@ -38,7 +38,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']; @@ -145,7 +145,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/Api/V1.php b/lib/Alchemy/Phrasea/Controller/Api/V1.php index a85b1296a0..0d6d83b11d 100644 --- a/lib/Alchemy/Phrasea/Controller/Api/V1.php +++ b/lib/Alchemy/Phrasea/Controller/Api/V1.php @@ -50,7 +50,7 @@ class V1 implements ControllerProviderInterface * @ throws \API_V1_exception_unauthorized * @ throws \API_V1_exception_forbidden */ - $controllers->before(function($request) use ($app) { + $controllers->before(function ($request) use ($app) { $context = new Context(Context::CONTEXT_OAUTH2_TOKEN); $app['dispatcher']->dispatch(PhraseaEvents::PRE_AUTHENTICATE, new PreAuthenticate($request, $context)); @@ -165,7 +165,7 @@ class V1 implements ControllerProviderInterface /** * Method Not Allowed Closure */ - $bad_request_exception = function() { + $bad_request_exception = function () { throw new \API_V1_exception_badrequest(); }; @@ -189,7 +189,7 @@ class V1 implements ControllerProviderInterface * Parameters : * */ - $controllers->get('/monitor/scheduler/', function(SilexApplication $app, Request $request) { + $controllers->get('/monitor/scheduler/', function (SilexApplication $app, Request $request) { return $app['api']->get_scheduler($app)->get_response(); })->before($mustBeAdmin); @@ -203,7 +203,7 @@ class V1 implements ControllerProviderInterface * Parameters : * */ - $controllers->get('/monitor/tasks/', function(SilexApplication $app, Request $request) { + $controllers->get('/monitor/tasks/', function (SilexApplication $app, Request $request) { return $app['api']->get_task_list($app)->get_response(); })->before($mustBeAdmin); @@ -217,7 +217,7 @@ class V1 implements ControllerProviderInterface * Parameters : * */ - $controllers->get('/monitor/task/{task_id}/', function(SilexApplication $app, Request $request, $task_id) { + $controllers->get('/monitor/task/{task_id}/', function (SilexApplication $app, Request $request, $task_id) { return $app['api']->get_task($app, $task_id)->get_response(); })->before($mustBeAdmin)->assert('task_id', '\d+'); @@ -232,7 +232,7 @@ class V1 implements ControllerProviderInterface * - name (string) change the name of the task * - autostart (boolean) start task when scheduler starts */ - $controllers->post('/monitor/task/{task_id}/', function(SilexApplication $app, Request $request, $task_id) { + $controllers->post('/monitor/task/{task_id}/', function (SilexApplication $app, Request $request, $task_id) { return $app['api']->set_task_property($app, $task_id)->get_response(); })->before($mustBeAdmin)->assert('task_id', '\d+'); @@ -246,7 +246,7 @@ class V1 implements ControllerProviderInterface * Parameters : * */ - $controllers->post('/monitor/task/{task_id}/start/', function(SilexApplication $app, Request $request, $task_id) { + $controllers->post('/monitor/task/{task_id}/start/', function (SilexApplication $app, Request $request, $task_id) { return $app['api']->start_task($app, $task_id)->get_response(); })->before($mustBeAdmin); @@ -260,7 +260,7 @@ class V1 implements ControllerProviderInterface * Parameters : * */ - $controllers->post('/monitor/task/{task_id}/stop/', function(SilexApplication $app, Request $request, $task_id) { + $controllers->post('/monitor/task/{task_id}/stop/', function (SilexApplication $app, Request $request, $task_id) { return $app['api']->stop_task($app, $task_id)->get_response(); })->before($mustBeAdmin); @@ -274,7 +274,7 @@ class V1 implements ControllerProviderInterface * Parameters : * */ - $controllers->get('/monitor/phraseanet/', function(SilexApplication $app, Request $request) { + $controllers->get('/monitor/phraseanet/', function (SilexApplication $app, Request $request) { return $app['api']->get_phraseanet_monitor($app)->get_response(); })->before($mustBeAdmin); @@ -286,7 +286,7 @@ class V1 implements ControllerProviderInterface * Parameters : * */ - $controllers->get('/databoxes/list/', function(SilexApplication $app, Request $request) { + $controllers->get('/databoxes/list/', function (SilexApplication $app, Request $request) { return $app['api']->get_databoxes($request)->get_response(); }); @@ -298,7 +298,7 @@ class V1 implements ControllerProviderInterface * Parameters ; * DATABOX_ID : required INT */ - $controllers->get('/databoxes/{databox_id}/collections/', function(SilexApplication $app, $databox_id) { + $controllers->get('/databoxes/{databox_id}/collections/', function (SilexApplication $app, $databox_id) { return $app['api'] ->get_databox_collections($app['request'], $databox_id) ->get_response(); @@ -315,7 +315,7 @@ class V1 implements ControllerProviderInterface * DATABOX_ID : required INT * */ - $controllers->get('/databoxes/{databox_id}/status/', function(SilexApplication $app, $databox_id) { + $controllers->get('/databoxes/{databox_id}/status/', function (SilexApplication $app, $databox_id) { return $app['api'] ->get_databox_status($app['request'], $databox_id) ->get_response(); @@ -331,7 +331,7 @@ class V1 implements ControllerProviderInterface * Parameters ; * DATABOX_ID : required INT */ - $controllers->get('/databoxes/{databox_id}/metadatas/', function(SilexApplication $app, $databox_id) { + $controllers->get('/databoxes/{databox_id}/metadatas/', function (SilexApplication $app, $databox_id) { return $app['api'] ->get_databox_metadatas($app['request'], $databox_id) ->get_response(); @@ -347,7 +347,7 @@ class V1 implements ControllerProviderInterface * Parameters ; * DATABOX_ID : required INT */ - $controllers->get('/databoxes/{databox_id}/termsOfUse/', function(SilexApplication $app, $databox_id) { + $controllers->get('/databoxes/{databox_id}/termsOfUse/', function (SilexApplication $app, $databox_id) { return $app['api'] ->get_databox_terms($app['request'], $databox_id) ->get_response(); @@ -355,11 +355,11 @@ class V1 implements ControllerProviderInterface $controllers->get('/databoxes/{any_id}/termsOfUse/', $bad_request_exception); - $controllers->get('/quarantine/list/', function(SilexApplication $app, Request $request) { + $controllers->get('/quarantine/list/', function (SilexApplication $app, Request $request) { return $app['api']->list_quarantine($app, $request)->get_response(); }); - $controllers->get('/quarantine/item/{lazaret_id}/', function($lazaret_id, SilexApplication $app, Request $request) { + $controllers->get('/quarantine/item/{lazaret_id}/', function ($lazaret_id, SilexApplication $app, Request $request) { return $app['api']->list_quarantine_item($lazaret_id, $app, $request)->get_response(); }); @@ -371,7 +371,7 @@ class V1 implements ControllerProviderInterface * Parameters : * */ - $controllers->post('/records/add/', function(SilexApplication $app, Request $request) { + $controllers->post('/records/add/', function (SilexApplication $app, Request $request) { return $app['api']->add_record($app, $request)->get_response(); }); @@ -391,7 +391,7 @@ class V1 implements ControllerProviderInterface * Array containing an array of records and stories collection * */ - $controllers->match('/search/', function() use ($app) { + $controllers->match('/search/', function () use ($app) { return $app['api']->search($app['request'])->get_response(); }); @@ -411,11 +411,11 @@ class V1 implements ControllerProviderInterface * Array of record objects * */ - $controllers->match('/records/search/', function(SilexApplication $app) { + $controllers->match('/records/search/', function (SilexApplication $app) { return $app['api']->search_records($app['request'])->get_response(); }); - $controllers->get('/records/{databox_id}/{record_id}/caption/', function(SilexApplication $app, $databox_id, $record_id) { + $controllers->get('/records/{databox_id}/{record_id}/caption/', function (SilexApplication $app, $databox_id, $record_id) { return $app['api'] ->caption_records($app['request'], $databox_id, $record_id) ->get_response(); @@ -433,7 +433,7 @@ class V1 implements ControllerProviderInterface * RECORD_ID : required INT * */ - $controllers->get('/records/{databox_id}/{record_id}/metadatas/', function(SilexApplication $app, $databox_id, $record_id) { + $controllers->get('/records/{databox_id}/{record_id}/metadatas/', function (SilexApplication $app, $databox_id, $record_id) { return $app['api'] ->get_record_metadatas($app['request'], $databox_id, $record_id) ->get_response(); @@ -451,7 +451,7 @@ class V1 implements ControllerProviderInterface * RECORD_ID : required INT * */ - $controllers->get('/records/{databox_id}/{record_id}/status/', function(SilexApplication $app, $databox_id, $record_id) { + $controllers->get('/records/{databox_id}/{record_id}/status/', function (SilexApplication $app, $databox_id, $record_id) { return $app['api'] ->get_record_status($app['request'], $databox_id, $record_id) ->get_response(); @@ -469,7 +469,7 @@ class V1 implements ControllerProviderInterface * RECORD_ID : required INT * */ - $controllers->get('/records/{databox_id}/{record_id}/related/', function(SilexApplication $app, $databox_id, $record_id) { + $controllers->get('/records/{databox_id}/{record_id}/related/', function (SilexApplication $app, $databox_id, $record_id) { return $app['api'] ->get_record_related($app['request'], $databox_id, $record_id) ->get_response(); @@ -487,7 +487,7 @@ class V1 implements ControllerProviderInterface * RECORD_ID : required INT * */ - $controllers->get('/records/{databox_id}/{record_id}/embed/', function(SilexApplication $app, $databox_id, $record_id) { + $controllers->get('/records/{databox_id}/{record_id}/embed/', function (SilexApplication $app, $databox_id, $record_id) { return $app['api'] ->get_record_embed($app['request'], $databox_id, $record_id) ->get_response(); @@ -505,7 +505,7 @@ class V1 implements ControllerProviderInterface * RECORD_ID : required INT * */ - $controllers->post('/records/{databox_id}/{record_id}/setmetadatas/', function(SilexApplication $app, $databox_id, $record_id) { + $controllers->post('/records/{databox_id}/{record_id}/setmetadatas/', function (SilexApplication $app, $databox_id, $record_id) { return $app['api'] ->set_record_metadatas($app['request'], $databox_id, $record_id) ->get_response(); @@ -523,7 +523,7 @@ class V1 implements ControllerProviderInterface * RECORD_ID : required INT * */ - $controllers->post('/records/{databox_id}/{record_id}/setstatus/', function(SilexApplication $app, $databox_id, $record_id) { + $controllers->post('/records/{databox_id}/{record_id}/setstatus/', function (SilexApplication $app, $databox_id, $record_id) { return $app['api'] ->set_record_status($app['request'], $databox_id, $record_id) ->get_response(); @@ -541,7 +541,7 @@ class V1 implements ControllerProviderInterface * RECORD_ID : required INT * */ - $controllers->post('/records/{databox_id}/{record_id}/setcollection/', function(SilexApplication $app, $databox_id, $record_id) { + $controllers->post('/records/{databox_id}/{record_id}/setcollection/', function (SilexApplication $app, $databox_id, $record_id) { return $app['api'] ->set_record_collection($app['request'], $databox_id, $record_id) ->get_response(); @@ -549,7 +549,7 @@ class V1 implements ControllerProviderInterface $controllers->post('/records/{wrong_databox_id}/{wrong_record_id}/setcollection/', $bad_request_exception); - $controllers->get('/records/{databox_id}/{record_id}/', function(SilexApplication $app, $databox_id, $record_id) { + $controllers->get('/records/{databox_id}/{record_id}/', function (SilexApplication $app, $databox_id, $record_id) { return $app['api'] ->get_record($app['request'], $databox_id, $record_id) ->get_response(); @@ -565,7 +565,7 @@ class V1 implements ControllerProviderInterface * Parameters : * */ - $controllers->get('/baskets/list/', function(SilexApplication $app) { + $controllers->get('/baskets/list/', function (SilexApplication $app) { return $app['api']->search_baskets($app['request'])->get_response(); }); @@ -577,7 +577,7 @@ class V1 implements ControllerProviderInterface * Parameters : * */ - $controllers->post('/baskets/add/', function(SilexApplication $app) { + $controllers->post('/baskets/add/', function (SilexApplication $app) { return $app['api']->create_basket($app['request'])->get_response(); }); @@ -590,7 +590,7 @@ class V1 implements ControllerProviderInterface * BASKET_ID : required INT * */ - $controllers->get('/baskets/{basket_id}/content/', function(SilexApplication $app, $basket_id) { + $controllers->get('/baskets/{basket_id}/content/', function (SilexApplication $app, $basket_id) { return $app['api']->get_basket($app['request'], $basket_id)->get_response(); })->assert('basket_id', '\d+'); @@ -605,7 +605,7 @@ class V1 implements ControllerProviderInterface * BASKET_ID : required INT * */ - $controllers->post('/baskets/{basket_id}/setname/', function(SilexApplication $app, $basket_id) { + $controllers->post('/baskets/{basket_id}/setname/', function (SilexApplication $app, $basket_id) { return $app['api'] ->set_basket_title($app['request'], $basket_id) ->get_response(); @@ -622,7 +622,7 @@ class V1 implements ControllerProviderInterface * BASKET_ID : required INT * */ - $controllers->post('/baskets/{basket_id}/setdescription/', function(SilexApplication $app, $basket_id) { + $controllers->post('/baskets/{basket_id}/setdescription/', function (SilexApplication $app, $basket_id) { return $app['api'] ->set_basket_description($app['request'], $basket_id) ->get_response(); @@ -639,7 +639,7 @@ class V1 implements ControllerProviderInterface * BASKET_ID : required INT * */ - $controllers->post('/baskets/{basket_id}/delete/', function(SilexApplication $app, $basket_id) { + $controllers->post('/baskets/{basket_id}/delete/', function (SilexApplication $app, $basket_id) { return $app['api']->delete_basket($app['request'], $basket_id)->get_response(); })->assert('basket_id', '\d+'); @@ -653,19 +653,19 @@ class V1 implements ControllerProviderInterface * Parameters : * */ - $controllers->get('/feeds/list/', function(SilexApplication $app) { + $controllers->get('/feeds/list/', function (SilexApplication $app) { return $app['api'] ->search_publications($app['request'], $app['authentication']->getUser()) ->get_response(); }); - $controllers->get('/feeds/content/', function(SilexApplication $app) { + $controllers->get('/feeds/content/', function (SilexApplication $app) { return $app['api'] ->get_publications($app['request'], $app['authentication']->getUser()) ->get_response(); }); - $controllers->get('/feeds/entry/{entry_id}/', function(SilexApplication $app, $entry_id) { + $controllers->get('/feeds/entry/{entry_id}/', function (SilexApplication $app, $entry_id) { return $app['api'] ->get_feed_entry($app['request'], $entry_id, $app['authentication']->getUser()) ->get_response(); @@ -682,7 +682,7 @@ class V1 implements ControllerProviderInterface * PUBLICATION_ID : required INT * */ - $controllers->get('/feeds/{feed_id}/content/', function(SilexApplication $app, $feed_id) { + $controllers->get('/feeds/{feed_id}/content/', function (SilexApplication $app, $feed_id) { return $app['api'] ->get_publication($app['request'], $feed_id, $app['authentication']->getUser()) ->get_response(); @@ -700,7 +700,7 @@ class V1 implements ControllerProviderInterface * RECORD_ID : required INT * */ - $controllers->get('/stories/{databox_id}/{story_id}/embed/', function($databox_id, $story_id) use ($app) { + $controllers->get('/stories/{databox_id}/{story_id}/embed/', function ($databox_id, $story_id) use ($app) { $result = $app['api']->get_story_embed($app['request'], $databox_id, $story_id); return $result->get_response(); @@ -709,7 +709,7 @@ class V1 implements ControllerProviderInterface $controllers->get('/stories/{any_id}/{anyother_id}/embed/', $bad_request_exception); - $controllers->get('/stories/{databox_id}/{story_id}/', function($databox_id, $story_id) use ($app) { + $controllers->get('/stories/{databox_id}/{story_id}/', function ($databox_id, $story_id) use ($app) { $result = $app['api']->get_story($app['request'], $databox_id, $story_id); return $result->get_response(); @@ -717,7 +717,7 @@ class V1 implements ControllerProviderInterface $controllers->get('/stories/{any_id}/{anyother_id}/', $bad_request_exception); - $controllers->get('/stories/{databox_id}/{story_id}/', function($databox_id, $story_id) use ($app) { + $controllers->get('/stories/{databox_id}/{story_id}/', function ($databox_id, $story_id) use ($app) { $result = $app['api']->get_story($app['request'], $databox_id, $story_id); return $result->get_response(); diff --git a/lib/Alchemy/Phrasea/Controller/Client/Baskets.php b/lib/Alchemy/Phrasea/Controller/Client/Baskets.php index 2916ef8695..b0488569d2 100644 --- a/lib/Alchemy/Phrasea/Controller/Client/Baskets.php +++ b/lib/Alchemy/Phrasea/Controller/Client/Baskets.php @@ -25,7 +25,7 @@ class Baskets implements ControllerProviderInterface { $controllers = $app['controllers_factory']; - $controllers->before(function() use ($app) { + $controllers->before(function () use ($app) { $app['firewall']->requireAuthentication(); }); @@ -260,7 +260,7 @@ class Baskets implements ControllerProviderInterface $selectedBasket = $app['EM']->getRepository('\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 ea86827611..2032c89ad2 100644 --- a/lib/Alchemy/Phrasea/Controller/Client/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Client/Root.php @@ -26,7 +26,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')); } @@ -151,9 +151,9 @@ class Root implements ControllerProviderInterface $result = $app['phraseanet.SE']->query($query, ($currentPage - 1) * $perPage, $perPage); 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(); })); @@ -406,7 +406,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 628b763580..f66ff93980 100644 --- a/lib/Alchemy/Phrasea/Controller/Datafiles.php +++ b/lib/Alchemy/Phrasea/Controller/Datafiles.php @@ -31,13 +31,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/Lightbox.php b/lib/Alchemy/Phrasea/Controller/Lightbox.php index 0e2a3d487c..04758a4df1 100644 --- a/lib/Alchemy/Phrasea/Controller/Lightbox.php +++ b/lib/Alchemy/Phrasea/Controller/Lightbox.php @@ -25,7 +25,7 @@ class Lightbox implements ControllerProviderInterface { $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { if (!$request->query->has('LOG')) { return; } @@ -58,7 +58,7 @@ class Lightbox implements ControllerProviderInterface } }); - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication(); }); @@ -92,7 +92,7 @@ class Lightbox implements ControllerProviderInterface }) ->bind('lightbox'); - $controllers->get('/ajax/NOTE_FORM/{sselcont_id}/', function(SilexApplication $app, $sselcont_id) { + $controllers->get('/ajax/NOTE_FORM/{sselcont_id}/', function (SilexApplication $app, $sselcont_id) { if (!$app['browser']->isMobile()) { return new Response(''); @@ -112,7 +112,7 @@ class Lightbox implements ControllerProviderInterface ->bind('lightbox_ajax_note_form') ->assert('sselcont_id', '\d+'); - $controllers->get('/ajax/LOAD_BASKET_ELEMENT/{sselcont_id}/', function(SilexApplication $app, $sselcont_id) { + $controllers->get('/ajax/LOAD_BASKET_ELEMENT/{sselcont_id}/', function (SilexApplication $app, $sselcont_id) { /* @var $repository \Repositories\BasketElementRepository */ $repository = $app['EM']->getRepository('\Entities\BasketElement'); @@ -158,7 +158,7 @@ class Lightbox implements ControllerProviderInterface ->bind('lightbox_ajax_load_basketelement') ->assert('sselcont_id', '\d+'); - $controllers->get('/ajax/LOAD_FEED_ITEM/{entry_id}/{item_id}/', function(SilexApplication $app, $entry_id, $item_id) { + $controllers->get('/ajax/LOAD_FEED_ITEM/{entry_id}/{item_id}/', function (SilexApplication $app, $entry_id, $item_id) { $entry = \Feed_Entry_Adapter::load_from_id($app, $entry_id); $item = new \Feed_Entry_Item($app['phraseanet.appbox'], $entry, $item_id); @@ -339,7 +339,7 @@ class Lightbox implements ControllerProviderInterface ->bind('lightbox_feed_entry') ->assert('entry_id', '\d+'); - $controllers->get('/ajax/LOAD_REPORT/{ssel_id}/', function(SilexApplication $app, $ssel_id) { + $controllers->get('/ajax/LOAD_REPORT/{ssel_id}/', function (SilexApplication $app, $ssel_id) { $template = 'lightbox/basket_content_report.html.twig'; @@ -400,7 +400,7 @@ class Lightbox implements ControllerProviderInterface ->bind('lightbox_ajax_set_note') ->assert('sselcont_id', '\d+'); - $controllers->post('/ajax/SET_ELEMENT_AGREEMENT/{sselcont_id}/', function(SilexApplication $app, $sselcont_id) { + $controllers->post('/ajax/SET_ELEMENT_AGREEMENT/{sselcont_id}/', function (SilexApplication $app, $sselcont_id) { $request = $app['request']; $agreement = $request->request->get('agreement'); @@ -463,7 +463,7 @@ class Lightbox implements ControllerProviderInterface ->bind('lightbox_ajax_set_element_agreement') ->assert('sselcont_id', '\d+'); - $controllers->post('/ajax/SET_RELEASE/{ssel_id}/', function(SilexApplication $app, $ssel_id) { + $controllers->post('/ajax/SET_RELEASE/{ssel_id}/', function (SilexApplication $app, $ssel_id) { $repository = $app['EM']->getRepository('\Entities\Basket'); diff --git a/lib/Alchemy/Phrasea/Controller/Permalink.php b/lib/Alchemy/Phrasea/Controller/Permalink.php index 2b99864e7e..0c50e7ffb6 100644 --- a/lib/Alchemy/Phrasea/Controller/Permalink.php +++ b/lib/Alchemy/Phrasea/Controller/Permalink.php @@ -45,7 +45,7 @@ class Permalink extends AbstractDelivery return $record; }; - $deliverPermaview = function($sbas_id, $record_id, $token, $subdef, PhraseaApplication $app) use ($retrieveRecord) { + $deliverPermaview = function ($sbas_id, $record_id, $token, $subdef, PhraseaApplication $app) use ($retrieveRecord) { $databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id); $record = $retrieveRecord($app, $databox, $token, $record_id, $subdef); @@ -61,7 +61,7 @@ class Permalink extends AbstractDelivery return $app['twig']->render('overview.html.twig', $params); }; - $deliverPermalink = function(PhraseaApplication $app, $sbas_id, $record_id, $token, $subdef) use ($that, $retrieveRecord) { + $deliverPermalink = function (PhraseaApplication $app, $sbas_id, $record_id, $token, $subdef) use ($that, $retrieveRecord) { $databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id); $record = $retrieveRecord($app, $databox, $token, $record_id, $subdef); @@ -113,7 +113,7 @@ class Permalink extends AbstractDelivery return $response; }; - $controllers->get('/v1/{sbas_id}/{record_id}/caption/', function(PhraseaApplication $app, Request $request, $sbas_id, $record_id) { + $controllers->get('/v1/{sbas_id}/{record_id}/caption/', function (PhraseaApplication $app, Request $request, $sbas_id, $record_id) { $token = $request->query->get('token'); $databox = $app['phraseanet.appbox']->get_databox((int) $sbas_id); @@ -138,7 +138,7 @@ class Permalink extends AbstractDelivery ->assert('sbas_id', '\d+') ->assert('record_id', '\d+'); - $controllers->get('/v1/{label}/{sbas_id}/{record_id}/{token}/{subdef}/view/', function(PhraseaApplication $app, $label, $sbas_id, $record_id, $token, $subdef) use ($deliverPermaview) { + $controllers->get('/v1/{label}/{sbas_id}/{record_id}/{token}/{subdef}/view/', function (PhraseaApplication $app, $label, $sbas_id, $record_id, $token, $subdef) use ($deliverPermaview) { return $deliverPermaview($sbas_id, $record_id, $token, $subdef, $app); }) ->bind('permalinks_permaview_old') @@ -154,7 +154,7 @@ class Permalink extends AbstractDelivery ->assert('sbas_id', '\d+') ->assert('record_id', '\d+'); - $controllers->get('/v1/{label}/{sbas_id}/{record_id}/{token}/{subdef}/', function(PhraseaApplication $app, $label, $sbas_id, $record_id, $token, $subdef) use ($deliverPermalink) { + $controllers->get('/v1/{label}/{sbas_id}/{record_id}/{token}/{subdef}/', function (PhraseaApplication $app, $label, $sbas_id, $record_id, $token, $subdef) use ($deliverPermalink) { return $deliverPermalink($app, $sbas_id, $record_id, $token, $subdef); }) ->bind('permalinks_permalink_old') diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Basket.php b/lib/Alchemy/Phrasea/Controller/Prod/Basket.php index ad7b04ed57..56bb42eb85 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Basket.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Basket.php @@ -33,7 +33,7 @@ class Basket 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 0b3b6d671c..bf8815b6aa 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php @@ -23,7 +23,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 4fe68cf0ac..086fbfa166 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Download.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Download.php @@ -26,7 +26,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 81983b8176..bb51dc58e6 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Edit.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Edit.php @@ -30,13 +30,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')); @@ -228,7 +228,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'); @@ -267,7 +267,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 fc299acc9c..86c3cfdf94 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/Feed.php b/lib/Alchemy/Phrasea/Controller/Prod/Feed.php index e13c099542..aa382311fc 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Feed.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Feed.php @@ -31,14 +31,14 @@ class Feed implements ControllerProviderInterface { $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication(); }); /** * I got a selection of docs, which publications are available forthese docs ? */ - $controllers->post('/requestavailable/', function(Application $app, Request $request) { + $controllers->post('/requestavailable/', function (Application $app, Request $request) { $feeds = \Feed_Collection::load_all($app, $app['authentication']->getUser()); $publishing = RecordsRequest::fromRequest($app, $request, true, array(), array('bas_chupub')); @@ -48,7 +48,7 @@ class Feed implements ControllerProviderInterface /** * I've selected a publication for my docs, let's publish them */ - $controllers->post('/entry/create/', function(Application $app, Request $request) { + $controllers->post('/entry/create/', function (Application $app, Request $request) { try { $feed = new \Feed_Adapter($app, $request->request->get('feed_id')); $publisher = \Feed_Publisher_Adapter::getPublisher($app['phraseanet.appbox'], $feed, $app['authentication']->getUser()); @@ -73,11 +73,11 @@ class Feed implements ControllerProviderInterface return $app->json($datas); }) ->bind('prod_feeds_entry_create') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRight('bas_chupub'); }); - $controllers->get('/entry/{id}/edit/', function(Application $app, Request $request, $id) { + $controllers->get('/entry/{id}/edit/', function (Application $app, Request $request, $id) { $entry = \Feed_Entry_Adapter::load_from_id($app, $id); if (!$entry->is_publisher($app['authentication']->getUser())) { @@ -92,11 +92,11 @@ class Feed implements ControllerProviderInterface }) ->bind('feed_entry_edit') ->assert('id', '\d+') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRight('bas_chupub'); }); - $controllers->post('/entry/{id}/update/', function(Application $app, Request $request, $id) { + $controllers->post('/entry/{id}/update/', function (Application $app, Request $request, $id) { $datas = array('error' => true, 'message' => '', 'datas' => ''); try { $app['phraseanet.appbox']->get_connection()->beginTransaction(); @@ -167,11 +167,11 @@ class Feed implements ControllerProviderInterface return $app->json($datas); }) ->bind('prod_feeds_entry_update') - ->assert('id', '\d+')->before(function(Request $request) use ($app) { + ->assert('id', '\d+')->before(function (Request $request) use ($app) { $app['firewall']->requireRight('bas_chupub'); }); - $controllers->post('/entry/{id}/delete/', function(Application $app, Request $request, $id) { + $controllers->post('/entry/{id}/delete/', function (Application $app, Request $request, $id) { $datas = array('error' => true, 'message' => ''); try { $app['phraseanet.appbox']->get_connection()->beginTransaction(); @@ -198,11 +198,11 @@ class Feed implements ControllerProviderInterface return $app->json($datas); }) ->bind('feed_entry_delete') - ->assert('id', '\d+')->before(function(Request $request) use ($app) { + ->assert('id', '\d+')->before(function (Request $request) use ($app) { $app['firewall']->requireRight('bas_chupub'); }); - $controllers->get('/', function(Application $app, Request $request) { + $controllers->get('/', function (Application $app, Request $request) { $request = $app['request']; $page = (int) $request->query->get('page'); $page = $page > 0 ? $page : 1; @@ -220,7 +220,7 @@ class Feed implements ControllerProviderInterface return new Response($datas); })->bind('prod_feeds'); - $controllers->get('/feed/{id}/', function(Application $app, Request $request, $id) { + $controllers->get('/feed/{id}/', function (Application $app, Request $request, $id) { $page = (int) $request->query->get('page'); $page = $page > 0 ? $page : 1; @@ -234,7 +234,7 @@ class Feed implements ControllerProviderInterface ->bind('prod_feeds_feed') ->assert('id', '\d+'); - $controllers->get('/subscribe/aggregated/', function(Application $app, Request $request) { + $controllers->get('/subscribe/aggregated/', function (Application $app, Request $request) { $renew = ($request->query->get('renew') === 'true'); $feeds = \Feed_Collection::load_all($app, $app['authentication']->getUser()); @@ -249,7 +249,7 @@ class Feed implements ControllerProviderInterface return $app->json($output); })->bind('prod_feeds_subscribe_aggregated'); - $controllers->get('/subscribe/{id}/', function(Application $app, Request $request, $id) { + $controllers->get('/subscribe/{id}/', function (Application $app, Request $request, $id) { $renew = ($request->query->get('renew') === 'true'); $feed = \Feed_Adapter::load_with_user($app, $app['authentication']->getUser(), $id); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Language.php b/lib/Alchemy/Phrasea/Controller/Prod/Language.php index fa00091a5b..6b5c886569 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Language.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Language.php @@ -26,7 +26,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 516e85de2d..045bcd8814 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php @@ -42,7 +42,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'); }); @@ -275,7 +275,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 3fcbf03fd7..4df531f7c6 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php @@ -28,7 +28,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'); @@ -44,7 +44,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/Order.php b/lib/Alchemy/Phrasea/Controller/Prod/Order.php index 819d29de80..59e3de5dd5 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Order.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Order.php @@ -35,7 +35,7 @@ class Order implements ControllerProviderInterface { $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication() ->requireRight('order'); }); @@ -54,7 +54,7 @@ class Order implements ControllerProviderInterface * return : HTML Response */ $controllers->get('/', $this->call('displayOrders')) - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireOrdersAdmin(); }) ->bind('prod_orders'); @@ -89,7 +89,7 @@ class Order implements ControllerProviderInterface * return : HTML Response */ $controllers->get('/{order_id}/', $this->call('displayOneOrder')) - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireOrdersAdmin(); }) ->bind('prod_order') @@ -109,7 +109,7 @@ class Order implements ControllerProviderInterface * return : HTML Response | JSON Response */ $controllers->post('/{order_id}/send/', $this->call('sendOrder')) - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireOrdersAdmin(); }) ->bind('prod_order_send') @@ -129,7 +129,7 @@ class Order implements ControllerProviderInterface * return : HTML Response | JSON Response */ $controllers->post('/{order_id}/deny/', $this->call('denyOrder')) - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireOrdersAdmin(); }) ->bind('prod_order_deny') @@ -180,7 +180,7 @@ class Order implements ControllerProviderInterface } } - $noAdmins = $collectionHasOrderAdmins->forAll(function($key, $hasAdmin) { + $noAdmins = $collectionHasOrderAdmins->forAll(function ($key, $hasAdmin) { return false === $hasAdmin; }); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Printer.php b/lib/Alchemy/Phrasea/Controller/Prod/Printer.php index 96930d2a43..e141e3e1d5 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Printer.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Printer.php @@ -29,14 +29,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 57605c84a2..ed1c70f927 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Property.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Property.php @@ -28,7 +28,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/Push.php b/lib/Alchemy/Phrasea/Controller/Prod/Push.php index 1bd2d499be..3c471cca0e 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Push.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Push.php @@ -29,7 +29,7 @@ class Push implements ControllerProviderInterface protected function getUserFormatter() { - return function(\User_Adapter $user) { + return function (\User_Adapter $user) { $subtitle = array_filter(array($user->get_job(), $user->get_company())); return array( @@ -48,7 +48,7 @@ class Push implements ControllerProviderInterface { $userFormatter = $this->getUserFormatter(); - return function(\Entities\UsrList $List) use ($userFormatter, $app) { + return function (\Entities\UsrList $List) use ($userFormatter, $app) { $entries = array(); foreach ($List->getEntries() as $entry) { @@ -71,7 +71,7 @@ class Push implements ControllerProviderInterface protected function getUsersInSelectionExtractor() { - return function(array $selection) { + return function (array $selection) { $Users = new \Doctrine\Common\Collections\ArrayCollection(); foreach ($selection as $record) { @@ -99,7 +99,7 @@ class Push implements ControllerProviderInterface { $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication() ->requireRight('push'); }); @@ -110,7 +110,7 @@ class Push implements ControllerProviderInterface $userSelection = $this->getUsersInSelectionExtractor(); - $controllers->post('/sendform/', function(Application $app) use ($userSelection) { + $controllers->post('/sendform/', function (Application $app) use ($userSelection) { $push = new RecordHelper\Push($app, $app['request']); $repository = $app['EM']->getRepository('\Entities\UsrList'); @@ -128,7 +128,7 @@ class Push implements ControllerProviderInterface return $app['twig']->render('prod/actions/Push.html.twig', $params); }); - $controllers->post('/validateform/', function(Application $app) use ($userSelection) { + $controllers->post('/validateform/', function (Application $app) use ($userSelection) { $push = new RecordHelper\Push($app, $app['request']); $repository = $app['EM']->getRepository('\Entities\UsrList'); @@ -146,7 +146,7 @@ class Push implements ControllerProviderInterface return $app['twig']->render('prod/actions/Push.html.twig', $params); }); - $controllers->post('/send/', function(Application $app) { + $controllers->post('/send/', function (Application $app) { $request = $app['request']; $ret = array( @@ -261,7 +261,7 @@ class Push implements ControllerProviderInterface return $app->json($ret); })->bind('prod_push_send'); - $controllers->post('/validate/', function(Application $app) { + $controllers->post('/validate/', function (Application $app) { $request = $app['request']; $ret = array( @@ -463,7 +463,7 @@ class Push implements ControllerProviderInterface return $app->json($ret); })->bind('prod_push_validate'); - $controllers->get('/user/{usr_id}/', function(Application $app, $usr_id) use ($userFormatter) { + $controllers->get('/user/{usr_id}/', function (Application $app, $usr_id) use ($userFormatter) { $datas = null; $request = $app['request']; @@ -487,7 +487,7 @@ class Push implements ControllerProviderInterface return $app->json($datas); })->assert('usr_id', '\d+'); - $controllers->get('/list/{list_id}/', function(Application $app, $list_id) use ($listFormatter) { + $controllers->get('/list/{list_id}/', function (Application $app, $list_id) use ($listFormatter) { $datas = null; $repository = $app['EM']->getRepository('\Entities\UsrList'); @@ -503,7 +503,7 @@ class Push implements ControllerProviderInterface ->bind('prod_push_lists_list') ->assert('list_id', '\d+'); - $controllers->post('/add-user/', function(Application $app, Request $request) use ($userFormatter) { + $controllers->post('/add-user/', function (Application $app, Request $request) use ($userFormatter) { $result = array('success' => false, 'message' => '', 'user' => null); try { @@ -568,13 +568,13 @@ class Push implements ControllerProviderInterface return $app->json($result); })->bind('prod_push_do_add_user'); - $controllers->get('/add-user/', function(Application $app, Request $request) { + $controllers->get('/add-user/', function (Application $app, Request $request) { $params = array('callback' => $request->query->get('callback')); return $app['twig']->render('prod/User/Add.html.twig', $params); })->bind('prod_push_add_user'); - $controllers->get('/search-user/', function(Application $app) use ($userFormatter, $listFormatter) { + $controllers->get('/search-user/', function (Application $app) use ($userFormatter, $listFormatter) { $request = $app['request']; $query = new \User_Query($app); @@ -611,7 +611,7 @@ class Push implements ControllerProviderInterface return $app->json($datas); }); - $controllers->match('/edit-list/{list_id}/', function(Application $app, Request $request, $list_id) { + $controllers->match('/edit-list/{list_id}/', function (Application $app, Request $request, $list_id) { $repository = $app['EM']->getRepository('\Entities\UsrList'); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Query.php b/lib/Alchemy/Phrasea/Controller/Prod/Query.php index 81c29a3e1f..e335004270 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Query.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Query.php @@ -30,7 +30,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(); }); @@ -119,9 +119,9 @@ class Query implements ControllerProviderInterface $result = $app['phraseanet.SE']->query($query, (($page - 1) * $perPage), $perPage); 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 480e791fb4..5cfea1d190 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Records.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Records.php @@ -28,7 +28,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 dc18b45bd6..81b87006fc 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Root.php @@ -31,7 +31,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'); } @@ -39,7 +39,7 @@ class Root implements ControllerProviderInterface $app['firewall']->requireAuthentication(); }); - $controllers->get('/', function(Application $app) { + $controllers->get('/', function (Application $app) { try { \User_Adapter::updateClientInfos($app, 1); } catch (SessionNotFound $e) { @@ -56,7 +56,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/Share.php b/lib/Alchemy/Phrasea/Controller/Prod/Share.php index 785b0524f9..08e36d05ff 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Share.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Share.php @@ -26,7 +26,7 @@ class Share implements ControllerProviderInterface { $controllers = $app['controllers_factory']; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { $app['firewall']->requireNotGuest(); }); @@ -44,7 +44,7 @@ class Share implements ControllerProviderInterface * return : HTML Response */ $controllers->get('/record/{base_id}/{record_id}/', $this->call('shareRecord')) - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireRightOnSbas(\phrasea::sbasFromBas($app, $request->attributes->get('base_id')), 'bas_chupub'); }) ->bind('share_record'); diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Story.php b/lib/Alchemy/Phrasea/Controller/Prod/Story.php index 7661a2d360..97e35c3974 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Story.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Story.php @@ -31,15 +31,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')); @@ -107,7 +107,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)); @@ -118,7 +118,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')) @@ -149,7 +149,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); @@ -179,7 +179,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()) { @@ -197,7 +197,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 4bcf807169..86092476a5 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/TOU.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/TOU.php @@ -44,7 +44,7 @@ class TOU implements ControllerProviderInterface */ $controllers->post('/deny/{sbas_id}/', $this->call('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 d65a0d5499..a9ea788600 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php @@ -30,12 +30,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); @@ -66,7 +66,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); @@ -89,7 +89,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')); @@ -112,7 +112,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'); @@ -173,7 +173,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'); @@ -227,7 +227,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'; @@ -246,7 +246,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 2109de6607..a62e59d7ad 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php @@ -28,7 +28,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 b393431bf8..ed9df5c8d4 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/Upload.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/Upload.php @@ -45,7 +45,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'); }); @@ -220,7 +220,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 7462ad9ef2..0dcbfef63d 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php @@ -33,7 +33,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 89b5ce7c6f..60154c05da 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php @@ -32,7 +32,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 0d74e3aa1f..847b261181 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 20e41c6f56..ba56f79e85 100644 --- a/lib/Alchemy/Phrasea/Controller/Report/Activity.php +++ b/lib/Alchemy/Phrasea/Controller/Report/Activity.php @@ -23,7 +23,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 1e77437600..691079ece7 100644 --- a/lib/Alchemy/Phrasea/Controller/Report/Export.php +++ b/lib/Alchemy/Phrasea/Controller/Report/Export.php @@ -23,7 +23,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 5f633d0d4d..d4f695a176 100644 --- a/lib/Alchemy/Phrasea/Controller/Report/Informations.php +++ b/lib/Alchemy/Phrasea/Controller/Report/Informations.php @@ -22,7 +22,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 8ebdd99b98..43d7be3293 100644 --- a/lib/Alchemy/Phrasea/Controller/Report/Root.php +++ b/lib/Alchemy/Phrasea/Controller/Report/Root.php @@ -23,12 +23,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 dd2eba9d1c..467701d37f 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 d86c04c0b5..b88e525d19 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/Developers.php +++ b/lib/Alchemy/Phrasea/Controller/Root/Developers.php @@ -30,7 +30,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/Root/Login.php b/lib/Alchemy/Phrasea/Controller/Root/Login.php index 99c873fe9d..8861d3237c 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/Login.php +++ b/lib/Alchemy/Phrasea/Controller/Root/Login.php @@ -51,7 +51,7 @@ class Login implements ControllerProviderInterface { $items = array(); - foreach(\Feed_Entry_Item::loadLatest($app, 20) as $item) { + foreach (\Feed_Entry_Item::loadLatest($app, 20) as $item) { $record = $item->get_record(); $preview = $record->get_subdef('preview'); $permalink = $preview->get_permalink(); @@ -92,7 +92,7 @@ class Login implements ControllerProviderInterface $app['login.controller'] = $this; - $controllers->before(function(Request $request) use ($app) { + $controllers->before(function (Request $request) use ($app) { if ($request->getPathInfo() == $app->path('homepage')) { return; } @@ -100,7 +100,7 @@ class Login implements ControllerProviderInterface // Displays the homepage $controllers->get('/', 'login.controller:login') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireNotAuthenticated(); if (null !== $request->query->get('postlog')) { @@ -125,14 +125,14 @@ class Login implements ControllerProviderInterface // Authentication end point $controllers->post('/authenticate/', 'login.controller:authenticate') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireNotAuthenticated(); }) ->bind('login_authenticate'); // Guest access end point $controllers->match('/authenticate/guest/', 'login.controller:authenticateAsGuest') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireNotAuthenticated(); }) ->bind('login_authenticate_as_guest') @@ -140,67 +140,67 @@ class Login implements ControllerProviderInterface // Authenticate with an AuthProvider $controllers->get('/provider/{providerId}/authenticate/', 'login.controller:authenticateWithProvider') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireNotAuthenticated(); }) ->bind('login_authentication_provider_authenticate'); // AuthProviders callbacks $controllers->get('/provider/{providerId}/callback/', 'login.controller:authenticationCallback') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireNotAuthenticated(); })->bind('login_authentication_provider_callback'); // Logout end point $controllers->get('/logout/', 'login.controller:logout') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireAuthentication(); })->bind('logout'); // Registration end point ; redirects to classic registration or AuthProvider registration $controllers->get('/register/', 'login.controller:displayRegisterForm') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireNotAuthenticated(); })->bind('login_register'); // Classic registration end point $controllers->match('/register-classic/', 'login.controller:doRegistration') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireNotAuthenticated(); }) ->bind('login_register_classic'); // Provide a JSON serialization of registration fields configuration - $controllers->get('/registration-fields/', function(PhraseaApplication $app, Request $request) { + $controllers->get('/registration-fields/', function (PhraseaApplication $app, Request $request) { return $app->json($app['registration.fields']); })->bind('login_registration_fields'); // Unlocks an email address that is currently locked $controllers->get('/register-confirm/', 'login.controller:registerConfirm') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireNotAuthenticated(); })->bind('login_register_confirm'); // Displays a form to send an account unlock email again $controllers->get('/send-mail-confirm/', 'login.controller:sendConfirmMail') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireNotAuthenticated(); })->bind('login_send_mail'); // Forgot password end point $controllers->match('/forgot-password/', 'login.controller:forgotPassword') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireNotAuthenticated(); })->bind('login_forgot_password'); // Renew password end point $controllers->match('/renew-password/', 'login.controller:renewPassword') - ->before(function(Request $request) use ($app) { + ->before(function (Request $request) use ($app) { $app['firewall']->requireNotAuthenticated(); })->bind('login_renew_password'); // Displays Terms of use - $controllers->get('/cgus', function(PhraseaApplication $app, Request $request) { + $controllers->get('/cgus', function (PhraseaApplication $app, Request $request) { return $app['twig']->render('login/cgus.html.twig', array_merge( array('cgus' => \databox_cgu::getHome($app)), self::getDefaultTemplateVariables($app) diff --git a/lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php b/lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php index 7855fbf691..e911dd67db 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php +++ b/lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php @@ -27,7 +27,7 @@ class RSSFeeds implements ControllerProviderInterface { $controllers = $app['controllers_factory']; - $display_feed = function(Application $app, $feed, $format, $page, $user = null) { + $display_feed = function (Application $app, $feed, $format, $page, $user = null) { $total = $feed->get_count_total_entries(); $perPage = 5; $entries = $feed->get_entries((($page - 1) * $perPage), $perPage); @@ -76,7 +76,7 @@ class RSSFeeds implements ControllerProviderInterface return $response; }; - $controllers->get('/feed/{id}/{format}/', function(Application $app, $id, $format) use ($display_feed) { + $controllers->get('/feed/{id}/{format}/', function (Application $app, $id, $format) use ($display_feed) { $feed = new \Feed_Adapter($app, $id); if (!$feed->is_public()) { @@ -94,7 +94,7 @@ class RSSFeeds implements ControllerProviderInterface ->assert('id', '\d+') ->assert('format', '(rss|atom)'); - $controllers->get('/userfeed/{token}/{id}/{format}/', function(Application $app, $token, $id, $format) use ($display_feed) { + $controllers->get('/userfeed/{token}/{id}/{format}/', function (Application $app, $token, $id, $format) use ($display_feed) { $token = new \Feed_Token($app, $token, $id); $feed = $token->get_feed(); @@ -109,7 +109,7 @@ class RSSFeeds implements ControllerProviderInterface ->assert('id', '\d+') ->assert('format', '(rss|atom)'); - $controllers->get('/userfeed/aggregated/{token}/{format}/', function(Application $app, $token, $format) use ($display_feed) { + $controllers->get('/userfeed/aggregated/{token}/{format}/', function (Application $app, $token, $format) use ($display_feed) { $token = new \Feed_TokenAggregate($app, $token); $feed = $token->get_feed(); @@ -123,7 +123,7 @@ class RSSFeeds implements ControllerProviderInterface ->bind('feed_user_aggregated') ->assert('format', '(rss|atom)'); - $controllers->get('/aggregated/{format}/', function(Application $app, $format) use ($display_feed) { + $controllers->get('/aggregated/{format}/', function (Application $app, $format) use ($display_feed) { $feeds = \Feed_Collection::load_public_feeds($app); $feed = $feeds->get_aggregate(); @@ -136,7 +136,7 @@ class RSSFeeds implements ControllerProviderInterface ->bind('feed_public_aggregated') ->assert('format', '(rss|atom)'); - $controllers->get('/cooliris/', function(Application $app) use ($display_feed) { + $controllers->get('/cooliris/', function (Application $app) use ($display_feed) { $feeds = \Feed_Collection::load_public_feeds($app); $feed = $feeds->get_aggregate(); diff --git a/lib/Alchemy/Phrasea/Controller/Root/Session.php b/lib/Alchemy/Phrasea/Controller/Root/Session.php index a9d9ae7641..6aca739848 100644 --- a/lib/Alchemy/Phrasea/Controller/Root/Session.php +++ b/lib/Alchemy/Phrasea/Controller/Root/Session.php @@ -39,7 +39,7 @@ class Session implements ControllerProviderInterface ->bind('update_session'); $controllers->post('/delete/{id}', $this->call('deleteSession')) - ->before(function() use ($app) { + ->before(function () use ($app) { $app['firewall']->requireAuthentication(); }) ->bind('delete_session'); diff --git a/lib/Alchemy/Phrasea/Controller/Setup.php b/lib/Alchemy/Phrasea/Controller/Setup.php index ff17e751f1..562321d01e 100644 --- a/lib/Alchemy/Phrasea/Controller/Setup.php +++ b/lib/Alchemy/Phrasea/Controller/Setup.php @@ -30,7 +30,7 @@ class Setup implements ControllerProviderInterface $app['controller.setup'] = $this; - $controllers->get('/', function(Application $app) { + $controllers->get('/', function (Application $app) { return $app->redirectPath('install_root'); })->bind('setup'); diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php index d37df48483..76ca3d740f 100644 --- a/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php +++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php @@ -22,7 +22,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 f2ca34c3dc..6dce7e321c 100644 --- a/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php +++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php @@ -24,7 +24,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 7be6a2d4a1..6a80ddb8fd 100644 --- a/lib/Alchemy/Phrasea/Controller/User/Notifications.php +++ b/lib/Alchemy/Phrasea/Controller/User/Notifications.php @@ -26,7 +26,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 193f34ef19..8b01d21d06 100644 --- a/lib/Alchemy/Phrasea/Controller/User/Preferences.php +++ b/lib/Alchemy/Phrasea/Controller/User/Preferences.php @@ -26,7 +26,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 c7c59efdf7..62ca00739d 100644 --- a/lib/Alchemy/Phrasea/Controller/Utils/ConnectionTest.php +++ b/lib/Alchemy/Phrasea/Controller/Utils/ConnectionTest.php @@ -29,7 +29,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 c1802d8619..c530051633 100644 --- a/lib/Alchemy/Phrasea/Controller/Utils/PathFileTest.php +++ b/lib/Alchemy/Phrasea/Controller/Utils/PathFileTest.php @@ -30,7 +30,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')) @@ -41,7 +41,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/CLIProvider/LessBuilderServiceProvider.php b/lib/Alchemy/Phrasea/Core/CLIProvider/LessBuilderServiceProvider.php index 8b3f866428..8cff090c30 100644 --- a/lib/Alchemy/Phrasea/Core/CLIProvider/LessBuilderServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/CLIProvider/LessBuilderServiceProvider.php @@ -20,39 +20,39 @@ class LessBuilderServiceProvider implements ServiceProviderInterface { public function register(Application $app) { - $app['phraseanet.less-assets'] = $app->share(function($app) { + $app['phraseanet.less-assets'] = $app->share(function ($app) { return array( $app['root.path'] . '/www/assets/bootstrap/img/glyphicons-halflings-white.png' => $app['root.path'] . '/www/skins/build/bootstrap/img/glyphicons-halflings-white.png', $app['root.path'] . '/www/assets/bootstrap/img/glyphicons-halflings.png' => $app['root.path'] . '/www/skins/build/bootstrap/img/glyphicons-halflings.png', ); }); - $app['phraseanet.less-mapping.base'] = $app->share(function($app) { + $app['phraseanet.less-mapping.base'] = $app->share(function ($app) { return array( $app['root.path'] . '/www/assets/bootstrap/less/bootstrap.less' => $app['root.path'] . '/www/skins/build/bootstrap/css/bootstrap.css', $app['root.path'] . '/www/assets/bootstrap/less/responsive.less' => $app['root.path'] . '/www/skins/build/bootstrap/css/bootstrap-responsive.css', ); }); - $app['phraseanet.less-mapping.customizable'] = $app->share(function($app) { + $app['phraseanet.less-mapping.customizable'] = $app->share(function ($app) { return array( $app['root.path'] . '/www/skins/login/less/login.less' => $app['root.path'] . '/www/skins/build/login.css', $app['root.path'] . '/www/skins/account/account.less' => $app['root.path'] . '/www/skins/build/account.css', ); }); - $app['phraseanet.less-mapping'] = $app->share(function($app) { + $app['phraseanet.less-mapping'] = $app->share(function ($app) { return array_merge( $app['phraseanet.less-mapping.base'], $app['phraseanet.less-mapping.customizable'] ); }); - $app['phraseanet.less-compiler'] = $app->share(function($app) { + $app['phraseanet.less-compiler'] = $app->share(function ($app) { return new LessCompiler($app['filesystem'], $app['driver.recess']); }); - $app['phraseanet.less-builder'] = $app->share(function($app) { + $app['phraseanet.less-builder'] = $app->share(function ($app) { return new LessBuilder($app['phraseanet.less-compiler'], $app['filesystem']); }); } 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 7fb7ca1b11..7fa706eecd 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php @@ -32,7 +32,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'], @@ -49,7 +49,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 52e35790ee..ddeb34d411 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/ConfigurationTesterServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/ConfigurationTesterServiceProvider.php @@ -21,7 +21,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/ORMServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/ORMServiceProvider.php index 0bd21b9407..29ea3034f0 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/ORMServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/ORMServiceProvider.php @@ -40,7 +40,7 @@ class ORMServiceProvider implements ServiceProviderInterface return new MonologSQLLogger($logger, 'yaml'); }); - $app['EM'] = $app->share(function(Application $app) { + $app['EM'] = $app->share(function (Application $app) { $config = new ORMConfiguration(); 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/TaskManagerServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/TaskManagerServiceProvider.php index 8daecafe36..b3bbba82e0 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/TaskManagerServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/TaskManagerServiceProvider.php @@ -20,14 +20,14 @@ class TaskManagerServiceProvider implements ServiceProviderInterface { public function register(Application $app) { - $app['task-manager.logger'] = $app->share(function(Application $app) { + $app['task-manager.logger'] = $app->share(function (Application $app) { $logger = new Logger('task-manager logger'); $logger->pushHandler(new NullHandler()); return $logger; }); - $app['task-manager'] = $app->share(function(Application $app) { + $app['task-manager'] = $app->share(function (Application $app) { return new \task_manager($app, $app['task-manager.logger']); }); } 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 aa75b48e1e..8dd86cee80 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngine.php +++ b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngine.php @@ -697,16 +697,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') . ' ) '; } } } @@ -717,7 +717,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 31e52ad24b..d38d0526ab 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngine.php +++ b/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngine.php @@ -625,7 +625,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 188d20b9d6..7ebd48adac 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 0edf418ea9..2d30ef5d81 100644 --- a/lib/classes/API/V1/adapter.php +++ b/lib/classes/API/V1/adapter.php @@ -686,7 +686,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(); @@ -899,9 +899,9 @@ class API_V1_adapter extends API_V1_Abstract $search_result = $this->app['phraseanet.SE']->query($query, $offsetStart, $perPage); 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(); })); @@ -1905,7 +1905,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 de5c7c921d..02fe3c649a 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 8a58f80f8c..bcc0c56ce7 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 576ef05448..740adfe165 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" : @@ -912,7 +912,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']; @@ -939,7 +939,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/Feed/Entry/Item.php b/lib/classes/Feed/Entry/Item.php index 0834ceb16f..e39bfe40df 100644 --- a/lib/classes/Feed/Entry/Item.php +++ b/lib/classes/Feed/Entry/Item.php @@ -264,7 +264,7 @@ class Feed_Entry_Item implements Feed_Entry_ItemInterface, cache_cacheableInterf $rows = $stmt->fetchAll(\PDO::FETCH_ASSOC); $stmt->closeCursor(); - foreach($rows as $row) { + foreach ($rows as $row) { if (!isset($feeds[$row['feed']])) { $feeds[$row['feed']] = new Feed_Adapter($app, $row['feed']); } 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/lib/classes/record/adapter.php b/lib/classes/record/adapter.php index 0d31d7e6f6..cb8bd8825a 100644 --- a/lib/classes/record/adapter.php +++ b/lib/classes/record/adapter.php @@ -1578,7 +1578,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface $stmt->execute(array(':record_id' => $this->get_record_id())); $stmt->closeCursor(); - $base_ids = array_map(function($collection) { + $base_ids = array_map(function ($collection) { return $collection->get_base_id(); }, $this->databox->get_collections()); diff --git a/lib/classes/task/Scheduler.php b/lib/classes/task/Scheduler.php index 7e15db3d77..a0a2268f1e 100644 --- a/lib/classes/task/Scheduler.php +++ b/lib/classes/task/Scheduler.php @@ -593,14 +593,14 @@ class task_Scheduler break; } } - if(function_exists('pcntl_sigprocmask')) { + if (function_exists('pcntl_sigprocmask')) { @pcntl_sigprocmask(SIG_BLOCK, array(SIGCHLD)); } sleep(1); for ($i = 0; $this->schedstatus=='started' && $i < $sleeptime; $i++) { sleep(1); } - if(function_exists('pcntl_sigprocmask')) { + if (function_exists('pcntl_sigprocmask')) { @pcntl_sigprocmask(SIG_UNBLOCK, array(SIGCHLD)); } } diff --git a/lib/classes/task/manager.php b/lib/classes/task/manager.php index 1cdf3d9c3c..27d4999dcf 100644 --- a/lib/classes/task/manager.php +++ b/lib/classes/task/manager.php @@ -96,7 +96,7 @@ class task_manager $classname = $row['class']; if (!class_exists($classname)) { - if(substr($classname, 0, 12) == "task_period_") { + if (substr($classname, 0, 12) == "task_period_") { $classfile = __DIR__ . "/../../../config/classes/task/period/" . substr($classname, 12) . ".php"; if (file_exists($classfile)) { require_once $classfile; diff --git a/lib/classes/task/period/RecordMover.php b/lib/classes/task/period/RecordMover.php index 26670d2139..3bd3bf92e6 100644 --- a/lib/classes/task/period/RecordMover.php +++ b/lib/classes/task/period/RecordMover.php @@ -168,7 +168,7 @@ class task_period_RecordMover extends task_appboxAbstract , dataType:'json' , type:"POST" , async:true - , success:function(data) { + , success:function (data) { t = ""; for (i in data.tasks) { t += "
 "; @@ -210,7 +210,7 @@ class task_period_RecordMover extends task_appboxAbstract , dataType:'json' , type:"POST" , async:true - , success:function(data) { + , success:function (data) { for (i in data.tasks) { if (data.tasks[i].sql) { if (data.tasks[i].sql.test.err) { @@ -235,11 +235,11 @@ class task_period_RecordMover extends task_appboxAbstract } $(document).ready( - function(){ - (function( $ ){ - $.fn.serializeJSON=function() { + function () { + (function ($) { + $.fn.serializeJSON=function () { var json = {}; - jQuery.map($(this).serializeArray(), function(n, i){ + jQuery.map($(this).serializeArray(), function (n, i) { json[n['name']] = n['value']; }); @@ -251,7 +251,7 @@ class task_period_RecordMover extends task_appboxAbstract 'period':{'min':, 'max':}, 'delay':{min:0} } ; - $(".formElem").change(function(){ + $(".formElem").change(function () { fieldname = $(this).attr("name"); switch ((this.nodeName+$(this).attr("type")).toLowerCase()) { case "inputtext": diff --git a/lib/classes/task/period/archive.php b/lib/classes/task/period/archive.php index 65c3f0e05e..ca6cf14c05 100644 --- a/lib/classes/task/period/archive.php +++ b/lib/classes/task/period/archive.php @@ -170,12 +170,12 @@ class task_period_archive extends task_abstract - $(document).ready(function(){ + $(document).ready(function () { var limits = { 'period':{'min':, 'max':}, 'cold':{'min':, 'max':} } ; - $(".formElem").change(function(){ + $(".formElem").change(function () { fieldname = $(this).attr("name"); switch ((this.nodeName+$(this).attr("type")).toLowerCase()) { case "inputtext": @@ -1746,7 +1746,7 @@ class task_period_archive extends task_abstract $record = null; - $postProcess = function($element, $visa, $code) use (&$record) { + $postProcess = function ($element, $visa, $code) use (&$record) { $record = $element; }; diff --git a/lib/classes/task/period/cindexer.php b/lib/classes/task/period/cindexer.php index 399000bd2c..658a84ef26 100644 --- a/lib/classes/task/period/cindexer.php +++ b/lib/classes/task/period/cindexer.php @@ -174,7 +174,7 @@ class task_period_cindexer extends task_abstract xml = $.parseXML(xml); xml = $(xml); - var isyes = function(v) { + var isyes = function (v) { v = v.toUpperCase().trim(); return v=='O' || v=='Y' || v=='OUI' || v=='YES' || v=='1'; @@ -235,8 +235,8 @@ class task_period_cindexer extends task_abstract $('#cmd').html(cmd); } - $(document).ready(function(){ - $("#graphicForm *").change(function(){ + $(document).ready(function () { + $("#graphicForm *").change(function () { taskFillGraphic_(null); }); }); diff --git a/lib/classes/task/period/ftp.php b/lib/classes/task/period/ftp.php index 42a8716b41..67ff22e84f 100644 --- a/lib/classes/task/period/ftp.php +++ b/lib/classes/task/period/ftp.php @@ -105,11 +105,11 @@ class task_period_ftp extends task_appboxAbstract } } - $(document).ready(function(){ + $(document).ready(function () { var limits = { 'period' :{'min':, 'max':} } ; - $(".formElem").change(function(){ + $(".formElem").change(function () { fieldname = $(this).attr("name"); switch ((this.nodeName+$(this).attr("type")).toLowerCase()) { case "inputtext": diff --git a/lib/classes/task/period/ftpPull.php b/lib/classes/task/period/ftpPull.php index 5ebb5a4cf1..63f623c3f8 100644 --- a/lib/classes/task/period/ftpPull.php +++ b/lib/classes/task/period/ftpPull.php @@ -127,11 +127,11 @@ class task_period_ftpPull extends task_appboxAbstract } } - $(document).ready(function(){ + $(document).ready(function () { var limits = { 'period' :{'min':, 'max':} } ; - $(".formElem").change(function(){ + $(".formElem").change(function () { fieldname = $(this).attr("name"); switch ((this.nodeName+$(this).attr("type")).toLowerCase()) { case "inputtext": diff --git a/lib/classes/task/period/subdef.php b/lib/classes/task/period/subdef.php index e6b7da45d0..b67f553e5c 100644 --- a/lib/classes/task/period/subdef.php +++ b/lib/classes/task/period/subdef.php @@ -181,14 +181,14 @@ class task_period_subdef extends task_databoxAbstract } } - $(document).ready(function(){ + $(document).ready(function () { var limits = { 'period' :{'min':, 'max':}, 'flush' :{'min':, 'max':}, 'maxrecs':{'min':, 'max':}, 'maxmegs':{'min':, 'max':} } ; - $(".formElem").change(function(){ + $(".formElem").change(function () { fieldname = $(this).attr("name"); switch ((this.nodeName+$(this).attr("type")).toLowerCase()) { case "inputtext": diff --git a/lib/classes/task/period/writemeta.php b/lib/classes/task/period/writemeta.php index 159e25fe3a..92bae89d2a 100644 --- a/lib/classes/task/period/writemeta.php +++ b/lib/classes/task/period/writemeta.php @@ -133,13 +133,13 @@ class task_period_writemeta extends task_databoxAbstract } } - $(document).ready(function(){ + $(document).ready(function () { var limits = { 'period':{'min':, 'max':}, 'maxrecs':{'min':, 'max':}, 'maxmegs':{'min':, 'max':} } ; - $(".formElem").change(function(){ + $(".formElem").change(function () { fieldname = $(this).attr("name"); switch ((this.nodeName+$(this).attr("type")).toLowerCase()) { case "inputtext": diff --git a/tests/Alchemy/Tests/Phrasea/Application/ApiAbstract.php b/tests/Alchemy/Tests/Phrasea/Application/ApiAbstract.php index 35911c09cd..7f1cea739c 100644 --- a/tests/Alchemy/Tests/Phrasea/Application/ApiAbstract.php +++ b/tests/Alchemy/Tests/Phrasea/Application/ApiAbstract.php @@ -66,14 +66,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/Border/ManagerTest.php b/tests/Alchemy/Tests/Phrasea/Border/ManagerTest.php index 28f9e7666b..f37ac57c5e 100644 --- a/tests/Alchemy/Tests/Phrasea/Border/ManagerTest.php +++ b/tests/Alchemy/Tests/Phrasea/Border/ManagerTest.php @@ -77,7 +77,7 @@ class ManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $records = array(); - $postProcessRecord = function($record) use (&$records) { + $postProcessRecord = function ($record) use (&$records) { $records[] = $record; }; @@ -87,7 +87,7 @@ class ManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $phpunit = $this; - $postProcess = function($element, $visa, $code) use ($phpunit, &$records) { + $postProcess = function ($element, $visa, $code) use ($phpunit, &$records) { $phpunit->assertInstanceOf('\\Entities\\LazaretFile', $element); $phpunit->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Visa', $visa); $phpunit->assertEquals(Manager::LAZARET_CREATED, $code); @@ -96,7 +96,7 @@ class ManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $this->assertEquals(Manager::LAZARET_CREATED, $this->object->process($this->session, File::buildFromPathfile(self::$file1, self::$DI['collection'], self::$DI['app']), $postProcess)); - $postProcess = function($element, $visa, $code) use ($phpunit, &$records) { + $postProcess = function ($element, $visa, $code) use ($phpunit, &$records) { $phpunit->assertInstanceOf('\\record_adapter', $element); $phpunit->assertInstanceOf('\\Alchemy\\Phrasea\\Border\\Visa', $visa); $phpunit->assertEquals(Manager::RECORD_CREATED, $code); @@ -119,7 +119,7 @@ class ManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { $records = array(); - $postProcessRecord = function($record) use (&$records) { + $postProcessRecord = function ($record) use (&$records) { $records[] = $record; }; $this->assertEquals(Manager::LAZARET_CREATED, $this->object->process($this->session, File::buildFromPathfile(self::$file1, self::$DI['collection'], self::$DI['app']), NULL, Manager::FORCE_LAZARET)); @@ -139,7 +139,7 @@ class ManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { $records = array(); - $postProcessRecord = function($record) use (&$records) { + $postProcessRecord = function ($record) use (&$records) { $records[] = $record; }; @@ -252,7 +252,7 @@ class ManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { $lazaret = null; - $postProcessRecord = function($element) use (&$lazaret) { + $postProcessRecord = function ($element) use (&$lazaret) { $lazaret = $element; }; @@ -384,7 +384,7 @@ class ManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract $phpunit = $this; $application = self::$DI['app']; - $postProcess = function($element, $visa, $code) use ($phpunit, $application) { + $postProcess = function ($element, $visa, $code) use ($phpunit, $application) { $phpunit->assertInstanceOf('\\Entities\\LazaretFile', $element); /* @var $element \Entities\LazaretFile */ @@ -553,7 +553,7 @@ class ManagerTest extends \PhraseanetWebTestCaseAuthenticatedAbstract { $records = array(); - $postProcessRecord = function($record) use (&$records) { + $postProcessRecord = function ($record) use (&$records) { $records[] = $record; }; 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 df3fd335e3..f6f7f6c8ce 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Prod/ExportTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Prod/ExportTest.php @@ -59,7 +59,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() @@ -81,7 +81,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/RSSFeedTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Root/RSSFeedTest.php index 255e59d30c..ddc12da773 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Root/RSSFeedTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Root/RSSFeedTest.php @@ -708,7 +708,7 @@ class RssFeedTest extends \PhraseanetWebTestCaseAbstract public function removeBadItems(Array &$item_entries, Array $available_medium) { - $remove = function($entry_item, $key) use (&$item_entries, $available_medium) { + $remove = function ($entry_item, $key) use (&$item_entries, $available_medium) { $preview_sd = $entry_item->get_record()->get_subdef('preview'); $url_preview = $preview_sd->get_permalink(); $thumbnail_sd = $entry_item->get_record()->get_thumbnail(); diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Root/RootTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Root/RootTest.php index 348ff7590c..083fcdabd6 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/Feed/Entry/Feed_Entry_ItemTest.php b/tests/classes/Feed/Entry/Feed_Entry_ItemTest.php index d10bcaf537..be6eb83330 100644 --- a/tests/classes/Feed/Entry/Feed_Entry_ItemTest.php +++ b/tests/classes/Feed/Entry/Feed_Entry_ItemTest.php @@ -1,7 +1,5 @@ set_public(true); - foreach(range(1, 2) as $i) { + foreach (range(1, 2) as $i) { Feed_Entry_Item::create(self::$DI['app']['phraseanet.appbox'], self::$entry, self::$DI['record_'.$i]); } @@ -88,7 +86,7 @@ class Feed_Entry_ItemTest extends PhraseanetPHPUnitAuthenticatedAbstract self::$feed->set_public(true); - foreach(range(1, 2) as $i) { + foreach (range(1, 2) as $i) { Feed_Entry_Item::create(self::$DI['app']['phraseanet.appbox'], self::$entry, self::$DI['record_'.$i]); } @@ -101,7 +99,7 @@ class Feed_Entry_ItemTest extends PhraseanetPHPUnitAuthenticatedAbstract self::$feed->set_public(false); - foreach(range(1, 2) as $i) { + foreach (range(1, 2) as $i) { Feed_Entry_Item::create(self::$DI['app']['phraseanet.appbox'], self::$entry, self::$DI['record_'.$i]); } diff --git a/tests/classes/PhraseanetPHPUnitAbstract.php b/tests/classes/PhraseanetPHPUnitAbstract.php index a9d1208203..81443f0d0f 100644 --- a/tests/classes/PhraseanetPHPUnitAbstract.php +++ b/tests/classes/PhraseanetPHPUnitAbstract.php @@ -112,7 +112,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase $phpunit = $this; - self::$DI['app'] = self::$DI->share(function($DI) use ($phpunit) { + self::$DI['app'] = self::$DI->share(function ($DI) use ($phpunit) { $environment = 'test'; $app = require __DIR__ . '/../../lib/Alchemy/Phrasea/Application/Root.php'; @@ -120,7 +120,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase return new CsrfTestProvider(); }); - $app['url_generator'] = $app->share($app->extend('url_generator', function($generator, $app) { + $app['url_generator'] = $app->share($app->extend('url_generator', function ($generator, $app) { $host = parse_url($app['phraseanet.configuration']['main']['servername'], PHP_URL_HOST); $generator->setContext(new RequestContext('', 'GET', $host)); @@ -129,14 +129,14 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase $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'); return $em; })); - $app['browser'] = $app->share($app->extend('browser', function($browser) { + $app['browser'] = $app->share($app->extend('browser', function ($browser) { $browser->setUserAgent(PhraseanetPHPUnitAbstract::USER_AGENT_FIREFOX8MAC); @@ -148,21 +148,21 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase ->getMock(); $app['notification.deliverer']->expects($phpunit->any()) ->method('deliver') - ->will($phpunit->returnCallback(function() use ($phpunit) { + ->will($phpunit->returnCallback(function () use ($phpunit) { $phpunit->fail('Notification deliverer must be mocked'); })); return $app; }); - self::$DI['cli'] = self::$DI->share(function($DI) use ($phpunit) { + self::$DI['cli'] = self::$DI->share(function ($DI) use ($phpunit) { $app = new CLI('cli test', null, 'test'); $app['form.csrf_provider'] = $app->share(function () { return new CsrfTestProvider(); }); - $app['url_generator'] = $app->share($app->extend('url_generator', function($generator, $app) { + $app['url_generator'] = $app->share($app->extend('url_generator', function ($generator, $app) { $host = parse_url($app['phraseanet.configuration']['main']['servername'], PHP_URL_HOST); $generator->setContext(new RequestContext('', 'GET', $host)); @@ -171,14 +171,14 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase $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'); return $em; })); - $app['browser'] = $app->share($app->extend('browser', function($browser) { + $app['browser'] = $app->share($app->extend('browser', function ($browser) { $browser->setUserAgent(PhraseanetPHPUnitAbstract::USER_AGENT_FIREFOX8MAC); @@ -190,14 +190,14 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase ->getMock(); $app['notification.deliverer']->expects($phpunit->any()) ->method('deliver') - ->will($phpunit->returnCallback(function() use ($phpunit) { + ->will($phpunit->returnCallback(function () use ($phpunit) { $phpunit->fail('Notification deliverer must be mocked'); })); return $app; }); - self::$DI['client'] = self::$DI->share(function($DI) { + self::$DI['client'] = self::$DI->share(function ($DI) { return new Client($DI['app'], array()); }); @@ -261,7 +261,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase $purger = new Doctrine\Common\DataFixtures\Purger\ORMPurger(); $executor = new Doctrine\Common\DataFixtures\Executor\ORMExecutor(self::$DI['app']['EM'], $purger); $executor->execute($fixtureLoader->getFixtures(), $append); - self::$DI['client'] = self::$DI->share(function($DI) { + self::$DI['client'] = self::$DI->share(function ($DI) { return new Client($DI['app'], array()); }); } @@ -287,7 +287,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase $app['browser']->setUserAgent($user_agent); $app->register(new \Silex\Provider\TwigServiceProvider()); $app->setupTwig(); - self::$DI['client'] = self::$DI->share(function($DI) use ($app) { + self::$DI['client'] = self::$DI->share(function ($DI) use ($app) { return new Client($app, array()); }); } @@ -756,7 +756,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase self::$DI['collection'] = $coll; - self::$DI['collection_no_access'] = self::$DI->share(function($DI) use ($application, $databox, $collection_no_acces) { + self::$DI['collection_no_access'] = self::$DI->share(function ($DI) use ($application, $databox, $collection_no_acces) { if (!$collection_no_acces instanceof collection) { $collection_no_acces = collection::create($application, $databox, $application['phraseanet.appbox'], 'BIBOO', $DI['user']); } @@ -775,7 +775,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase return $collection_no_acces; }); - self::$DI['collection_no_access_by_status'] = self::$DI->share(function($DI) use ($application, $databox, $collection_no_acces_by_status) { + self::$DI['collection_no_access_by_status'] = self::$DI->share(function ($DI) use ($application, $databox, $collection_no_acces_by_status) { if (!$collection_no_acces_by_status instanceof collection) { $collection_no_acces_by_status = collection::create($application, $databox, $application['phraseanet.appbox'], 'BIBOONOACCESBYSTATUS', $DI['user']); } @@ -808,7 +808,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase $logger->pushHandler(new \Monolog\Handler\NullHandler()); self::$recordsInitialized = array(); - $resolvePathfile = function($i) { + $resolvePathfile = function ($i) { $finder = new Symfony\Component\Finder\Finder(); $name = $i < 10 ? 'test00' . $i . '.*' : 'test0' . $i . '.*'; @@ -823,7 +823,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase }; foreach (range(1, 24) as $i) { - self::$DI['record_' . $i] = self::$DI->share(function($DI) use ($logger, $resolvePathfile, $i) { + self::$DI['record_' . $i] = self::$DI->share(function ($DI) use ($logger, $resolvePathfile, $i) { PhraseanetPHPUnitAbstract::$recordsInitialized[] = $i; @@ -838,7 +838,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase } foreach (range(1, 2) as $i) { - self::$DI['record_story_' . $i] = self::$DI->share(function($DI) use ($i) { + self::$DI['record_story_' . $i] = self::$DI->share(function ($DI) use ($i) { PhraseanetPHPUnitAbstract::$recordsInitialized[] = 'story_' . $i; @@ -846,7 +846,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase }); } - self::$DI['record_no_access'] = self::$DI->share(function($DI) { + self::$DI['record_no_access'] = self::$DI->share(function ($DI) { PhraseanetPHPUnitAbstract::$recordsInitialized[] = 'no_access'; @@ -855,7 +855,7 @@ abstract class PhraseanetPHPUnitAbstract extends WebTestCase return \record_adapter::createFromFile($file, $DI['app']); }); - self::$DI['record_no_access_by_status'] = self::$DI->share(function($DI) { + self::$DI['record_no_access_by_status'] = self::$DI->share(function ($DI) { PhraseanetPHPUnitAbstract::$recordsInitialized[] = 'no_access_by_status'; 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)); }