addresses-and-postcodes/lookup-php-sdk

Addresses and Postcodes - Lookup PHP SDK

dev-develop 2022-09-03 12:47 UTC

This package is not auto-updated.

Last update: 2024-11-11 21:42:22 UTC


README



GitHub

About

This is the official PHP SDK for the Addresses and Postcodes API. It provides a way to list coordinates to produce a polygon and such.

Requirements

Install

Via Composer:

$ composer require addresses-and-postcodes/lookup-php-sdk

Basic usage of Addresses-Postcodes-PHP-SDK client

<?php

// This file is generated by Composer
require_once __DIR__ . '/vendor/autoload.php';

$client = new AddressesAndPostcodes\Lookup\PHP\SDK\Client('API_KEY');
$response = $client->boundaries()->getAreaBoundaryPath('AB');

Tests

WARNING: Before running the tests, please add your api key in tests/TestCase.php

<?php

namespace AddressesAndPostcodes\Lookup\PHP\SDK\Tests;

use AddressesAndPostcodes\Lookup\PHP\SDK\Client;

abstract class TestCase extends \PHPUnit\Framework\TestCase
{
    protected function client(): Client
    {
        return new Client('API_KEY');
    }
}

To run the tests, go to the root folder of the project in terminal and run the following command:

$ composer tests

Documentation

See the doc directory for more detailed documentation.

License

Licensed under the MIT license, see LICENSE