PHPackages                             djmarland/isin - 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. djmarland/isin

ActiveLibrary

djmarland/isin
==============

A PHP Library for storing a validating an ISIN (International Securities Identification Number / ISO 6166)

v1.0.0(10y ago)06.0k2MITPHPPHP &gt;=5.4

Since Feb 28Pushed 10y ago1 watchersCompare

[ Source](https://github.com/djmarland/isin)[ Packagist](https://packagist.org/packages/djmarland/isin)[ Docs](https://github.com/djmarland/isin)[ RSS](/packages/djmarland-isin/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (2)Versions (4)Used By (0)

isin
====

[](#isin)

A PHP Library for storing a validating an ISIN (International Securities Identification Number / ISO 6166). ISINs will be checked against the checksum as detailed at \[[https://en.wikipedia.org/wiki/International\_Securities\_Identification\_Number](https://en.wikipedia.org/wiki/International_Securities_Identification_Number)\]

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

[](#installation)

The library can be installed via composer

```
composer require djmarland/isin

```

Usage
-----

[](#usage)

You can instantiate an ISIN object by passing in a string

```
use Djmarland\ISIN;

$number = 'GB00B3W23161';
$isin = new ISIN($number);
```

If the value passed in was not a valid ISIN it will throw a `Djmarland\ISIN\Exception\InvalidISINException`To get the value back out you can do

```
$value = $isin->getValue();
// GB00B3W23161
```

If you want to get hold of just the check digit you can use

```
$digit = $isin->getCheckDigit();
// 1
```

The object has a `__toString` so usage in views/routes etc will work:

```
echo 'The ISIN is ' . $isin;
// The ISIN is GB00B3W23161
```

### Validating ISINs

[](#validating-isins)

There are some helper static functions for simple validation.

```
$valid = ISIN::isValid('GB00B3W23161');
// true
```

This will return true if the value was a valid ISIN, false otherwise.

```
$number = ISIN::validate('gb00b3w23161');
// GB00B3W23161
$number = ISIN::validate('ABC');
// InvalidISINException
```

This will return the properly formatted ISIN (whitespace trimmed and converted to uppercase). It will throw a `Djmarland\ISIN\Exception\InvalidISINException` if the input was not valid.

Development
-----------

[](#development)

This project is open source. Feedback and pull requests are welcome. To develop the code:

Checkout the project. Run `composer install`

### Running Tests

[](#running-tests)

PHPUnit

```
vendor/bin/phpunit

```

Code Sniffer

```
vendor/bin/phpcs

```

Both must be run successfully before code can be submitted. Code coverage must also be 100%.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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 ~0 days

Total

3

Last Release

3728d ago

Major Versions

v0.0.2 → v1.0.02016-02-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/931e137f4a438b548307c021ce85035bb177ea3ffbff6dd7fa05fc97648d5e07?d=identicon)[djmarland](/maintainers/djmarland)

---

Top Contributors

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

---

Tags

ISINiso 6166iso61666166

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/djmarland-isin/health.svg)

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

###  Alternatives

[intervention/validation

Additional validation rules for the Laravel framework

6826.7M8](/packages/intervention-validation)[ronanguilloux/isocodes

PHP library - Validators for standards from ISO, International Finance, Public Administrations, GS1, Book and Music Industries, Phone numbers &amp; Zipcodes for many countries

8013.3M23](/packages/ronanguilloux-isocodes)

PHPackages © 2026

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