diff --git a/examples/Connection/http_connect.php b/examples/Connection/http_connect.php index 9395e6f..0cf1b24 100644 --- a/examples/Connection/http_connect.php +++ b/examples/Connection/http_connect.php @@ -8,9 +8,9 @@ require '../../vendor/autoload.php'; -use AfriCC\EPP\HTTPClient as EPPClient; -use \AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; use AfriCC\EPP\Frame\Command\Poll; +use AfriCC\EPP\HTTPClient as EPPClient; $objectSpec = new NASKObjectSpec(); $config = [ @@ -38,22 +38,22 @@ $response = $epp_client->request($frame); - while($response->success() && $response->code() !== 1300 ){ // 1300 = result successful, no more mesages + while ($response->success() && $response->code() !== 1300) { // 1300 = result successful, no more mesages - echo "Epp Poll message ID: "; + echo 'Epp Poll message ID: '; echo $response->queueId(); echo "\n"; - echo "Epp Poll Message: "; + echo 'Epp Poll Message: '; echo $response->queueMessage(); $ackFrame = new Poll($epp_client->getObjectSpec()); $ackFrame->ack($response->queueId()); $ackResponse = $epp_client->request($ackFrame); - if(!$ackResponse->success()){ + if (!$ackResponse->success()) { echo "Couldn't ACK poll message\n"; break; // no ack! } - $response= $client->request($frame); //reuse already existing poll request frame + $response = $client->request($frame); //reuse already existing poll request frame } } catch (Exception $e) { echo $e->getMessage() . PHP_EOL; diff --git a/examples/Extension/NASK/renew_future.php b/examples/Extension/NASK/renew_future.php index b513d26..862ef78 100644 --- a/examples/Extension/NASK/renew_future.php +++ b/examples/Extension/NASK/renew_future.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Renew\Future as RenewFuture; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Renew\Future as RenewFuture; $frame = new RenewFuture(new NASKObjectSpec()); $frame->setFuture('example.pl'); diff --git a/examples/Extension/NASK/report_basic.php b/examples/Extension/NASK/report_basic.php index 749cd54..48ce403 100644 --- a/examples/Extension/NASK/report_basic.php +++ b/examples/Extension/NASK/report_basic.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Report; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Report; $frame = new Report(new NASKObjectSpec()); $frame->setOffset(0); diff --git a/examples/Extension/NASK/report_cancel.php b/examples/Extension/NASK/report_cancel.php index 02744b1..025d640 100644 --- a/examples/Extension/NASK/report_cancel.php +++ b/examples/Extension/NASK/report_cancel.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Report\Cancel as ReportCancel; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Report\Cancel as ReportCancel; $frame = new ReportCancel(new NASKObjectSpec()); $frame->setReportId('e264a95d-0ba0-40f1-a0e0-97407fd5cdbe'); diff --git a/examples/Extension/NASK/report_contact.php b/examples/Extension/NASK/report_contact.php index 06e5166..2ef71b0 100644 --- a/examples/Extension/NASK/report_contact.php +++ b/examples/Extension/NASK/report_contact.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Report\Contact as ReportContact; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Report\Contact as ReportContact; $frame = new ReportContact(new NASKObjectSpec()); $frame->setContactId('k13'); diff --git a/examples/Extension/NASK/report_domain.php b/examples/Extension/NASK/report_domain.php index b015658..49dd6ad 100644 --- a/examples/Extension/NASK/report_domain.php +++ b/examples/Extension/NASK/report_domain.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Report\Domain as ReportDomain; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Report\Domain as ReportDomain; $frame = new ReportDomain(new NASKObjectSpec()); $frame->setState('STATE_REGISTERED'); diff --git a/examples/Extension/NASK/report_future.php b/examples/Extension/NASK/report_future.php index ba8d67d..8d8837c 100644 --- a/examples/Extension/NASK/report_future.php +++ b/examples/Extension/NASK/report_future.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Report\Future as ReportFuture; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Report\Future as ReportFuture; $frame = new ReportFuture(new NASKObjectSpec()); $frame->setExDate('2007-04-23T15:22:34.0Z'); diff --git a/examples/Extension/NASK/report_getdata.php b/examples/Extension/NASK/report_getdata.php index 835eece..d4e0281 100644 --- a/examples/Extension/NASK/report_getdata.php +++ b/examples/Extension/NASK/report_getdata.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Report\GetData as ReportGetData; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Report\GetData as ReportGetData; $frame = new ReportGetData(new NASKObjectSpec()); $frame->setReportId('58ab3bd1-fcce-4c03-b159-8af5f1adb447'); diff --git a/examples/Extension/NASK/report_host.php b/examples/Extension/NASK/report_host.php index b624f12..09463f2 100644 --- a/examples/Extension/NASK/report_host.php +++ b/examples/Extension/NASK/report_host.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Report\Host as ReportHost; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Report\Host as ReportHost; $frame = new ReportHost(new NASKObjectSpec()); $frame->setName('ns1.temp.pl'); diff --git a/examples/Extension/NASK/report_prepaid_paymentfunds.php b/examples/Extension/NASK/report_prepaid_paymentfunds.php index fccccac..4fac4ee 100644 --- a/examples/Extension/NASK/report_prepaid_paymentfunds.php +++ b/examples/Extension/NASK/report_prepaid_paymentfunds.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Report\Prepaid as ReportPaymentFunds; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Report\Prepaid as ReportPaymentFunds; $frame = new ReportPaymentFunds(new NASKObjectSpec()); $frame->setFundsAccountType('DOMAIN'); diff --git a/examples/Extension/NASK/report_prepaid_payments.php b/examples/Extension/NASK/report_prepaid_payments.php index d54f3a2..1b3ca77 100644 --- a/examples/Extension/NASK/report_prepaid_payments.php +++ b/examples/Extension/NASK/report_prepaid_payments.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Report\Prepaid as ReportPayments; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Report\Prepaid as ReportPayments; $frame = new ReportPayments(new NASKObjectSpec()); $frame->setPaymentsAccountType('DOMAIN'); diff --git a/examples/Extension/NASK/transfer_future.php b/examples/Extension/NASK/transfer_future.php index 8d17c26..6f8d0e1 100644 --- a/examples/Extension/NASK/transfer_future.php +++ b/examples/Extension/NASK/transfer_future.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Transfer\Future as TransferFuture; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Transfer\Future as TransferFuture; $frame = new TransferFuture(new NASKObjectSpec()); $frame->setOperation('request'); diff --git a/examples/Extension/NASK/transfer_future_resend.php b/examples/Extension/NASK/transfer_future_resend.php index c35eba5..dfcf17c 100644 --- a/examples/Extension/NASK/transfer_future_resend.php +++ b/examples/Extension/NASK/transfer_future_resend.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Transfer\Future as TransferFuture; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Transfer\Future as TransferFuture; $frame = new TransferFuture(new NASKObjectSpec()); $frame->setOperation('request'); diff --git a/examples/Extension/NASK/update_future.php b/examples/Extension/NASK/update_future.php index c1bbeb1..2a72b92 100644 --- a/examples/Extension/NASK/update_future.php +++ b/examples/Extension/NASK/update_future.php @@ -7,8 +7,8 @@ chdir(__DIR__); require './_autoload.php'; -use AfriCC\EPP\Extension\NASK\Update\Future as UpdateFuture; use AfriCC\EPP\Extension\NASK\ObjectSpec as NASKObjectSpec; +use AfriCC\EPP\Extension\NASK\Update\Future as UpdateFuture; $frame = new UpdateFuture(new NASKObjectSpec()); $frame->setFuture('example7.pl'); diff --git a/src/AfriCC/EPP/AbstractClient.php b/src/AfriCC/EPP/AbstractClient.php index 5c91d1d..d4fbf6e 100644 --- a/src/AfriCC/EPP/AbstractClient.php +++ b/src/AfriCC/EPP/AbstractClient.php @@ -51,7 +51,7 @@ abstract protected function log($message); * Send frame to EPP server * * @param FrameInterface $frame Frame to send - * @return void Doesn't return! + * * @throws Exception on send error */ abstract protected function sendFrame(FrameInterface $frame); @@ -59,8 +59,9 @@ abstract protected function sendFrame(FrameInterface $frame); /** * Get response frame from EPP server (use after sendFrame) * - * @return string raw XML of EPP Frame * @throws Exception on frame receive error + * + * @return string raw XML of EPP Frame */ abstract protected function getFrame(); @@ -87,7 +88,7 @@ public function __construct(array $config, ObjectSpec $objectSpec = null) $this->debug = false; } - if(is_null($objectSpec)){ + if (is_null($objectSpec)) { $objectSpec = new ObjectSpec(); } diff --git a/src/AfriCC/EPP/AbstractFrame.php b/src/AfriCC/EPP/AbstractFrame.php index f3a3f10..ed7f58c 100644 --- a/src/AfriCC/EPP/AbstractFrame.php +++ b/src/AfriCC/EPP/AbstractFrame.php @@ -56,21 +56,21 @@ public function __construct() $objectSpec = null; $num = func_num_args(); - if($num>2){ - throw new Exception("Too many arguments"); + if ($num > 2) { + throw new Exception('Too many arguments'); } $args = func_get_args(); - foreach($args as $arg){ - if($arg instanceof \DOMDocument){ + foreach ($args as $arg) { + if ($arg instanceof \DOMDocument) { $import = $arg; } - if($arg instanceof ObjectSpec){ + if ($arg instanceof ObjectSpec) { $objectSpec = $arg; } } - if(\is_null($objectSpec)){ + if (\is_null($objectSpec)) { $objectSpec = new ObjectSpec(); } diff --git a/src/AfriCC/EPP/Client.php b/src/AfriCC/EPP/Client.php index fd4df3b..7e12d98 100644 --- a/src/AfriCC/EPP/Client.php +++ b/src/AfriCC/EPP/Client.php @@ -12,7 +12,6 @@ namespace AfriCC\EPP; use AfriCC\EPP\Frame\Command\Logout as LogoutCommand; -use AfriCC\EPP\Frame\ResponseFactory; use Exception; /** diff --git a/src/AfriCC/EPP/ClientInterface.php b/src/AfriCC/EPP/ClientInterface.php index dce52c2..0c0030d 100644 --- a/src/AfriCC/EPP/ClientInterface.php +++ b/src/AfriCC/EPP/ClientInterface.php @@ -10,7 +10,6 @@ * * @see http://tools.ietf.org/html/rfc5734 * @see AbstractClient - * */ interface ClientInterface { diff --git a/src/AfriCC/EPP/Frame/ResponseFactory.php b/src/AfriCC/EPP/Frame/ResponseFactory.php index 77b2307..fece8a7 100644 --- a/src/AfriCC/EPP/Frame/ResponseFactory.php +++ b/src/AfriCC/EPP/Frame/ResponseFactory.php @@ -11,8 +11,8 @@ namespace AfriCC\EPP\Frame; -use AfriCC\EPP\ObjectSpec; use AfriCC\EPP\Frame\Response\MessageQueue; +use AfriCC\EPP\ObjectSpec; use DOMDocument; use DOMXPath; @@ -35,7 +35,7 @@ public static function build($buffer, ObjectSpec $objectSpec = null) $xpath = new DOMXPath($xml); - if(is_null($objectSpec)){ + if (is_null($objectSpec)) { $objectSpec = new ObjectSpec(); } diff --git a/src/AfriCC/EPP/HTTPClient.php b/src/AfriCC/EPP/HTTPClient.php index 0a4db1a..60872bd 100644 --- a/src/AfriCC/EPP/HTTPClient.php +++ b/src/AfriCC/EPP/HTTPClient.php @@ -3,7 +3,6 @@ namespace AfriCC\EPP; use AfriCC\EPP\Frame\Command\Logout as LogoutCommand; -use AfriCC\EPP\Frame\ResponseFactory; /** * A high level HTTP(S) based client for the Extensible Provisioning Protocol (EPP) diff --git a/tests/EPP/Extension/NASK/Check/FutureCheckTest.php b/tests/EPP/Extension/NASK/Check/FutureCheckTest.php index a151d49..ded6462 100644 --- a/tests/EPP/Extension/NASK/Check/FutureCheckTest.php +++ b/tests/EPP/Extension/NASK/Check/FutureCheckTest.php @@ -12,7 +12,6 @@ */ class FutureCheckTest extends TestCase { - /** * Tests Future->addFuture() */ diff --git a/tests/EPP/Extension/NASK/Update/ContactUpdateTest.php b/tests/EPP/Extension/NASK/Update/ContactUpdateTest.php index 4fd0f54..c4b9cbc 100644 --- a/tests/EPP/Extension/NASK/Update/ContactUpdateTest.php +++ b/tests/EPP/Extension/NASK/Update/ContactUpdateTest.php @@ -8,7 +8,6 @@ class ContactUpdateTest extends TestCase { - public function testContactUpdateIndividual() { $frame = new Contact(new NASKObjectSpec());