2017 © Pedro Peláez
 

library isin

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

image

djmarland/isin

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

  • Sunday, February 28, 2016
  • by djmarland
  • Repository
  • 1 Watchers
  • 0 Stars
  • 40 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

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], (*1)

Installation

The library can be installed via composer, (*2)

composer require djmarland/isin

Usage

You can instantiate an ISIN object by passing in a string, (*3)

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, (*4)

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

If you want to get hold of just the check digit you can use, (*5)

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

The object has a __toString so usage in views/routes etc will work:, (*6)

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

Validating ISINs

There are some helper static functions for simple validation., (*7)

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

This will return true if the value was a valid ISIN, false otherwise., (*8)

$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., (*9)

Development

This project is open source. Feedback and pull requests are welcome. To develop the code:, (*10)

Checkout the project. Run composer install, (*11)

Running Tests

PHPUnit, (*12)

vendor/bin/phpunit

Code Sniffer, (*13)

vendor/bin/phpcs

Both must be run successfully before code can be submitted. Code coverage must also be 100%., (*14)

The Versions

28/02 2016

dev-master

9999999-dev https://github.com/djmarland/isin

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

isin iso 6166 iso6166 6166

28/02 2016

v0.0.2

0.0.2.0 https://github.com/djmarland/isin

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

isin iso 6166 iso6166 6166

28/02 2016

v1.0.0

1.0.0.0 https://github.com/djmarland/isin

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

isin iso 6166 iso6166 6166

28/02 2016

v0.0.1

0.0.1.0 https://github.com/djmarland/isin

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

  Sources   Download

MIT

The Requires

  • php >=5.4

 

The Development Requires

isin iso 6166 iso6166 6166