Skip to content

Commit

Permalink
Minor update to Redirect class to improve the readability of return c…
Browse files Browse the repository at this point in the history
…heck of the matchI() method and also change the formatUrl() method to be static so it can be called more easily from elsewhere.
  • Loading branch information
timhiggs committed Mar 7, 2016
1 parent bf5c36f commit cc2837f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Redirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@ public function getStatusCode()
*/
public function match($url)
{
$from = $this->formatUrl($this->from);
return $from === $this->formatUrl($url)
&& $from !== $this->formatUrl($this->to);
$from = self::formatUrl($this->from);

return (($from === self::formatUrl($url)) && ($from !== self::formatUrl($this->to)));
}

/**
* @param string $url
* @return string
*/
public function formatUrl($url)
public static function formatUrl($url)
{
return trim(
strtolower($url),
Expand Down

0 comments on commit cc2837f

Please sign in to comment.