PHP code example of amattu2 / state-inspection-lookup

1. Go to this page and download the library: Download amattu2/state-inspection-lookup library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

amattu2 / state-inspection-lookup example snippets






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

/**
 * 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");

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

/**
 * 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")

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