Skip to content

Commit 50e3485

Browse files
committed
Add composer support, cleanup codebase
1 parent 28f01a0 commit 50e3485

16 files changed

+641
-446
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ __pycache__/
55

66
# File Types
77
*.ini
8+
9+
/vendor/

README.md

Lines changed: 69 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,66 @@
11
# Introduction
2+
23
This is a basic library/wrapper for digital vehicle state safety/emissions inspection record lookups. If you need to check the last date(s) a vehicle was state inspected, and you know the state, this library is for you. A few states also support returning information on the last emissions/smog test. Originally designed for integration within a automotive service management SaaS application.
34

45
# States Supported
5-
|State|Supported Operations|Notes|
6-
|:-:|:-|:-|
7-
|Maryland|[Emissions/Smog](http://mva.mdveip.com/), [Safety](https://egov.maryland.gov/msp/vsi/api/Lookup/Inspections?vehicleVin=)|Pending further tests, but it appears that MD only keeps the e-inspection record until it expires (6 months)|
6+
7+
| State | Supported Operations | Notes |
8+
| :------: | :----------------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------- |
9+
| Maryland | [Emissions/Smog](http://mva.mdveip.com/), [Safety](https://egov.maryland.gov/msp/vsi/api/Lookup/Inspections?vehicleVin=) | Pending further tests, but it appears that MD only keeps the e-inspection record until it expires (6 months) |
810

911
# Usage
10-
### Files
11-
Import the three core files
12+
13+
## Install
14+
15+
Using composer
16+
17+
```BASH
18+
composer require amattu2/state-inspection-lookup
19+
```
20+
21+
Manually
22+
23+
```BASH
24+
git clone https://github.com/amattu2/state-inspection-lookup
25+
```
26+
27+
## Files
28+
29+
Composer: Import the autoload
30+
1231
```PHP
13-
require("classes/Inspections.class.php");
14-
require("classes/StateInspection.class.php");
15-
require("interfaces/StateInspection.interface.php");
32+
require("vendor/autoload.php");
1633
```
1734

18-
Then import the state (or states) file
35+
Manually: Import the core files
36+
1937
```PHP
20-
require("classes/states/MD.class.php");
38+
require("src/Inspections.php");
39+
require("src/StateInspectionBase.php");
40+
require("src/StateInspectionInterface.php");
41+
require("src/Utils.php");
2142
```
2243

23-
### Functions
24-
##### Inspections::all
44+
## Functions
45+
46+
### Inspections::all
47+
2548
Retrieve all inspection types (smog/safety inspections)
49+
2650
```PHP
27-
$all = amattu\Inspections::all("VIN", "STATE_ABBR");
51+
$all = amattu2\Inspections::all("VIN", "STATE_ABBR");
2852
```
2953

30-
`VIN` is the 17 digit VIN number of the vehicle of interest. `STATE_ABBR` is the *2 digit* [ISO-3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) state abbreviation.
54+
`VIN` is the 17 digit VIN number of the vehicle of interest. `STATE_ABBR` is the _2 digit_ [ISO-3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) state abbreviation.
3155

3256
Returns an array containing `Emissions`, `Safety` multi-dimensional arrays.
3357

34-
##### Inspections::safety
58+
### Inspections::safety
59+
3560
Retrieve all state safety (mechanical) inspection reports.
3661

3762
PHPDoc
63+
3864
```PHP
3965
/**
4066
* A endpoint wrapper to return a structured state safety inspection search result
@@ -51,13 +77,15 @@ PHPDoc
5177
```
5278

5379
Usage
80+
5481
```PHP
55-
amattu\Inspections::safety("VIN", "STATE_ABBR");
82+
amattu2\Inspections::safety("VIN", "STATE_ABBR");
5683
```
5784

58-
`VIN` is the 17 digit VIN number of the vehicle of interest. `STATE_ABBR` is the *2 digit* [ISO-3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) state abbreviation.
85+
`VIN` is the 17 digit VIN number of the vehicle of interest. `STATE_ABBR` is the _2 digit_ [ISO-3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) state abbreviation.
5986

6087
Returns the following array:
88+
6189
```PHP
6290
Array
6391
(
@@ -70,10 +98,12 @@ Array
7098
)
7199
```
72100

73-
##### Inspections::emissions
101+
### Inspections::emissions
102+
74103
Pull all emissions records for a vehicle.
75104

76105
PHPDoc
106+
77107
```PHP
78108
/**
79109
* A endpoint wrapper to return a structured state emissions test result
@@ -89,13 +119,15 @@ PHPDoc
89119
```
90120

91121
Usage
122+
92123
```PHP
93-
amattu\Inspections::emissions("VIN", "STATE_ABBR")
124+
amattu2\Inspections::emissions("VIN", "STATE_ABBR")
94125
```
95126

96-
`VIN` is the 17 digit VIN number of the vehicle of interest. `STATE_ABBR` is the *2 digit* [ISO-3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) state abbreviation.
127+
`VIN` is the 17 digit VIN number of the vehicle of interest. `STATE_ABBR` is the _2 digit_ [ISO-3166-2](https://en.wikipedia.org/wiki/ISO_3166-2:US) state abbreviation.
97128

98129
Returns the following array:
130+
99131
```PHP
100132
Array
101133
(
@@ -110,24 +142,28 @@ Array
110142
```
111143

112144
# To-Do Integrations
145+
113146
A list of potential integrations with state systems. These require advanced parsing or endpoint manipulation to grab the information.
114147

115-
### Safety Inspections
116-
|State|Portal|
117-
|:-|:-:|
118-
|Delaware|[Link](https://dealers.dmv.de.gov/Dealer/VehicleInspection/citizeninspection)|
119-
|California|[Link](https://www.bar.ca.gov/services/Vehicle/PubTstQry.aspx)|
120-
|Virginia|[Link](https://www.virginiavip.org/PublicSite/Pages/VehicleLookup.aspx)|
121-
|Georgia|[Link](https://www.cleanairforce.com/motorists/vir-reprints)|
122-
|Texas|[Link](https://mytxcar.org/txcar_net/SearchVehicleTestHistory.aspx)|
148+
## Safety Inspections
123149

124-
### Emissions Inspections
125-
|State|Portal|
126-
|:-|:-:|
150+
| State | Portal |
151+
| :--------- | :---------------------------------------------------------------------------: |
152+
| Delaware | [Link](https://dealers.dmv.de.gov/Dealer/VehicleInspection/citizeninspection) |
153+
| California | [Link](https://www.bar.ca.gov/services/Vehicle/PubTstQry.aspx) |
154+
| Virginia | [Link](https://www.virginiavip.org/PublicSite/Pages/VehicleLookup.aspx) |
155+
| Georgia | [Link](https://www.cleanairforce.com/motorists/vir-reprints) |
156+
| Texas | [Link](https://mytxcar.org/txcar_net/SearchVehicleTestHistory.aspx) |
157+
158+
## Emissions Inspections
159+
160+
| State | Portal |
161+
| :---- | :----: |
127162

128163
# Notes
129-
https://haynes.com/en-us/tips-tutorials/what-know-about-vehicle-inspections-all-50-states
130164

165+
<https://haynes.com/en-us/tips-tutorials/what-know-about-vehicle-inspections-all-50-states>
131166

132167
# Requirements & Dependencies
133-
PHP 7
168+
169+
PHP 7+

0 commit comments

Comments
 (0)