amattu2/state-inspection-lookup

这是一个PHP包装器,用于通过VIN号码使用各种专有DMV端点查找美国各州检验报告。

v1.0.0 2023-03-12 14:32 UTC

This package is not auto-updated.

Last update: 2024-09-23 19:36:11 UTC


README

这是一个用于查找数字车辆状态安全/排放检验记录的基本库/包装器。如果您需要检查车辆最后一次进行州级检验的日期,并且知道该州,此库适合您。一些州还支持返回最后一次排放/烟雾测试的信息。最初是为集成到汽车服务管理SaaS应用而设计的。

支持的州

用法

安装

使用composer

composer require amattu2/state-inspection-lookup

手动

git clone https://github.com/amattu2/state-inspection-lookup

文件

Composer:导入自动加载

require("vendor/autoload.php");

手动:导入核心文件

require("src/Inspections.php");
require("src/StateInspectionBase.php");
require("src/StateInspectionInterface.php");
require("src/Utils.php");

函数

Inspections::all

检索所有检验类型(烟雾/安全检验)

$all = amattu2\Inspections::all("VIN", "STATE_ABBR");

VIN 是目标车辆的17位VIN号码。STATE_ABBR2位 ISO-3166-2 州缩写。

返回一个包含 EmissionsSafety 多维数组的数组。

Inspections::safety

检索所有州级安全(机械)检验报告。

PHPDoc

/**
 * A endpoint wrapper to return a structured state safety inspection search result
 * All return attributes are nullable, given that each state returns different information.
 *
 * @param string VIN number
 * @return array Array<Array<?bool result, ?string date, ?string url>, ...>
 * @return array Structured return result
 * @throws TypeError
 * @throws UnsupportedStateOperationException
 * @author Alec M. <https://amattu.com>
 * @date 2021-04-07T11:05:27-040
 */

用法

amattu2\Inspections::safety("VIN", "STATE_ABBR");

VIN 是目标车辆的17位VIN号码。STATE_ABBR2位 ISO-3166-2 州缩写。

返回以下数组

Array
(
  [0] => Array
  (
    [date] => ?string (Format: YYYY-MM-DD)
    [result] => ?bool
    [url] => ?string
  )
)

Inspections::emissions

获取车辆的排放记录。

PHPDoc

/**
 * A endpoint wrapper to return a structured state emissions test result
 * All return attributes are nullable, given that each state returns different information.
 *
 * @param string VIN number
 * @return array Array<Array<?string type, ?string date, ?bool result, ?string url>, ...>
 * @throws TypeError
 * @throws UnsupportedStateOperationException
 * @author Alec M. <https://amattu.com>
 * @date 2021-04-07T14:51:13-040
 */

用法

amattu2\Inspections::emissions("VIN", "STATE_ABBR")

VIN 是目标车辆的17位VIN号码。STATE_ABBR2位 ISO-3166-2 州缩写。

返回以下数组

Array
(
  [0] => Array
  (
    [date] => ?string (Format: YYYY-MM-DD)
    [result] => ?bool
    [type] => ?string
    [url] => ?string
  )
)

待办集成

与州级系统集成的潜在列表。这些需要高级解析或端点操作来获取信息。

安全检验

排放检验

备注

https://haynes.com/en-us/tips-tutorials/what-know-about-vehicle-inspections-all-50-states

需求与依赖

PHP 7+