think.studio/php-blocklist-check

简单的黑名单验证器。

2.1.0 2023-08-19 17:15 UTC

This package is auto-updated.

Last update: 2024-09-19 19:43:02 UTC


README

Packagist License Packagist Version Total Downloads Build Status Code Coverage Scrutinizer Code Quality

简单的黑名单验证器。

安装

通过composer安装此包

composer require think.studio/php-blocklist-check

用法

$isAllowlisted = ( new BlocklistProcessor( [
        new RegexChecker( [ '/\.hacker$/', ], [ 'email' ] ),
        new RegexChecker( [
            // contain cyrillic
            '/[А-Яа-яЁё]+/u',
        ], [
            'title',
            'first_name',
            'last_name',
        ] ),
    ] ) )->passed( $user )

鸣谢

  • Think Studio