Skip to content

Commit 275bb47

Browse files
committed
Remove/Fix unused variables
1 parent 07e2af9 commit 275bb47

File tree

7 files changed

+7
-10
lines changed

7 files changed

+7
-10
lines changed

lib/GaletteObjectsLend/Controllers/MainController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ public function storePreferences(Request $request, Response $response): Response
9898
$lendsprefs = new Preferences($this->zdb);
9999

100100
$error_detected = [];
101-
$success_detected = [];
102101
if ($lendsprefs->store($post)) {
103102
$this->flash->addMessage(
104103
'success_detected',

lib/GaletteObjectsLend/Entity/LendCategory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function store(): bool
144144
try {
145145
$values = [];
146146

147-
foreach ($this->fields as $k => $v) {
147+
foreach (array_keys($this->fields) as $k) {
148148
if ($k === 'is_active' && $this->$k === false) {
149149
//Handle booleans for postgres ; bugs #18899 and #19354
150150
$values[$k] = $this->zdb->isPostgres() ? 'false' : 0;

lib/GaletteObjectsLend/Entity/LendObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public function store(): bool
311311
try {
312312
$values = [];
313313

314-
foreach ($this->fields as $k => $v) {
314+
foreach (array_keys($this->fields) as $k) {
315315
if (
316316
($k === 'is_active' || $k === 'price_per_day')
317317
&& $this->$k === false

lib/GaletteObjectsLend/Entity/LendRent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function store(): bool
148148
$zdb->connection->beginTransaction();
149149
$values = [];
150150

151-
foreach ($this->fields as $k => $v) {
151+
foreach (array_keys($this->fields) as $k) {
152152
$values[$k] = $this->$k ?? null;
153153
}
154154

lib/GaletteObjectsLend/Entity/LendStatus.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function store(): bool
116116
try {
117117
$values = [];
118118

119-
foreach ($this->fields as $k => $v) {
119+
foreach (array_keys($this->fields) as $k) {
120120
if (
121121
($k === 'is_active' || $k === 'in_stock')
122122
&& $this->$k === false

lib/GaletteObjectsLend/Entity/Picture.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,7 @@ private function createThumb(string $source, string $ext, ?string $dest = null):
176176
return false;
177177
}
178178

179-
[$cur_width, $cur_height, $cur_type, $curattr]
180-
= getimagesize($source);
179+
[$cur_width, $cur_height] = getimagesize($source);
181180

182181
$ratio = $cur_width / $cur_height;
183182

@@ -356,8 +355,7 @@ private function setThumbSizes(Preferences $prefs): void
356355
} else {
357356
//resize if too small/large
358357
if (function_exists("gd_info")) {
359-
[$cur_width, $cur_height, $cur_type, $curattr]
360-
= getimagesize($thumb);
358+
[$cur_width, $cur_height] = getimagesize($thumb);
361359

362360
if (
363361
$cur_height != $this->getOptimalHeight()

lib/GaletteObjectsLend/IO/PdfObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function drawCard(LendObject $object): void
129129
if ($tw > 16) {
130130
$wpic = 30;
131131
} else {
132-
$wlogo = $tw;
132+
$wpic = $tw;
133133
}
134134
$hpic = round($wpic / $ratio);
135135
}

0 commit comments

Comments
 (0)