alex-kalanis / simple-vin
Simple checking of Vehicle Identification Numbers
v2.0.0
2024-12-21 10:37 UTC
Requires
- php: >=8.1.0
- psr/clock: ^1.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpstan/phpstan: ^1.0
- phpstan/phpstan-phpunit: ^1.0
- phpunit/phpunit: >=9.0 <11
- shipmonk/composer-dependency-analyser: ^1.4
This package is auto-updated.
Last update: 2024-12-21 10:49:18 UTC
README
This is a set of PHP libraries for Vehicle Identification Numbers.
Ported from .Net library Vin .
PHP installation
composer.phar require alex-kalanis/simple-vin
(Refer to Composer Documentation if you are not familiar with composer)
API usage
// basic vin check $lib = new \kalanis\simple_vin\SimpleVin(); // can be set via DI, usually no more dependency need $x = $lib->isValid('11111111111111111'); // true $m = $lib->getWorldManufacturer('TMP......D.......'); // Skoda Trolleybuses $y = $lib->getModelYear('TMP......D.......'); // 2013 $k = $lib->restoreChecksumCharacter('1FTKR1AD_APA11957'); // X $c = $lib->restoreChecksum('1FTKR1AD_APA11957'); // 1FTKR1ADXAPA11957 // extended vin check $lib = new \kalanis\simple_vin\DeeperVin(); // can be set via DI, usually no more dependency need $manufacturers = $lib->getPossibleManufacturers('ZAP......D.......'); // Piaggio, Vespa, Gilera
Sources
- Wikipedia
- ISO 3779
- ISO 4030
Changes
- v1.0.0 - Initial port and refactor with extended tests
- v1.1.0 - Calculate checksum characters from the rest of code
- v1.2.0 - Update VIN manufacturer codes in accordance with the current Wikipedia page
- v2.0.0 - Update VIN manufacturer format, update minimal php version