PHPackages                             codeat3/icndb - 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. codeat3/icndb

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

codeat3/icndb
=============

0.1.4(5y ago)0562MITPHPPHP ^7.1|^7.3|^8.0CI failing

Since Apr 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/codeat3/icndb)[ Packagist](https://packagist.org/packages/codeat3/icndb)[ Docs](https://github.com/codeat3/icndb)[ RSS](/packages/codeat3-icndb/feed)WikiDiscussions master Synced 5d ago

READMEChangelogDependencies (1)Versions (6)Used By (2)

A PHP wrapper for Internet Chuck Norris Database (ICNDb)
========================================================

[](#a-php-wrapper-for-internet-chuck-norris-database-icndb)

[![Latest Version on Packagist](https://camo.githubusercontent.com/299754901595720f2a911749eeb84014644dc70e3ce93801744d3a8b35cce7a8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636f64656174332f69636e64622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codeat3/icndb)[![Build Status](https://camo.githubusercontent.com/324209bc0cf651ee3d35b4439811624825feefabf672690641dc7640d53b39bd/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f636f64656174332f69636e64622f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/codeat3/icndb)[![Quality Score](https://camo.githubusercontent.com/6b4d1ae01e76341a580a4b7c9fd5a1aa130771e49d301d0a6ee990ccd3d95e56/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f636f64656174332f69636e64622e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/codeat3/icndb)[![Total Downloads](https://camo.githubusercontent.com/6ddb343483a3bfa078854bd32fd3132b3e0e56adfa59a76086e4d792df188032/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636f64656174332f69636e64622e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/codeat3/icndb)

This PHP package is a fork of [jcldavid/ICNDb](https://github.com/jcldavid/ICNDb) by Cyrus David.

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

[](#installation)

You can install the package via composer:

```
composer require codeat3/icndb
```

Usage
-----

[](#usage)

```
$config = array(
	'firstName' => 'Cyrus',
	'lastName' => 'David'
);

// Pass an optional parameter to change the firstName and lastName
// Default is Chuck Norris
$chuck = new Swapnilsarwe\ICNDbClient($config);

// Get the total Chuck Norris jokes stored in ICNDb
$total = $chuck->count()->get();

// Get all categories
$categories = $chuck->categories()->get();

// Get a specific joke by it's ID
$specific = $chuck->specific(18)->get();

//Get a random joke
$random = $chuck->random()->get();

// Get multiple random jokes
$random2 = $chuck->random(3)->get();

// use exclude() to get jokes not belong to that category
$exclude = $chuck->random()->exclude('nerdy')->get();

// you can also supply an array
$exclude2 = $chuck->random()->exclude(array('nerdy', 'explicit'))->get();

// or chain them
$exclude3 = $chuck->random(2)->exclude('explicit')->exclude('nerdy')->get();

// use limitTo() to get jokes only from that category
// you may supply an array or chain them like exclude()
$limit = $chuck->random()->limitTo('nerdy')->get();
```

Exceptions
----------

[](#exceptions)

**APIUnavailableException** - API is either unreachable/unavailable

**ChainNotAllowedException** - When these methods are chained together `random()`, `specific($id)`, `categories()`, `count()`

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Swapnil Sarwe](https://github.com/codeat3)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

PHP Package Boilerplate
-----------------------

[](#php-package-boilerplate)

This package was generated using the [PHP Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~81 days

Total

5

Last Release

1892d ago

PHP version history (2 changes)0.0.1PHP ^7.1

0.1.4PHP ^7.1|^7.3|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/166912?v=4)[Swapnil Sarwe](/maintainers/swapnilsarwe)[@swapnilsarwe](https://github.com/swapnilsarwe)

---

Top Contributors

[![swapnilsarwe](https://avatars.githubusercontent.com/u/166912?v=4)](https://github.com/swapnilsarwe "swapnilsarwe (4 commits)")

---

Tags

icndbcodeat3

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codeat3-icndb/health.svg)

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

###  Alternatives

[gitonomy/gitlib

Library for accessing git

46418.6M56](/packages/gitonomy-gitlib)[mglaman/composer-drupal-lenient

1317.4M15](/packages/mglaman-composer-drupal-lenient)

PHPackages © 2026

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