Adopt short array syntax

Since PHP 5.4 the short array syntax `[]` may be used instead of `array()`.
This commit is contained in:
Shift
2023-01-03 08:25:32 +00:00
parent 43386fd86d
commit f9ab4d057e
17 changed files with 62 additions and 62 deletions

View File

@@ -2,18 +2,18 @@
$term = $_GET["term"];
$organizations =App\Model\helpdesk\Agent_panel\Organization::where('name', 'LIKE', '%' . $term . '%')->get();
$json = array();
$json = [];
foreach ($organizations as $organization) {
$json[] = array(
$json[] = [
'value' => $organization["name"],
'label' => $organization["name"],
'org' => $organization["name"],
);
];
}
echo json_encode($json);

View File

@@ -2,11 +2,11 @@
$term = $_GET["term"];
$users = app\User::where('email', 'LIKE', '%' . $term . '%')->where('active', '=', 1)->where('role', '=', 'user')->get();
$json = array();
$json = [];
foreach ($users as $user) {
$json[] = array(
$json[] = [
'value' => $user["email"],
'label' => 'Name: '.$user["first_name"] .' '.$user["last_name"].' | '.('Email: <'.$user["email"].'>'),
'email' => $user["email"],
@@ -17,7 +17,7 @@ foreach ($users as $user) {
'mobile' => $user["mobile"],
'phone_number' => $user["phone_number"]
);
];
}
echo json_encode($json);

View File

@@ -52,9 +52,9 @@ class="nav-link active"
$date_time_format = UTC::getDateTimeFormat();
if (Auth::user()->role == 'agent') {
$dept = App\Model\helpdesk\Agent\Department::where('id', '=', Auth::user()->primary_dpt)->first();
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->count();
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', [1, 7])->where('dept_id', '=', $dept->id)->orderBy('id', 'DESC')->count();
} else {
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', array(1, 7))->orderBy('id', 'DESC')->count();
$tickets = App\Model\helpdesk\Ticket\Tickets::whereIn('status', [1, 7])->orderBy('id', 'DESC')->count();
}
?>
<!-- Main content -->

View File

@@ -149,7 +149,7 @@ if ($thread->title != "") {
@endif
<?php Event::fire('show-add-event-btn', array()); ?>
<?php Event::fire('show-add-event-btn', []); ?>
<a href="{{url('ticket/print/'.$tickets->id)}}" target="_blank" class="btn btn-default btn-tool btn-sm"><i class="fas fa-print" > </i> {!! Lang::get('lang.generate_pdf') !!}</a>
<div class="btn-group">
@@ -311,7 +311,7 @@ if ($thread->title != "") {
</div>
</div>
<?php Event::fire('ticket.timeline.marble',array($TicketData));?>
<?php Event::fire('ticket.timeline.marble',[$TicketData]);?>
<div id="gifshow" style="display:none" class="text-center">
<img src="{{asset("lb-faveo/media/images/gifloader.gif")}}">
</div> <!-- added 05/05/2016-->
@@ -1072,7 +1072,7 @@ if ($thread->title != "") {
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<?php \Event::fire('show-add-calendar-model', array('id' => $tickets->id))?>
<?php \Event::fire('show-add-calendar-model', ['id' => $tickets->id])?>
<!-- add or search user Modal -->
<div class="modal fade" id="addccc">
<div class="modal-dialog">

View File

@@ -1368,8 +1368,8 @@ class="nav-link active"
<div class="modal-body">
<?php
$groups = App\Model\helpdesk\Agent\Groups::all(array('id', 'name'));
$departments = App\Model\helpdesk\Agent\Department::all(array('id', 'name'));
$groups = App\Model\helpdesk\Agent\Groups::all(['id', 'name']);
$departments = App\Model\helpdesk\Agent\Department::all(['id', 'name']);
?>
<!-- <div class="col-sm-4 form-group {{ $errors->has('group') ? 'has-error' : '' }}"> -->
@@ -1440,8 +1440,8 @@ class="nav-link active"
<div class="modal-body">
<?php
$groups = App\Model\helpdesk\Agent\Groups::all(array('id', 'name'));
$departments = App\Model\helpdesk\Agent\Department::all(array('id', 'name'));
$groups = App\Model\helpdesk\Agent\Groups::all(['id', 'name']);
$departments = App\Model\helpdesk\Agent\Department::all(['id', 'name']);
?>
<!-- <div class="col-sm-4 form-group {{ $errors->has('group') ? 'has-error' : '' }}"> -->