Use short array notation

This commit is contained in:
Romain Neutron
2014-03-01 14:44:53 +01:00
parent b836dc8632
commit d8e4ea5a41
4 changed files with 10 additions and 10 deletions

View File

@@ -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');

View File

@@ -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);
}
}

View File

@@ -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"];

View File

@@ -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()