Skip to content

Commit

Permalink
Fix HH\Lib\Regex\Regex references (hhvm#149)
Browse files Browse the repository at this point in the history
Summary:
Autoimports are not enabled/configured by default, so Regex\ is interpreted relative to the current namespace, which is HH\Lib\Regex, leading to HH\Lib\Regex\Regex

Prefering namespace\Exception over just Exception for clarity=

Pull Request resolved: hhvm#149

Test Plan: hh_client on open source checkout, automated tests

Reviewed By: kmeht

Differential Revision: D25562298

Pulled By: fredemmott

fbshipit-source-id: c98709cb594da85847e1bf2afdf4683db5d12729
  • Loading branch information
fredemmott authored and facebook-github-bot committed Dec 15, 2020
1 parent 3f7a0e1 commit e8547f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/regex/regex.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function replace(
list ($result, $error) =
_Private\_Regex\replace($haystack, $pattern, $replacement);
if ($error is nonnull) {
throw new Regex\Exception($pattern, $error);
throw new namespace\Exception($pattern, $error);
}
return $result as nonnull;
}
Expand All @@ -118,7 +118,7 @@ function replace(
list ($result, $error) =
_Private\_Regex\replace($haystack2, $pattern, $replacement);
if ($error is nonnull) {
throw new Regex\Exception($pattern, $error);
throw new namespace\Exception($pattern, $error);
}
return $haystack1 . $result;
}
Expand Down

0 comments on commit e8547f6

Please sign in to comment.