Skip to content

Latest commit

 

History

History
54 lines (34 loc) · 1.12 KB

README.md

File metadata and controls

54 lines (34 loc) · 1.12 KB

Advantage Connector

An interface to a custom API developed by World News Group to communicate with Advantage software.

Installing via Composer

Only Composer (v2.0) is support at this time.

Add the following in your composer.json:

...
"repositories": [
    {
        "type": "vcs",
        "url": "<Git url to project>
    }
]
...

Then require the library in composer:

composer require world-news-group/advantage-connector

Code Use

Firstly, add the appropriate require and use statement (goes something like this):

require('vendor/autoload.php');

use WorldNewsGroup\Advantage\AdvantageConnector;

Secondary, configure the environment the connector will use:

AdvantageConnector::configure($api_key, $endpoint);

AdvantageConnector::getCustomer('999999999');

All results are returned as SQL queries, so column names often won't match up with the "official" Advantage API.

Development/Testing

Each read-only method has a test built for regression testing.

./vendor/bin/phpunit ./tests

We like (should) to meet phpstan level 3 compatibility

./vendor/bin/phpstan analyze ./src -l 3