Skip to content

ext/intl: Add Spoofchecker::getRestrictionLevel() - #25422

Merged
LamentXU123 merged 1 commit into
php:masterfrom
LamentXU123:intl-funct
Nov 12, 2026
Merged

LamentXU123 merged 1 commit into
php:masterfrom
LamentXU123:intl-funct

Conversation

@LamentXU123

Copy link
Copy Markdown
Member

Expose ICU's uspoof_getRestrictionLevel() to retrieve the currently configured restriction level as a Spoofchecker restriction level constant.

<?php
$checker = new Spoofchecker();

var_dump(
    $checker->getRestrictionLevel() === Spoofchecker::HIGHLY_RESTRICTIVE
); // bool(true)

$checker->setRestrictionLevel(Spoofchecker::ASCII);

var_dump(
    $checker->getRestrictionLevel() === Spoofchecker::ASCII
); // bool(true)

@devnexen devnexen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

straightforward enough

@LamentXU123

LamentXU123 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member Author

Besides, I think there are bunch of stuffs that have a setter but don't have a getter. This is just an example.

getChecks, getAllowedLocale etc etc.

@LamentXU123
LamentXU123 merged commit e814035 into php:master Nov 12, 2026
16 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants