Use short form array syntax everywhere

- Add short form array syntax to po2php.php generation
This commit is contained in:
Hypolite Petovan 2018-01-15 08:05:12 -05:00
commit e36f2bb1fb
212 changed files with 5160 additions and 5160 deletions

View file

@ -20,7 +20,7 @@ function wall_attach_post(App $a) {
);
if (! DBM::is_result($r)) {
if ($r_json) {
echo json_encode(array('error'=>t('Invalid request.')));
echo json_encode(['error'=>t('Invalid request.')]);
killme();
}
return;
@ -28,7 +28,7 @@ function wall_attach_post(App $a) {
} else {
if ($r_json) {
echo json_encode(array('error'=>t('Invalid request.')));
echo json_encode(['error'=>t('Invalid request.')]);
killme();
}
return;
@ -70,7 +70,7 @@ function wall_attach_post(App $a) {
}
if(! $can_post) {
if ($r_json) {
echo json_encode(array('error'=>t('Permission denied.')));
echo json_encode(['error'=>t('Permission denied.')]);
killme();
}
notice( t('Permission denied.') . EOL );
@ -79,7 +79,7 @@ function wall_attach_post(App $a) {
if(! x($_FILES,'userfile')) {
if ($r_json) {
echo json_encode(array('error'=>t('Invalid request.')));
echo json_encode(['error'=>t('Invalid request.')]);
}
killme();
}
@ -99,7 +99,7 @@ function wall_attach_post(App $a) {
if($filesize <=0) {
$msg = t('Sorry, maybe your upload is bigger than the PHP configuration allows') . EOL .(t('Or - did you try to upload an empty file?'));
if ($r_json) {
echo json_encode(array('error'=>$msg));
echo json_encode(['error'=>$msg]);
} else {
notice( $msg. EOL );
}
@ -110,7 +110,7 @@ function wall_attach_post(App $a) {
if(($maxfilesize) && ($filesize > $maxfilesize)) {
$msg = sprintf(t('File exceeds size limit of %s'), formatBytes($maxfilesize));
if ($r_json) {
echo json_encode(array('error'=>$msg));
echo json_encode(['error'=>$msg]);
} else {
echo $msg. EOL ;
}
@ -123,9 +123,9 @@ function wall_attach_post(App $a) {
$hash = get_guid(64);
$created = datetime_convert();
$fields = array('uid' => $page_owner_uid, 'hash' => $hash, 'filename' => $filename, 'filetype' => $mimetype,
$fields = ['uid' => $page_owner_uid, 'hash' => $hash, 'filename' => $filename, 'filetype' => $mimetype,
'filesize' => $filesize, 'data' => $filedata, 'created' => $created, 'edited' => $created,
'allow_cid' => '<' . $page_owner_cid . '>', 'allow_gid' => '','deny_cid' => '', 'deny_gid' => '');
'allow_cid' => '<' . $page_owner_cid . '>', 'allow_gid' => '','deny_cid' => '', 'deny_gid' => ''];
$r = dba::insert('attach', $fields);
@ -134,7 +134,7 @@ function wall_attach_post(App $a) {
if(! $r) {
$msg = t('File upload failed.');
if ($r_json) {
echo json_encode(array('error'=>$msg));
echo json_encode(['error'=>$msg]);
} else {
echo $msg. EOL ;
}
@ -150,7 +150,7 @@ function wall_attach_post(App $a) {
if (! DBM::is_result($r)) {
$msg = t('File upload failed.');
if ($r_json) {
echo json_encode(array('error'=>$msg));
echo json_encode(['error'=>$msg]);
} else {
echo $msg. EOL ;
}
@ -158,7 +158,7 @@ function wall_attach_post(App $a) {
}
if ($r_json) {
echo json_encode(array('ok'=>true));
echo json_encode(['ok'=>true]);
killme();
}