mrbug/cardparser
Composer 安装命令:
composer require mrbug/cardparser
包简介
Parses card game results from a standard 52 card deck.
README 文档
README
A simple PHP library for parsing and representing card game data.
Currently supports :
- Blackjack
- Baccarat
- Andar Bahar
⚙️ Requirements
- PHP 8.2+
- Composer
- PHPUnit (for running tests)
Sample Usage
$parser = new Parser( cardString: 'B;C9;DQ:P1;D7;SJ:P2;H9;D2;H9:P3;SQ;C5', gameCode: 'BJ', );
Results
object(MrBug\Cardparser\Parser)#646 (4) { ["game":protected]=> object(MrBug\Cardparser\Game)#375 (3) { ["name":protected]=> string(9) "Blackjack" ["code"]=> string(2) "BJ" ["handCollection"]=> array(4) { [0]=> object(MrBug\Cardparser\Symbol)#655 (4) { ["code":protected]=> string(1) "B" ["gameCode":protected]=> string(2) "BJ" ["name":protected]=> string(6) "Banker" ["hand":protected]=> array(2) { [0]=> object(MrBug\Cardparser\Card)#653 (5) { ["code":protected]=> string(2) "C9" ["fullName":protected]=> string(13) "Nine of Clubs" ["suit":protected]=> string(1) "C" ["value":protected]=> string(1) "9" ["dir":protected]=> uninitialized(?string) ["dirLocation":protected]=> uninitialized(?string) ["fileType":protected]=> string(4) ".svg" } [1]=> object(MrBug\Cardparser\Card)#652 (5) { ["code":protected]=> string(2) "DQ" ["fullName":protected]=> string(17) "Queen of Diamonds" ["suit":protected]=> string(1) "D" ["value":protected]=> string(1) "Q" ["dir":protected]=> uninitialized(?string) ["dirLocation":protected]=> uninitialized(?string) ["fileType":protected]=> string(4) ".svg" } } } [1]=> object(MrBug\Cardparser\Symbol)#651 (4) { ["code":protected]=> string(2) "P1" ["gameCode":protected]=> string(2) "BJ" ["name":protected]=> string(8) "Player 1" ["hand":protected]=> array(2) { [0]=> object(MrBug\Cardparser\Card)#20 (5) { ["code":protected]=> string(2) "D7" ["fullName":protected]=> string(17) "Seven of Diamonds" ["suit":protected]=> string(1) "D" ["value":protected]=> string(1) "7" ["dir":protected]=> uninitialized(?string) ["dirLocation":protected]=> uninitialized(?string) ["fileType":protected]=> string(4) ".svg" } [1]=> object(MrBug\Cardparser\Card)#641 (5) { ["code":protected]=> string(2) "SJ" ["fullName":protected]=> string(14) "Jack of Spades" ["suit":protected]=> string(1) "S" ["value":protected]=> string(1) "J" ["dir":protected]=> uninitialized(?string) ["dirLocation":protected]=> uninitialized(?string) ["fileType":protected]=> string(4) ".svg" } } } [2]=> object(MrBug\Cardparser\Symbol)#645 (4) { ["code":protected]=> string(2) "P2" ["gameCode":protected]=> string(2) "BJ" ["name":protected]=> string(8) "Player 2" ["hand":protected]=> array(3) { [0]=> object(MrBug\Cardparser\Card)#644 (5) { ["code":protected]=> string(2) "H9" ["fullName":protected]=> string(14) "Nine of Hearts" ["suit":protected]=> string(1) "H" ["value":protected]=> string(1) "9" ["dir":protected]=> uninitialized(?string) ["dirLocation":protected]=> uninitialized(?string) ["fileType":protected]=> string(4) ".svg" } [1]=> object(MrBug\Cardparser\Card)#598 (5) { ["code":protected]=> string(2) "D2" ["fullName":protected]=> string(15) "Two of Diamonds" ["suit":protected]=> string(1) "D" ["value":protected]=> string(1) "2" ["dir":protected]=> uninitialized(?string) ["dirLocation":protected]=> uninitialized(?string) ["fileType":protected]=> string(4) ".svg" } [2]=> object(MrBug\Cardparser\Card)#597 (5) { ["code":protected]=> string(2) "H9" ["fullName":protected]=> string(14) "Nine of Hearts" ["suit":protected]=> string(1) "H" ["value":protected]=> string(1) "9" ["dir":protected]=> uninitialized(?string) ["dirLocation":protected]=> uninitialized(?string) ["fileType":protected]=> string(4) ".svg" } } } [3]=> object(MrBug\Cardparser\Symbol)#596 (4) { ["code":protected]=> string(2) "P3" ["gameCode":protected]=> string(2) "BJ" ["name":protected]=> string(8) "Player 3" ["hand":protected]=> array(2) { [0]=> object(MrBug\Cardparser\Card)#595 (5) { ["code":protected]=> string(2) "SQ" ["fullName":protected]=> string(15) "Queen of Spades" ["suit":protected]=> string(1) "S" ["value":protected]=> string(1) "Q" ["dir":protected]=> uninitialized(?string) ["dirLocation":protected]=> uninitialized(?string) ["fileType":protected]=> string(4) ".svg" } [1]=> object(MrBug\Cardparser\Card)#594 (5) { ["code":protected]=> string(2) "C5" ["fullName":protected]=> string(13) "Five of Clubs" ["suit":protected]=> string(1) "C" ["value":protected]=> string(1) "5" ["dir":protected]=> uninitialized(?string) ["dirLocation":protected]=> uninitialized(?string) ["fileType":protected]=> string(4) ".svg" } } } } } ["cardString":protected]=> string(37) "B;C9;DQ:P1;D7;SJ:P2;H9;D2;H9:P3;SQ;C5" ["handSeparator":protected]=> string(1) ":" ["cardSeparator":protected]=> string(1) ";" }
mrbug/cardparser 适用场景与选型建议
mrbug/cardparser 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 09 月 15 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 mrbug/cardparser 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mrbug/cardparser 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 22
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-09-15