Skip to content

Commit 8e5240f

Browse files
Initial commit
0 parents  commit 8e5240f

12 files changed

+453
-0
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
vendor
2+
build
3+
.DS_Store
4+
composer.lock
5+
index.php
6+
.env
7+
.env.example

.travis.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
language: php
2+
3+
php:
4+
- 5.6
5+
- 7.0
6+
- hhvm
7+
8+
matrix:
9+
allow_failures:
10+
- php: hhvm
11+
12+
install: travis_retry composer install --no-interaction --prefer-source
13+
14+
script:
15+
- mkdir -p build/logs
16+
- php vendor/bin/phpunit -c phpunit.xml.dist
17+
- phpunit --coverage-text --coverage-clover=coverage.clover
18+
- phpunit --coverage-clover build/logs/clover.xml
19+
20+
after_script:
21+
- wget https://scrutinizer-ci.com/ocular.phar
22+
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
23+
- travis_retry php vendor/bin/coveralls -v
24+
25+
notifications:
26+
slack: red-creek:5lI8ybvl6YTcCNPosh4TE13h

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
All Notable changes to `mvrd` will be documented in this file
4+
5+
## 2016-04-18
6+
- Initial release

CONTRIBUTING.md

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
We accept contributions via Pull Requests on [Github](https://github.com/unicodeveloper/jusibe-php-lib).
6+
7+
8+
## Pull Requests
9+
10+
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
11+
12+
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
13+
14+
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
15+
16+
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
17+
18+
- **Create feature branches** - Don't ask us to pull from your master branch.
19+
20+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
21+
22+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
23+
24+
25+
## Running Tests
26+
27+
``` bash
28+
$ composer test
29+
```
30+
31+
32+
**Happy coding**!

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# The MIT License (MIT)
2+
3+
Copyright (c) 2015 Prosper Otemuyiwa <[email protected]>
4+
5+
> Permission is hereby granted, free of charge, to any person obtaining a copy
6+
> of this software and associated documentation files (the "Software"), to deal
7+
> in the Software without restriction, including without limitation the rights
8+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
> copies of the Software, and to permit persons to whom the Software is
10+
> furnished to do so, subject to the following conditions:
11+
>
12+
> The above copyright notice and this permission notice shall be included in
13+
> all copies or substantial portions of the Software.
14+
>
15+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
> THE SOFTWARE.

README.md

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
# Mvrd library - Grab all the Nigerian Vehicles Data!!!
2+
3+
[![Latest Stable Version](https://poser.pugx.org/unicodeveloper/jusibe-php-lib/v/stable.svg)](https://packagist.org/packages/unicodeveloper/jusibe-php-lib)
4+
[![License](https://poser.pugx.org/unicodeveloper/jusibe-php-lib/license.svg)](LICENSE.md)
5+
![](https://img.shields.io/badge/unicodeveloper-approved-brightgreen.svg)
6+
[![Build Status](https://img.shields.io/travis/unicodeveloper/jusibe-php-lib.svg)](https://travis-ci.org/unicodeveloper/jusibe-php-lib)
7+
[![Coveralls](https://img.shields.io/coveralls/unicodeveloper/jusibe-php-lib/master.svg)](https://coveralls.io/github/unicodeveloper/jusibe-php-lib?branch=master)
8+
[![Quality Score](https://img.shields.io/scrutinizer/g/unicodeveloper/jusibe-php-lib.svg?style=flat-square)](https://scrutinizer-ci.com/g/unicodeveloper/jusibe-php-lib)
9+
[![Total Downloads](https://img.shields.io/packagist/dt/unicodeveloper/jusibe-php-lib.svg?style=flat-square)](https://packagist.org/packages/unicodeveloper/jusibe-php-lib)
10+
11+
> Jusibe Library for PHP
12+
13+
## Installation
14+
15+
[PHP](https://php.net) 5.4+ or [HHVM](http://hhvm.com) 3.3+, and [Composer](https://getcomposer.org) are required.
16+
17+
To get the latest version of mvrd, simply add the following line to the require block of your `composer.json` file.
18+
19+
```
20+
"unicodeveloper/mvrd": "1.0.*"
21+
```
22+
23+
You'll then need to run `composer install` or `composer update` to download it and have the autoloader updated.
24+
25+
26+
## Usage
27+
28+
Available methods for use right now are:
29+
```php
30+
31+
/**
32+
* Get Vehicle Details
33+
* @param none
34+
* @return array
35+
*/
36+
$mvrd->getData();
37+
```
38+
39+
### Send an SMS
40+
41+
```php
42+
43+
<?php
44+
45+
// include your composer dependencies
46+
require_once 'vendor/autoload.php';
47+
48+
use Unicodeveloper\Mvrd\Mvrd;
49+
50+
$plateNumber = 'xxxxxxxxxxxxxx';
51+
52+
$mvrd = new Mvrd($plateNumber);
53+
$mvrd->getData();
54+
55+
```
56+
57+
**Response**
58+
59+
![SendSMS Response](https://cloud.githubusercontent.com/assets/2946769/14465033/451179c4-00c9-11e6-881e-bcc92665fa7c.png)
60+
61+
### Check SMS Credits
62+
63+
```php
64+
65+
<?php
66+
67+
// include your composer dependencies
68+
require_once 'vendor/autoload.php';
69+
70+
use Unicodeveloper\Jusibe\Jusibe;
71+
72+
$publicKey = 'xxxxxxxxxxxxxx';
73+
$accessToken = 'xxxxxxxxxxxxxx';
74+
75+
$jusibe = new Jusibe($publicKey, $accessToken);
76+
77+
try {
78+
$response = $jusibe->checkAvailableCredits()->getResponse();
79+
print_r($response);
80+
} catch(Exception $e) {
81+
echo $e->getMessage();
82+
}
83+
84+
```
85+
86+
**Response Info for Developer**
87+
88+
![Check SMS Credits Response](https://cloud.githubusercontent.com/assets/2946769/14465412/d15361f8-00ca-11e6-8145-7cb8cd2b46d0.png)
89+
90+
### Check Delivery Status
91+
92+
```php
93+
94+
<?php
95+
96+
// include your composer dependencies
97+
require_once 'vendor/autoload.php';
98+
99+
use Unicodeveloper\Jusibe\Jusibe;
100+
101+
$publicKey = 'xxxxxxxxxxxxxx';
102+
$accessToken = 'xxxxxxxxxxxxxx';
103+
104+
$jusibe = new Jusibe($publicKey, $accessToken);
105+
106+
try {
107+
$response = $jusibe->checkDeliveryStatus('8nb1wrgdjw')->getResponse();
108+
print_r($response);
109+
} catch(Exception $e) {
110+
echo $e->getMessage();
111+
}
112+
113+
```
114+
115+
**Response Info for Developer**
116+
117+
![Check Delivery Status Response](https://cloud.githubusercontent.com/assets/2946769/14465686/bb61e3d2-00cb-11e6-9164-ec73665408f3.png)
118+
119+
## Contributing
120+
121+
Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.
122+
123+
## How can I thank you?
124+
125+
Why not star the github repo? I'd love the attention! Why not share the link for this repository on Twitter or HackerNews? Spread the word!
126+
127+
Don't forget to [follow me on twitter](https://twitter.com/unicodeveloper)!
128+
129+
Thanks!
130+
Prosper Otemuyiwa.
131+
132+
## License
133+
134+
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

composer.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "unicodeveloper/mvrd",
3+
"description": "Unofficial Motor Vehicle Registration Information Search Portal Library",
4+
"keywords": ["php","api","motor","nigeria"],
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "unicodeveloper",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"minimum-stability": "stable",
13+
"require": {
14+
"php" : "^5.4|^7.0",
15+
"guzzlehttp/guzzle": "5.*|6.*",
16+
"symfony/dom-crawler": "^3.2",
17+
"symfony/css-selector": "^2.8",
18+
"vlucas/phpdotenv": "^2.2"
19+
},
20+
"require-dev": {
21+
"phpunit/phpunit" : "4.*",
22+
"scrutinizer/ocular": "~1.1",
23+
"satooshi/php-coveralls": "^0.7.0",
24+
"mockery/mockery": "^0.9.4"
25+
},
26+
"autoload": {
27+
"psr-4": {
28+
"Unicodeveloper\\Mvrd\\": "src/"
29+
}
30+
},
31+
"autoload-dev": {
32+
"psr-4": {
33+
"Unicodeveloper\\Mvrd\\Test\\": "tests"
34+
}
35+
},
36+
"scripts": {
37+
"test": "vendor/bin/phpunit"
38+
}
39+
}

phpunit.xml.dist

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit bootstrap="vendor/autoload.php"
3+
backupGlobals="false"
4+
backupStaticAttributes="false"
5+
colors="true"
6+
verbose="true"
7+
convertErrorsToExceptions="true"
8+
convertNoticesToExceptions="true"
9+
convertWarningsToExceptions="true"
10+
processIsolation="false"
11+
stopOnFailure="false">
12+
<testsuites>
13+
<testsuite name="jusibe-php-lib Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
<filter>
18+
<whitelist>
19+
<directory suffix=".php">src/</directory>
20+
</whitelist>
21+
</filter>
22+
<logging>
23+
<log type="tap" target="build/report.tap"/>
24+
<log type="junit" target="build/report.junit.xml"/>
25+
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
26+
<log type="coverage-text" target="build/coverage.txt"/>
27+
<log type="coverage-clover" target="build/logs/clover.xml"/>
28+
<log type="coverage-php" target="build/cov/coverage.cov"/>
29+
</logging>
30+
</phpunit>

src/Exceptions/IsEmpty.php

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Jusibe PHP library.
5+
*
6+
* (c) Prosper Otemuyiwa <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Unicodeveloper\Mvrd\Exceptions;
13+
14+
use Exception;
15+
16+
class IsEmpty extends Exception
17+
{
18+
public static function create($message)
19+
{
20+
return new static("{$message}");
21+
}
22+
}

src/Exceptions/IsNull.php

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Jusibe PHP library.
5+
*
6+
* (c) Prosper Otemuyiwa <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Unicodeveloper\Mvrd\Exceptions;
13+
14+
use Exception;
15+
16+
class IsNull extends Exception
17+
{
18+
public static function create($message)
19+
{
20+
return new static("{$message}");
21+
}
22+
}

0 commit comments

Comments
 (0)