aliance/infinite-bitmask

无限位掩码实现

3.0.0 2023-02-03 01:02 UTC

This package is auto-updated.

Last update: 2024-08-30 01:54:40 UTC


README

License Packagist PHP Version Code Coverage

关于

基于Aliance/Bitmask,但没有最大位限制。

安装

使用composer安装最新版本

composer require aliance/infinite-bitmask

如果您为了测试目的检查此库,请安装其依赖项

docker run --rm -it --volume $PWD:/app -u $(id -u):$(id -g) composer:2 i

用法

请参考示例文件。

docker run -it --rm -v "$PWD":/usr/src/infinite-bitmask -w /usr/src/infinite-bitmask php:8.1-cli php example/example.php 
Check user for all flags:
Premium: no
Wizard already shown: no
Paid ever: no
Referral: no
Banned: no
Already notified: no
–––––––––––––––––––––––––––––––––––
Check user for all flags:
Premium: no
Wizard already shown: no
Paid ever: yes
Referral: no
Banned: yes
Already notified: yes
–––––––––––––––––––––––––––––––––––
array(3) {
  [0]=>
  int(8)
  [1]=>
  int(1)
  [2]=>
  int(1)
}
Check user for all flags:
Premium: no
Wizard already shown: no
Paid ever: yes
Referral: no
Banned: yes
Already notified: no
–––––––––––––––––––––––––––––––––––
array(3) {
  [0]=>
  int(8)
  [1]=>
  int(1)
  [2]=>
  int(0)
}

测试

要完全运行测试,请调用composer exec phpunit或使用

docker run -it --rm -v "$PWD":/usr/src/infinite-bitmask -w /usr/src/infinite-bitmask php:8.1-cli php ./vendor/bin/phpunit

许可证

本软件根据MIT许可证分发。