Skip to content

Commit

Permalink
fix unset reference variable
Browse files Browse the repository at this point in the history
  • Loading branch information
samsonasik committed Jul 12, 2020
1 parent abd2794 commit 983293e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions system/Router/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -831,11 +831,11 @@ public function resource(string $name, array $options = null): RouteCollectionIn
if (isset($options['except']))
{
$options['except'] = is_array($options['except']) ? $options['except'] : explode(',', $options['except']);
foreach ($methods as &$method)
foreach ($methods as $i => $method)
{
if (in_array($method, $options['except']))
{
unset($method);
unset($methods[$i]);
}
}
}
Expand Down Expand Up @@ -945,11 +945,11 @@ public function presenter(string $name, array $options = null): RouteCollectionI
if (isset($options['except']))
{
$options['except'] = is_array($options['except']) ? $options['except'] : explode(',', $options['except']);
foreach ($methods as &$method)
foreach ($methods as $i => $method)
{
if (in_array($method, $options['except']))
{
unset($method);
unset($methods[$i]);
}
}
}
Expand Down

0 comments on commit 983293e

Please sign in to comment.