Skip to content

Commit 65d89db

Browse files
committed
Remoed code duplication.
1 parent ffb8ae2 commit 65d89db

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/FormattedException.php

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,13 @@ public static function formattedConstruct($args)
6363
$special = $format;
6464
$format = array_shift($args);
6565

66-
if (isset($special[0]))
66+
for ($i = 0; $i<2; $i++)
6767
{
68-
if ($special[0] instanceof \Exception) $previous = $special[0];
69-
elseif (is_int($special[0])) $code = $special[0];
70-
}
71-
72-
if (isset($special[1]))
73-
{
74-
if ($special[1] instanceof \Exception) $previous = $special[1];
75-
elseif (is_int($special[1])) $code = $special[1];
68+
if (isset($special[$i]))
69+
{
70+
if ($special[$i] instanceof \Exception) $previous = $special[$i];
71+
elseif (is_int($special[$i])) $code = $special[$i];
72+
}
7673
}
7774
}
7875

0 commit comments

Comments
 (0)