2017 © Pedro Peláez
 

library sdk

SDK for DVLA Search

image

dvlasearch/sdk

SDK for DVLA Search

  • Tuesday, May 16, 2017
  • by connorjburton
  • Repository
  • 1 Watchers
  • 2 Stars
  • 157 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 10 Versions
  • 1 % Grown

The README.md

Code Climate Test Coverage Build Status, (*1)

DVLA Search PHP SDK

PHP SDK for DVLASearch API, (*2)

Requirements

  • PHP >=7.0.0

Installation

composer require dvlasearch/sdk, (*3)

Usage

Each request will return an object of the related request, this object will have methods to request other information about the same vehicle., (*4)

The library will throw an exception if it encounters an error from the API., (*5)

Vehicle Client

<?php

use DVLASearch\SDK\Clients\Vehicle;

$client = new Vehicle('API KEY HERE');
$vehicle = $client->get('MT09 VCA');

// $vehicle->error will be set if the number plate isn't attached to a vehicle
if(!isset($vehicle->error)) {
  var_dump($vehicle);
} else {
  var_dump('No vehicle found for ' . $vehicle->plate);
}

Returns on success, (*6)

Vehicle {#348 ▼
  -key: "DvlaSearchDemoAccount"
  +plate: "mt09vca"
  +"make": "SAAB"
  +"dateOfFirstRegistration": "27 July 2009"
  +"yearOfManufacture": "2009"
  +"cylinderCapacity": "1910cc"
  +"co2Emissions": "177 g/km"
  +"fuelType": "DIESEL"
  +"taxStatus": "Tax not due"
  +"colour": "GREY"
  +"typeApproval": "M1"
  +"wheelPlan": "2 AXLE RIGID BODY"
  +"revenueWeight": "Not available"
  +"taxDetails": "Tax due: 01 October 2016"
  +"motDetails": "Expires: 02 October 2016"
  +"taxed": true
  +"mot": true
  +"vin": "YS3FF41W391018057"
  +"model": "9-3 VECTOR S ANNIVERSARY LTD TID"
  +"transmission": "AUTOMATIC"
  +"numberOfDoors": "4"
  +"sixMonthRate": ""
  +"twelveMonthRate": ""
}

Returns on error, (*7)

Vehicle {#348 ▼
  -key: "DvlaSearchDemoAccount"
  +plate: "mt09vca"
  +"message": "No vehicle found"
  +"error": 0
}

Methods

mot(), (*8)

Returns mot data for that vehicle, (*9)

$vehicle->mot();

tyres(), (*10)

Returns tyre data for that vehicle, (*11)

$vehicle->tyres();

MOT Client

<?php

use DVLASearch\SDK\Clients\Mot;

$client = new Mot('API KEY HERE');
$mot = $client->get('MT09 VCA');

// $vehicle->error will be set if the number plate isn't attached to a vehicle
if(!isset($mot->error)) {
  var_dump($mot);
} else {
  var_dump('No MOT found for ' . $mot->plate);
}

Returns on success, (*12)

Mot {#380 ▼
  -key: "DvlaSearchDemoAccount"
  +plate: "mt09vca"
  +"make": "SAAB"
  +"model": "9-3 VECTOR S ANNIVERSARY LTD TID"
  +"dateFirstUsed": ""
  +"colour": "GREY"
  +"motTestReports": array:5 [▶]
}

Returns on error, (*13)

Mot {#380 ▼
  -key: "DvlaSearchDemoAccount"
  +"plate": "mt09vca"
  +"message": "No vehicle found"
  +"error": 0
}

Methods

vehicle(), (*14)

Returns the vehicle the mot data relates to, (*15)

$vehicle->vehicle();

tyres(), (*16)

Returns tyre data for the vehicle the mot data relates to, (*17)

$vehicle->tyres();

Tyres Client

<?php

use DVLASearch\SDK\Clients\Tyres;

$client = new Tyres('API KEY HERE');
$tyres = $client->get('MT09 VCA');

// $vehicle->error will be set if the number plate isn't attached to a vehicle
if(!isset($tyres->error)) {
  var_dump($tyres);
} else {
  var_dump('No MOT found for ' . $tyres->plate);
}

Returns on success, (*18)

Tyres {#381 ▼
  -key: "DvlaSearchDemoAccount"
  +plate: "mt09vca"
  +"make": "SAAB"
  +"model": "9-3 VECTOR S ANNIVERSARY LTD TID"
  +"year": 2009
  +"frontTyres": array:3 [▶]
  +"rearTyres": array:3 [▶]
}

Returns on error, (*19)

Tyres {#381 ▼
  -key: "DvlaSearchDemoAccount"
  +"plate": "mt09vca"
  +"message": "No vehicle found"
  +"error": 0
}

Methods

vehicle(), (*20)

Returns the vehicle the tyre data relates to, (*21)

$tyres->vehicle();

mot(), (*22)

Returns mot data for the vehicle the tyre data relates to, (*23)

$tyres->mot();

Running Tests

phpunit, (*24)

The Versions

16/05 2017

dev-master

9999999-dev

SDK for DVLA Search

  Sources   Download

MIT

The Development Requires

by Connor Burton

16/05 2017

v0.6.0

0.6.0.0

SDK for DVLA Search

  Sources   Download

MIT

The Development Requires

by Connor Burton

18/08 2016

v0.5.0

0.5.0.0

SDK for DVLA Search

  Sources   Download

MIT

The Development Requires

by Connor Burton

17/08 2016

v0.4.0

0.4.0.0

SDK for DVLA Search

  Sources   Download

MIT

The Development Requires

by Connor Burton

17/08 2016

v0.3.0

0.3.0.0

SDK for DVLA Search

  Sources   Download

MIT

The Development Requires

by Connor Burton

16/08 2016

v0.2.1

0.2.1.0

SDK for DVLA Search

  Sources   Download

MIT

The Development Requires

by Connor Burton

16/08 2016

v0.2.0

0.2.0.0

SDK for DVLA Search

  Sources   Download

MIT

The Development Requires

by Connor Burton

04/08 2016

v0.1.1

0.1.1.0

SDK for DVLA Search

  Sources   Download

MIT

The Development Requires

by Connor Burton

02/08 2016

dev-develop

dev-develop

SDK for DVLA Search

  Sources   Download

MIT

by Connor Burton

02/08 2016

v0.1.0

0.1.0.0

SDK for DVLA Search

  Sources   Download

MIT

by Connor Burton