PHPackages                             mrbug/cardparser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mrbug/cardparser

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mrbug/cardparser
================

Parses card game results from a standard 52 card deck.

00PHP

Since Sep 15Pushed 8mo agoCompare

[ Source](https://github.com/mista-bug/cardparser)[ Packagist](https://packagist.org/packages/mrbug/cardparser)[ RSS](/packages/mrbug-cardparser/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

About
-----

[](#about)

A simple PHP library for parsing and representing card game data.

Currently supports :

- Blackjack
- Baccarat
- Andar Bahar

⚙️ Requirements
---------------

[](#️-requirements)

- PHP 8.2+
- Composer
- PHPUnit (for running tests)

**Sample Usage**
----------------

[](#sample-usage)

```
    $parser = new Parser(
        cardString: 'B;C9;DQ:P1;D7;SJ:P2;H9;D2;H9:P3;SQ;C5',
        gameCode: 'BJ',
    );
```

**Results**
-----------

[](#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) ";"
}
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance43

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/5f6bba082daedec32413349fd22ed8e60326ff7a876c3a19546eb6860d4b4455?d=identicon)[mista-bug](/maintainers/mista-bug)

---

Top Contributors

[![mista-bug](https://avatars.githubusercontent.com/u/136772889?v=4)](https://github.com/mista-bug "mista-bug (4 commits)")

---

Tags

cardcard-gamedeckofcardsgamblingigaming

### Embed Badge

![Health badge](/badges/mrbug-cardparser/health.svg)

```
[![Health](https://phpackages.com/badges/mrbug-cardparser/health.svg)](https://phpackages.com/packages/mrbug-cardparser)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
