phillipsdata / vin
VIN(车辆识别号)验证和诊断库
1.0.0
2016-01-07 20:41 UTC
Requires
- php: >=5.3.0
Requires (Dev)
- phpunit/phpunit: ~4.6
- satooshi/php-coveralls: ~1.0
- squizlabs/php_codesniffer: ~2.2
This package is auto-updated.
Last update: 2024-09-23 09:37:17 UTC
README
VIN(车辆识别号)验证和诊断库。
特性
- 验证北美VIN号码。
- 返回北美VIN号码的所有可能的制造年份。
- 返回ISO 3779定义的VIN的制造商国家。
- 支持验证北美以外的VIN的自定义读取器。
安装
通过composer安装
composer require phillipsdata/vin
基本用法
use PhillipsData\Vin\Number; $vin = new Number('1M8GDM9AXKP042788'); $vin->valid(); // returns whether the VIN is valid $vin->country(); // returns the ISO 3166 country code for the country of origin $vin->number(); // returns the VIN number (e.g. 1M8GDM9AXKP042788) $vin->year(); // returns an array of possible manufacturer years
高级用法
您可以提供自己的VIN读取器。这允许您为其他国家的车辆(北美以外的)实现VIN读取器。
use PhillipsData\Vin\Number; $vin = new Number('1M8GDM9AXKP042788', new PhillipsData\Vin\Reader\NorthAmerica()); $reader = $vin->reader(); // returns instance of PhillipsData\Vin\Reader\ReaderInterface
贡献
我们对添加额外的PhillipsData\Vin\Reader\ReaderInterface
实现以支持未受支持的区域的贡献感兴趣。
我们还希望这个库能够根据SAE对世界制造商标识符的分配支持提取制造商(例如,福特、雪佛兰等)。