diff --git a/lib/Alchemy/Phrasea/Controller/Api/V1.php b/lib/Alchemy/Phrasea/Controller/Api/V1.php index 6b998834f2..cc020eb0ad 100644 --- a/lib/Alchemy/Phrasea/Controller/Api/V1.php +++ b/lib/Alchemy/Phrasea/Controller/Api/V1.php @@ -67,31 +67,31 @@ class V1 implements ControllerProviderInterface }); $controllers->get('/monitor/scheduler/', 'controller.api.v1:get_scheduler') - ->before(array($this, 'ensureAdmin')); + ->before([$this, 'ensureAdmin']); $controllers->get('/monitor/tasks/', 'controller.api.v1:get_task_list') - ->before(array($this, 'ensureAdmin')); + ->before([$this, 'ensureAdmin']); $controllers->get('/monitor/task/{task}/', 'controller.api.v1:get_task') ->convert('task', [$app['converter.task'], 'convert']) - ->before(array($this, 'ensureAdmin')) + ->before([$this, 'ensureAdmin']) ->assert('task', '\d+'); $controllers->post('/monitor/task/{task}/', 'controller.api.v1:set_task_property') ->convert('task', [$app['converter.task'], 'convert']) - ->before(array($this, 'ensureAdmin')) + ->before([$this, 'ensureAdmin']) ->assert('task', '\d+'); $controllers->post('/monitor/task/{task}/start/', 'controller.api.v1:start_task') ->convert('task', [$app['converter.task'], 'convert']) - ->before(array($this, 'ensureAdmin')); + ->before([$this, 'ensureAdmin']); $controllers->post('/monitor/task/{task}/stop/', 'controller.api.v1:stop_task') ->convert('task', [$app['converter.task'], 'convert']) - ->before(array($this, 'ensureAdmin')); + ->before([$this, 'ensureAdmin']); $controllers->get('/monitor/phraseanet/', 'controller.api.v1:get_phraseanet_monitor') - ->before(array($this, 'ensureAdmin')); + ->before([$this, 'ensureAdmin']); $controllers->get('/databoxes/list/', 'controller.api.v1:get_databoxes'); diff --git a/lib/Alchemy/Phrasea/TaskManager/Notifier.php b/lib/Alchemy/Phrasea/TaskManager/Notifier.php index 124f5c6f7d..e60f4eaf0c 100644 --- a/lib/Alchemy/Phrasea/TaskManager/Notifier.php +++ b/lib/Alchemy/Phrasea/TaskManager/Notifier.php @@ -86,7 +86,7 @@ class Notifier return $data['reply']; } catch (\ZMQSocketException $e) { - $this->logger->error(sprintf('Unable to notify the task manager with message "%s" within timeout of %d seconds', $message, $this->timeout), array('exception' => $e)); + $this->logger->error(sprintf('Unable to notify the task manager with message "%s" within timeout of %d seconds', $message, $this->timeout), ['exception' => $e]); throw new RuntimeException('Unable to retrieve information.', $e->getCode(), $e); } } diff --git a/lib/classes/Bridge/Api/Dailymotion.php b/lib/classes/Bridge/Api/Dailymotion.php index b79a03977e..92828123d6 100644 --- a/lib/classes/Bridge/Api/Dailymotion.php +++ b/lib/classes/Bridge/Api/Dailymotion.php @@ -571,7 +571,7 @@ class Bridge_Api_Dailymotion extends Bridge_Api_Abstract implements Bridge_Api_I switch ($record->get_type()) { case self::ELEMENT_TYPE_VIDEO : $url_file = $this->_api->sendFile($record->get_hd_file()->getRealPath(), $this->oauth_token); - $options = array_merge(array('url' => $url_file), $options); + $options = array_merge(['url' => $url_file], $options); $video = $this->_api->call('POST /me/videos', $options, $this->oauth_token); return $video["id"]; diff --git a/tests/Alchemy/Tests/Phrasea/Controller/Api/ResultTest.php b/tests/Alchemy/Tests/Phrasea/Controller/Api/ResultTest.php index 08f5903153..e586dff2a3 100644 --- a/tests/Alchemy/Tests/Phrasea/Controller/Api/ResultTest.php +++ b/tests/Alchemy/Tests/Phrasea/Controller/Api/ResultTest.php @@ -129,7 +129,7 @@ class ResultTest extends \PhraseanetAuthenticatedTestCase $apiResult = new Result(new Request(), []); $content = json_decode($apiResult->createResponse()->getContent(), true); - $this->assertSame(array(), $content['response']); + $this->assertSame([], $content['response']); } public function testContentType()