Skip to content

Commit d43c76c

Browse files
committed
AC-15667::static fix for unused local variables
1 parent e2cdc60 commit d43c76c

File tree

1 file changed

+17
-20
lines changed

1 file changed

+17
-20
lines changed

lib/internal/Magento/Framework/Test/Unit/EscaperTest.php

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
*
2121
* @SuppressWarnings(PHPMD.ExcessivePublicCount)
2222
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
23+
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
24+
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
2325
*/
2426
class EscaperTest extends TestCase
2527
{
@@ -1093,10 +1095,8 @@ public function __construct($instance)
10931095
*/
10941096
public function get($type)
10951097
{
1096-
// Reference parameter to satisfy PHPMD rules
1097-
if ($type === '') {
1098-
// no-op
1099-
}
1098+
$unusedType = $type;
1099+
unset($unusedType);
11001100
return $this->instance;
11011101
}
11021102

@@ -1106,10 +1106,9 @@ public function get($type)
11061106
*/
11071107
public function create($type, array $arguments = [])
11081108
{
1109-
// Reference parameters to satisfy PHPMD rules
1110-
if (!empty($arguments)) {
1111-
// no-op
1112-
}
1109+
$unusedType = $type;
1110+
$unusedArguments = $arguments;
1111+
unset($unusedType, $unusedArguments);
11131112
return $this->get($type);
11141113
}
11151114

@@ -1176,9 +1175,8 @@ public function __construct($instance)
11761175
*/
11771176
public function get($type)
11781177
{
1179-
if ($type === '') {
1180-
// no-op
1181-
}
1178+
$unusedType = $type;
1179+
unset($unusedType);
11821180
return $this->instance;
11831181
}
11841182

@@ -1188,9 +1186,9 @@ public function get($type)
11881186
*/
11891187
public function create($type, array $arguments = [])
11901188
{
1191-
if (!empty($arguments)) {
1192-
// no-op
1193-
}
1189+
$unusedType = $type;
1190+
$unusedArguments = $arguments;
1191+
unset($unusedType, $unusedArguments);
11941192
return $this->get($type);
11951193
}
11961194

@@ -1243,9 +1241,8 @@ public function __construct($instance)
12431241
*/
12441242
public function get($type)
12451243
{
1246-
if ($type === '') {
1247-
// no-op
1248-
}
1244+
$unusedType = $type;
1245+
unset($unusedType);
12491246
return $this->instance;
12501247
}
12511248

@@ -1255,9 +1252,9 @@ public function get($type)
12551252
*/
12561253
public function create($type, array $arguments = [])
12571254
{
1258-
if (!empty($arguments)) {
1259-
// no-op
1260-
}
1255+
$unusedType = $type;
1256+
$unusedArguments = $arguments;
1257+
unset($unusedType, $unusedArguments);
12611258
return $this->get($type);
12621259
}
12631260

0 commit comments

Comments
 (0)