diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-17 07:20:29 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-17 07:20:29 +0900 |
| commit | 6b4ce98f20b3cfc14f1c955565a8acd9abcc16a2 (patch) | |
| tree | 1c752ee23480e71fabad42c3bbe2b7ffc7f6acdc /scripts/linters/src/Linters/NoModRs.php | |
| parent | c7aa10384a2548167466b4c61f9eff29ed8611f6 (diff) | |
| download | php-shirabe-6b4ce98f20b3cfc14f1c955565a8acd9abcc16a2.tar.gz php-shirabe-6b4ce98f20b3cfc14f1c955565a8acd9abcc16a2.tar.zst php-shirabe-6b4ce98f20b3cfc14f1c955565a8acd9abcc16a2.zip | |
refactor(preg): report unmatched groups as null in the vec-shaped preg_*
preg_match_all() and preg_match_all_set_order() were the last preg_*
functions handing back a bare Vec<String>, where a group that did not
participate is indistinguishable from one that captured "". Hand back
Option<String> as the map-shaped functions already do; php_match_row(),
the last of the truncate-then-pad helpers, goes with them.
preg_split_delim_capture() keeps its Vec<String>. preg_split() accepts
no PREG_UNMATCHED_AS_NULL, so there is no null form to move it to, and
its result interleaves split segments -- which can never be absent --
with the captured delimiters.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'scripts/linters/src/Linters/NoModRs.php')
0 files changed, 0 insertions, 0 deletions
