PHPackages                             fust/cards - 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. fust/cards

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

fust/cards
==========

A deck of standard cards to build any card game

v0.1.1(9y ago)1683MITPHPPHP &gt;=5.5.0

Since Feb 2Pushed 3y ago1 watchersCompare

[ Source](https://github.com/Aner-Git/cards)[ Packagist](https://packagist.org/packages/fust/cards)[ RSS](/packages/fust-cards/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

\#Cards. Build a Card game in minutes.

A standard 52-card deck is provided by default, but one can customize to build any deck needed. Create Bridge, BlackJack, Pocker and more...

Installation
------------

[](#installation)

Pull in the package through Composer.

Run `composer require fust/cards`

Usage
-----

[](#usage)

To start using the deck...

```
$d = new Deck;

$d->shuffle();

//deal... an array of cards
$hand1 = $d->drawHand(10);
$hand2 = $d->drawHand(10);

//draw a single card
$card = deck->draw();

//do something with card
$value = $card->value();
$suit = $card->suit();

//special card?
if($card->isFaceCard()){...}

//cards left in the deck
$deck->count();
```

When the game is over, simply reset the deck by shuffle(ing). The deck now has all the cards (including drawn).

```
//start a new game...
$deck->shuffle();
```

To customise the deck of cards (i.e. which cards are part of the deck) one can implement the CardProvider interface

```
class MyGameDeckProvider implements CardProvider{

    public function getCards(){

        //return an array of card for MyGame
	}
}
//...
$deck = new Deck(new MyGameDeckProvider);
```

You may also want to look at:

- `Shuffleable` for shuffling the cards
- `CardProvider` for providig cards to the deck

**The current implementation doen't let putting cards back into the deck after drawing them. Shuffle resets the deck**

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community3

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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.

###  Release Activity

Cadence

Every ~326 days

Total

2

Last Release

3429d ago

### Community

### Embed Badge

![Health badge](/badges/fust-cards/health.svg)

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

PHPackages © 2026

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