From e8547f61f87256f011ffb15ead286fec31bfc378 Mon Sep 17 00:00:00 2001 From: Fred Emmott Date: Tue, 15 Dec 2020 11:52:57 -0800 Subject: [PATCH] Fix HH\Lib\Regex\Regex references (#149) 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: https://github.com/hhvm/hsl/pull/149 Test Plan: hh_client on open source checkout, automated tests Reviewed By: kmeht Differential Revision: D25562298 Pulled By: fredemmott fbshipit-source-id: c98709cb594da85847e1bf2afdf4683db5d12729 --- src/regex/regex.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/regex/regex.php b/src/regex/regex.php index 2199e257..d4613777 100644 --- a/src/regex/regex.php +++ b/src/regex/regex.php @@ -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; } @@ -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; }