diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3a9875b --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/vendor/ +composer.lock diff --git a/README.md b/README.md index ebcb391..eaa1286 100644 --- a/README.md +++ b/README.md @@ -30,10 +30,11 @@ Then you need a Context that explains a bit your working environment, something ```php use org\nameapi\ontology\input\context\Context; use org\nameapi\ontology\input\context\Priority; -use org\nameapi\ontology\input\context\TextCase; +use org\nameapi\client\services\ServiceFactory; + $context = Context::builder() ->apiKey('your-api-key') - ->priority(Priority::REALTIME) + ->priority(Priority::REALTIME()) ->build(); ``` @@ -172,6 +173,6 @@ The DEA-Detector checks email addresses against a list of known "trash domains" ```php $deaDetector = $serviceFactory->emailServices()->disposableEmailAddressDetector(); $result = $deaDetector->isDisposable("abcdefgh@10minutemail.com"); -echo $result->getDisposable()->toString()); //will print 'YES' +echo $result->getDisposable(); //will print 'YES' ``` diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..2dd6845 --- /dev/null +++ b/composer.json @@ -0,0 +1,14 @@ +{ + "name": "optimaize/nameapi-client-php", + "description": "PHP Client for the NameAPI Web Service", + "license": "LGPL-3.0", + "require": { + "php": ">=5.3.0" + }, + "autoload": { + "psr-4": { + "org\\": "src/org" + } + }, + "minimum-stability": "dev" +} diff --git a/index.php b/index.php new file mode 100644 index 0000000..e15904e --- /dev/null +++ b/index.php @@ -0,0 +1,21 @@ +apiKey(API_KEY) + ->priority(Priority::REALTIME()) + ->build(); + +$serviceFactory = new ServiceFactory($context); + +$deaDetector = $serviceFactory->emailServices()->disposableEmailAddressDetector(); +$result = $deaDetector->isDisposable(TEST_EMAIL); +echo $result->getDisposable();