Skip to content

Commit

Permalink
Change namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
DivineOmega committed Jan 28, 2019
1 parent c70460a commit fbfe2c8
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 33 deletions.
8 changes: 4 additions & 4 deletions Example.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

require_once 'vendor/autoload.php';
use RapidWeb\Postcodes\Objects\IdealPostcodes;
use RapidWeb\Postcodes\Objects\PostcodeAnywhere;
use RapidWeb\Postcodes\Utils\Generator;
use RapidWeb\Postcodes\Utils\Validator;
use DivineOmega\Postcodes\Objects\IdealPostcodes;
use DivineOmega\Postcodes\Objects\PostcodeAnywhere;
use DivineOmega\Postcodes\Utils\Generator;
use DivineOmega\Postcodes\Utils\Validator;

$postcode = Generator::generatePostcode();

Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# PHP Postcodes

[![Build Status](https://travis-ci.org/rapidwebltd/php-postcodes.svg?branch=master)](https://travis-ci.org/rapidwebltd/php-postcodes)
[![Coverage Status](https://coveralls.io/repos/github/rapidwebltd/php-postcodes/badge.svg?branch=master)](https://coveralls.io/github/rapidwebltd/php-postcodes?branch=master)
[![Build Status](https://travis-ci.org/divineomega/php-postcodes.svg?branch=master)](https://travis-ci.org/divineomega/php-postcodes)
[![Coverage Status](https://coveralls.io/repos/github/divineomega/php-postcodes/badge.svg?branch=master)](https://coveralls.io/github/divineomega/php-postcodes?branch=master)
[![StyleCI](https://styleci.io/repos/79115768/shield?branch=master)](https://styleci.io/repos/79115768)
![Packagist](https://img.shields.io/packagist/dt/rapidwebltd/php-postcodes.svg)
![Packagist](https://img.shields.io/packagist/dt/divineomega/php-postcodes.svg)

This library handles various UK postcode related tasks.

Expand All @@ -18,7 +18,7 @@ This library handles various UK postcode related tasks.

To install, just run the following composer command.

`composer require rapidwebltd/php-postcodes`
`composer require divineomega/php-postcodes`

## Setup

Expand All @@ -35,9 +35,9 @@ Sign up at the respective website if you need to use these features.
You can then use the following code to get an appropriate postcode lookup service object.

```php
$postcodeLookupService = new \RapidWeb\Postcodes\Objects\IdealPostcodes('API_KEY');
$postcodeLookupService = new \DivineOmega\Postcodes\Objects\IdealPostcodes('API_KEY');
// OR
$postcodeLookupService = new \RapidWeb\Postcodes\Objects\PostcodeAnywhere('API_KEY');
$postcodeLookupService = new \DivineOmega\Postcodes\Objects\PostcodeAnywhere('API_KEY');
```

## Usage
Expand All @@ -57,7 +57,7 @@ You can validate a UK postcode is correct using the `Validator` utility class. A
how to do so is shown below.

```php
$validated = \RapidWeb\Postcodes\Utils\Validator::validatePostcode('ST163DP');
$validated = \DivineOmega\Postcodes\Utils\Validator::validatePostcode('ST163DP');
```

Please note that the postcode validation is case insensitive.
Expand All @@ -68,14 +68,14 @@ This library allows you generate a random, valid UK postcode. This makes use of
`Generator` utility class, as shown below.

```php
$postcode = \RapidWeb\Postcodes\Utils\Generator::generatePostcode();
$postcode = \DivineOmega\Postcodes\Utils\Generator::generatePostcode();
```

### Get outward and inward codes

> The first part of the Postcode eg PO1 is called the outward code as it identifies the town or district to which the letter is to be sent for further sorting. The second part of the postcode eg 1EB is called the inward code.
```php
$outwardCode = \RapidWeb\Postcodes\Utils\Tokenizer::outward('ST163JR'); // Returns ST16
$inwardCode = \RapidWeb\Postcodes\Utils\Tokenizer::inward('ST163JR'); // Returns 3JR
$outwardCode = \DivineOmega\Postcodes\Utils\Tokenizer::outward('ST163JR'); // Returns ST16
$inwardCode = \DivineOmega\Postcodes\Utils\Tokenizer::inward('ST163JR'); // Returns 3JR
```
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "rapidwebltd/php-postcodes",
"name": "divineomega/php-postcodes",
"type": "library",
"description": "This library handles various UK postcode related tasks such as address lookup by postcode, postcode validation, generation of valid UK postcodes and getting a postcode's outward and inward codes.",
"keywords": ["postcodes", "PHP", "PHP library", "PHP postcodes library", "PHP postcodes"],
"homepage": "https://github.com/rapidwebltd/php-postcodes",
"homepage": "https://github.com/divineomega/php-postcodes",
"license": "LGPL-3.0-only",
"require": {
"php": ">=5.5.9",
Expand All @@ -13,11 +13,11 @@
"require-dev": {
"phpunit/phpunit": "^5.7",
"fzaninotto/faker": "^1.6",
"satooshi/php-coveralls": "^2.0"
"php-coveralls/php-coveralls": "^2.0"
},
"autoload": {
"psr-4": {
"RapidWeb\\Postcodes\\": "src/"
"DivineOmega\\Postcodes\\": "src/"
}
}
}
2 changes: 1 addition & 1 deletion src/Exceptions/InvalidPostcodeException.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace RapidWeb\Postcodes\Exceptions;
namespace DivineOmega\Postcodes\Exceptions;

class InvalidPostcodeException extends \Exception
{
Expand Down
2 changes: 1 addition & 1 deletion src/Interfaces/PostcodeServiceInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace RapidWeb\Postcodes\Interfaces;
namespace DivineOmega\Postcodes\Interfaces;

interface PostcodeServiceInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Objects/Address.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace RapidWeb\Postcodes\Objects;
namespace DivineOmega\Postcodes\Objects;

class Address
{
Expand Down
4 changes: 2 additions & 2 deletions src/Objects/IdealPostcodes.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php

namespace RapidWeb\Postcodes\Objects;
namespace DivineOmega\Postcodes\Objects;

use Exception;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Response;
use RapidWeb\Postcodes\Interfaces\PostcodeServiceInterface;
use DivineOmega\Postcodes\Interfaces\PostcodeServiceInterface;

class IdealPostcodes implements PostcodeServiceInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/Objects/PostcodeAnywhere.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace RapidWeb\Postcodes\Objects;
namespace DivineOmega\Postcodes\Objects;

use Exception;
use RapidWeb\Postcodes\Interfaces\PostcodeServiceInterface;
use DivineOmega\Postcodes\Interfaces\PostcodeServiceInterface;
use SoapClient;

class PostcodeAnywhere implements PostcodeServiceInterface
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/Generator.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace RapidWeb\Postcodes\Utils;
namespace DivineOmega\Postcodes\Utils;

use Faker\Factory as FakerFactory;

Expand Down
4 changes: 2 additions & 2 deletions src/Utils/Tokenizer.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace RapidWeb\Postcodes\Utils;
namespace DivineOmega\Postcodes\Utils;

use RapidWeb\Postcodes\Exceptions\InvalidPostcodeException;
use DivineOmega\Postcodes\Exceptions\InvalidPostcodeException;

abstract class Tokenizer
{
Expand Down
2 changes: 1 addition & 1 deletion src/Utils/Validator.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace RapidWeb\Postcodes\Utils;
namespace DivineOmega\Postcodes\Utils;

abstract class Validator
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Unit/BasicUsageTest.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

use PHPUnit\Framework\TestCase;
use RapidWeb\Postcodes\Exceptions\InvalidPostcodeException;
use RapidWeb\Postcodes\Utils\Generator;
use RapidWeb\Postcodes\Utils\Tokenizer;
use RapidWeb\Postcodes\Utils\Validator;
use DivineOmega\Postcodes\Exceptions\InvalidPostcodeException;
use DivineOmega\Postcodes\Utils\Generator;
use DivineOmega\Postcodes\Utils\Tokenizer;
use DivineOmega\Postcodes\Utils\Validator;

final class BasicUsageTest extends TestCase
{
Expand Down

0 comments on commit fbfe2c8

Please sign in to comment.