Page MenuHomePhabricator

Provide some "preg_*" wrappers which raise exceptions on failure
ClosedPublic

Authored by epriestley on Feb 17 2021, 8:44 PM.
Tags
None
Referenced Files
F15468514: D21561.diff
Fri, Apr 4, 1:15 AM
F15454779: D21561.id.diff
Sat, Mar 29, 8:22 PM
F15453251: D21561.id51330.diff
Sat, Mar 29, 10:28 AM
F15452426: D21561.id51348.diff
Sat, Mar 29, 4:43 AM
F15443885: D21561.diff
Thu, Mar 27, 6:43 AM
F15432017: D21561.id.diff
Mon, Mar 24, 3:51 PM
F15311113: D21561.id51348.diff
Mar 6 2025, 9:47 AM
F15309583: D21561.id51330.diff
Mar 6 2025, 7:27 AM
Subscribers
None

Details

Summary

Ref T13608. Ref T13100. Ref T13586. Properly checking "preg_match()" and similar calls for failure and raising useful exceptions is complicated and error-prone. Provide wrapper functions with an API that's more consistent with the rest of the codebase: matches are returned; and errors raise detailed exceptions.

Test Plan

See next change.

Diff Detail

Repository
rARC Arcanist
Branch
regex1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 25140
Build 34694: Run Core Tests
Build 34693: arc lint + arc unit