Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply fixes from StyleCI #68

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions app/Http/Controllers/Device/Tabs/PortsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@

$data = [
'ports' => $ports,
'neighbors' => $ports->keyBy('port_id')->map(fn ($port) => $this->findPortNeighbors($port)),

Check failure on line 118 in app/Http/Controllers/Device/Tabs/PortsController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Parameter #1 $port of method App\Http\Controllers\Device\Tabs\PortsController::findPortNeighbors() expects App\Models\Port, Illuminate\Database\Eloquent\Model given.
'graphs' => [
'bits' => [['type' => 'port_bits', 'title' => trans('Traffic'), 'vars' => [['from' => '-1d'], ['from' => '-7d'], ['from' => '-30d'], ['from' => '-1y']]]],
'upkts' => [['type' => 'port_upkts', 'title' => trans('Packets (Unicast)'), 'vars' => [['from' => '-1d'], ['from' => '-7d'], ['from' => '-30d'], ['from' => '-1y']]]],
Expand Down Expand Up @@ -290,25 +290,25 @@
'name' => __('port.graphs.bits'),
'url' => 'graphs?type=bits',
'sub_name' => __('Mini'),
'sub_url' => 'mini_graphs?type=bits'
'sub_url' => 'mini_graphs?type=bits',
],
[
'name' => __('port.graphs.upkts'),
'url' => 'graphs?type=upkts',
'sub_name' => __('Mini'),
'sub_url' => 'mini_graphs?type=upkts'
'sub_url' => 'mini_graphs?type=upkts',
],
[
'name' => __('port.graphs.nupkts'),
'url' => 'graphs?type=nupkts',
'sub_name' => __('Mini'),
'sub_url' => 'mini_graphs?type=nupkts'
'sub_url' => 'mini_graphs?type=nupkts',
],
[
'name' => __('port.graphs.errors'),
'url' => 'graphs?type=errors',
'sub_name' => __('Mini'),
'sub_url' => 'mini_graphs?type=errors'
'sub_url' => 'mini_graphs?type=errors',
],
];

Expand All @@ -317,7 +317,7 @@
'name' => __('port.graphs.etherlike'),
'url' => 'graphs?type=etherlike',
'sub_name' => __('Mini'),
'sub_url' => 'mini_graphs?type=etherlike'
'sub_url' => 'mini_graphs?type=etherlike',
];
}

Expand All @@ -336,12 +336,12 @@
default => 'ifIndex',
};

return $device->ports()

Check failure on line 339 in app/Http/Controllers/Device/Tabs/PortsController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Call to an undefined method Illuminate\Database\Eloquent\Builder<Illuminate\Database\Eloquent\Model>::hasAccess().
->isNotDeleted()
->when(!$request->input('disabled'), fn(Builder $q, $disabled) => $q->where('disabled', 0))
->when(!$request->input('ignore'), fn(Builder $q, $disabled) => $q->where('ignore', 0))
->when($request->input('admin') != 'any', fn(Builder $q, $admin) => $q->where('ifAdminStatus', $request->input('admin', 'up')))
->when($request->input('status', 'any') != 'any', fn(Builder $q, $admin) => $q->where('ifOperStatus', $request->input('status')))
->when(! $request->input('disabled'), fn (Builder $q, $disabled) => $q->where('disabled', 0))

Check failure on line 341 in app/Http/Controllers/Device/Tabs/PortsController.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Parameter #2 $callback of method Illuminate\Database\Eloquent\Relations\HasMany<App\Models\Port>::when() expects (callable(Illuminate\Database\Eloquent\Relations\HasMany<App\Models\Port>, bool): Illuminate\Database\Eloquent\Builder)|null, Closure(Illuminate\Database\Eloquent\Builder, mixed): Illuminate\Database\Eloquent\Builder given.
->when(! $request->input('ignore'), fn (Builder $q, $disabled) => $q->where('ignore', 0))
->when($request->input('admin') != 'any', fn (Builder $q, $admin) => $q->where('ifAdminStatus', $request->input('admin', 'up')))
->when($request->input('status', 'any') != 'any', fn (Builder $q, $admin) => $q->where('ifOperStatus', $request->input('status')))
->orderBy($orderBy, $this->sortOrder)
->hasAccess(Auth::user())->with($relationships);
}
Expand Down
1 change: 1 addition & 0 deletions includes/html/pages/device/neighbours/list.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

DeviceCache::get($device['device_id'])->load(['links.port', 'links.remoteDevice', 'links.remotePort']);
echo view('device.tabs.ports.links', [
'data' => [
Expand Down
Loading