Skip to content

Commit

Permalink
Add usage section
Browse files Browse the repository at this point in the history
  • Loading branch information
amattu2 committed Apr 8, 2021
1 parent bf10e8b commit fcfc931
Showing 1 changed file with 102 additions and 2 deletions.
104 changes: 102 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,112 @@ This is a basic library/wrapper for digital vehicle state safety/emissions inspe
|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)|

# Usage
TDB
### Files
Import the three core files
```PHP
require("classes/Inspections.class.php");
require("classes/StateInspection.class.php");
require("interfaces/StateInspection.interface.php");
```

Then import the state (or states) file
```PHP
require("classes/states/MD.class.php");
```

### Functions
##### Inspections::all
Retrieve all inspection types (smog/safety inspections)
```PHP
$all = amattu\Inspections::all("VIN", "STATE_ABBR");
```

`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.

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

##### Inspections::safety
Retrieve all state safety (mechanical) inspection reports.

PHPDoc
```PHP
/**
* 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
*/
```

Usage
```PHP
amattu\Inspections::safety("VIN", "STATE_ABBR");
```

`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.

Returns the following array:
```PHP
Array
(
[0] => Array
(
[date] => ?string (Format: YYYY-MM-DD)
[result] => ?bool
[url] => ?string
)
)
```

##### Inspections::emissions
Pull all emissions records for a vehicle.

PHPDoc
```PHP
/**
* 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
*/
```

Usage
```PHP
amattu\Inspections::emissions("VIN", "STATE_ABBR")
```

`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.

Returns the following array:
```PHP
Array
(
[0] => Array
(
[date] => ?string (Format: YYYY-MM-DD)
[result] => ?bool
[type] => ?string
[url] => ?string
)
)
```

# To-Do Integrations
### Safety Inspections
A list of potential integrations with state systems. These require advanced parsing or endpoint manipulation to grab the information.

### Safety Inspections
|State|Portal|
|:-|:-:|
|Delaware|[Link](https://dealers.dmv.de.gov/Dealer/VehicleInspection/citizeninspection)|
Expand Down

0 comments on commit fcfc931

Please sign in to comment.