mirror of
https://github.com/snipe/snipe-it.git
synced 2025-03-05 20:52:15 -08:00
rewrote null check
This commit is contained in:
parent
dbeb32f225
commit
35a39efafb
|
@ -12,8 +12,9 @@ class LicenseSeatsTransformer
|
||||||
public function transformLicenseSeats(Collection $seats, $total, $offset, $page)
|
public function transformLicenseSeats(Collection $seats, $total, $offset, $page)
|
||||||
{
|
{
|
||||||
$array = [];
|
$array = [];
|
||||||
$offset = isset($offset) ? $offset : 0;
|
$offset = $offset ?? 0;
|
||||||
$seat_count = 0 +($offset *($page + 1));
|
$seat_count = 0 +($offset *($page + 1));
|
||||||
|
|
||||||
foreach ($seats as $seat) {
|
foreach ($seats as $seat) {
|
||||||
$seat_count++;
|
$seat_count++;
|
||||||
$array[] = self::transformLicenseSeat($seat, $seat_count);
|
$array[] = self::transformLicenseSeat($seat, $seat_count);
|
||||||
|
|
Loading…
Reference in a new issue