repat/ham-radio

Amateur Radio Call Signs Verification

0.1 2019-08-31 04:12 UTC

README

Latest Version on Packagist Total Downloads

ham-radio is a library for quickly validating the format of a call sign by the rules of the country and also run a check against the official public database, e.g. by the FCC in the US.

Installation

$ composer require repat/ham-radio

Example

$us = new US;
$us->verifyCallSign('KN6DZC');
// returns: [
//     "Response" => [
//       "Licenses" => [
//         "License" => [
//           "licName" => "...."

$us ->validateCallSign('KN6DZC');
// returns: true

Supported Countries

  • US

Contribute

  1. Fork the project
  2. Create a new class that extends Helper
  3. Name the class after the ISO3166 country code
  4. Add a function regex() : string that returns a regular expression to validate the call sign format.
  5. Add a function verifyCallSign(string $callSign) : array. With $this->client you get a GuzzleHttp client for making API calls. I also pulled in repat/http-constants for checking HTTP status codes in the response. In case the API returns XML, check out $this->xml2array(). A json response could be returned by json_decode($response, true).

License

Version

  • Version 0.1

Contact

repat

Flattr this git repo