Use short array declaration

This commit is contained in:
Romain Neutron
2013-11-18 11:58:12 +01:00
parent 2898b317c4
commit 56b373ee6e
723 changed files with 8350 additions and 8352 deletions

View File

@@ -57,7 +57,7 @@ class module_console_fieldsMerge extends Command
return 1;
}
$sources = array();
$sources = [];
foreach ($input->getArgument('source') as $source_id) {
$sources[] = $databox->get_meta_structure()->get_element($source_id);
@@ -71,7 +71,7 @@ class module_console_fieldsMerge extends Command
$destination = $databox->get_meta_structure()->get_element($input->getArgument('destination'));
$types = $multis = array();
$types = $multis = [];
foreach ($sources as $source) {
array_push($types, $source->get_type());
@@ -97,7 +97,7 @@ class module_console_fieldsMerge extends Command
);
}
$field_names = array();
$field_names = [];
foreach ($sources as $source) {
$field_names[] = $source->get_name();
@@ -172,7 +172,7 @@ class module_console_fieldsMerge extends Command
foreach ($results as $row) {
$record = $databox->get_record($row['record_id']);
$datas = array();
$datas = [];
foreach ($sources as $source) {
try {
@@ -195,11 +195,11 @@ class module_console_fieldsMerge extends Command
}
foreach ((array) $datas as $data) {
$record->set_metadatas(array(array(
$record->set_metadatas([[
'meta_struct_id' => $destination->get_id(),
'meta_id' => null,
'value' => $data,
)), true);
]], true);
}
$this->getService('phraseanet.SE')->updateRecord($record);