summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Kindströmmer <hannes@kindstrommer.se>2017-03-16 11:45:33 +0100
committerHannes Kindströmmer <hannes@kindstrommer.se>2017-03-16 11:49:34 +0100
commit99e6c190754d68f7a264372a0e5f153c5bc23dd8 (patch)
tree334aebb2587da83c3ec0ea7f3500cb5150c24587
parent9cfdfd2118db73f76dcfd3ba1b9a4f4fa6cb5445 (diff)
downloadip1-php-sdk-99e6c190754d68f7a264372a0e5f153c5bc23dd8.zip
ip1-php-sdk-99e6c190754d68f7a264372a0e5f153c5bc23dd8.tar.gz
ip1-php-sdk-99e6c190754d68f7a264372a0e5f153c5bc23dd8.tar.bz2
Fixed issue #13
Signed-off-by: Hannes Kindströmmer <hannes@kindstrommer.se>
-rw-r--r--src/Core/Communicator.php8
-rw-r--r--src/Core/ProcessableComponentInterface.php (renamed from src/Core/ProcessableComponent.php)2
-rw-r--r--src/Core/ProcessedComponent.php2
-rw-r--r--src/Recipient/Contact.php4
-rw-r--r--src/Recipient/Group.php4
-rw-r--r--src/Recipient/Membership.php4
-rw-r--r--src/SMS/OutGoingSMS.php4
7 files changed, 14 insertions, 14 deletions
diff --git a/src/Core/Communicator.php b/src/Core/Communicator.php
index d6b8e0c..fbad074 100644
--- a/src/Core/Communicator.php
+++ b/src/Core/Communicator.php
@@ -14,7 +14,7 @@ namespace IP1\RESTClient\Core;
use IP1\RESTClient\Recipient\RecipientFactory;
use IP1\RESTClient\Core\ProcessedComponent;
use IP1\RESTClient\Core\UpdatableComponent;
-use IP1\RESTClient\Core\ProcessableComponent;
+use IP1\RESTClient\Core\ProcessableComponentInterface;
/**
* Handles request to the API and converts the responses into the data classes.
@@ -40,12 +40,12 @@ class Communicator
}
/**
* Adds the param to the API and returns the response as the corresponding object.
- * @param ProcessableComponent $component A Contact, Group, Membership or OutGoingSMS.
+ * @param ProcessableComponentInterface $component A Contact, Group, Membership or OutGoingSMS.
* @return ProcessedComponent ProcessedContact, ProcessedGroup, PrcessedMembership or a ClassValidatinArray
* filled with ProcessedOutGoingSMS.
* @throws \InvalidArgumentException When param isn't any of the classes listed in param args.
*/
- public function add(ProcessableComponent $component): ProcessedComponent
+ public function add(ProcessableComponentInterface $component): ProcessedComponent
{
switch (get_class($component)) {
case "IP1\RESTClient\Recipient\Contact":
@@ -134,7 +134,7 @@ class Communicator
/**
* Adds the content object to the endpoint and returns a processed version of given object.
* @param string $endPoint API URI.
- * @param \JsonSerializable $content The ProcessableComponent that is to be posted to the API.
+ * @param \JsonSerializable $content The ProcessableComponentInterface that is to be posted to the API.
* @return string JSON API Response.
*/
public function post(string $endPoint, \JsonSerializable $content): string
diff --git a/src/Core/ProcessableComponent.php b/src/Core/ProcessableComponentInterface.php
index 987dd0c..c133cee 100644
--- a/src/Core/ProcessableComponent.php
+++ b/src/Core/ProcessableComponentInterface.php
@@ -16,7 +16,7 @@ namespace IP1\RESTClient\Core;
* All objects that are possible to send to the Communicator implement this or any child class.
* @package \IP1\RESTClient\Core
*/
-interface ProcessableComponent extends \JsonSerializable
+interface ProcessableComponentInterface extends \JsonSerializable
{
/**
diff --git a/src/Core/ProcessedComponent.php b/src/Core/ProcessedComponent.php
index e593600..77e8a0e 100644
--- a/src/Core/ProcessedComponent.php
+++ b/src/Core/ProcessedComponent.php
@@ -15,7 +15,7 @@ namespace IP1\RESTClient\Core;
* All responses from the API implements this class.
* @package \IP1\RESTClient\Core
*/
-interface ProcessedComponent extends ProcessableComponent
+interface ProcessedComponent extends ProcessableComponentInterface
{
/**
diff --git a/src/Recipient/Contact.php b/src/Recipient/Contact.php
index 4afa14a..3fd5c3d 100644
--- a/src/Recipient/Contact.php
+++ b/src/Recipient/Contact.php
@@ -11,12 +11,12 @@
*/
namespace IP1\RESTClient\Recipient;
-use IP1\RESTClient\Core\ProcessableComponent;
+use IP1\RESTClient\Core\ProcessableComponentInterface;
/**
* Contact class that represents the JSON that is sent to the API when adding a new Contact
*/
-class Contact implements ProcessableComponent
+class Contact implements ProcessableComponentInterface
{
/**
* The contacts first name.
diff --git a/src/Recipient/Group.php b/src/Recipient/Group.php
index 284bec5..133976e 100644
--- a/src/Recipient/Group.php
+++ b/src/Recipient/Group.php
@@ -11,12 +11,12 @@
*/
namespace IP1\RESTClient\Recipient;
-use IP1\RESTClient\Core\ProcessableComponent;
+use IP1\RESTClient\Core\ProcessableComponentInterface;
/**
* Used to group contacts together with the Membership class.
*/
-class Group implements ProcessableComponent
+class Group implements ProcessableComponentInterface
{
/**
* Name of Group.
diff --git a/src/Recipient/Membership.php b/src/Recipient/Membership.php
index 2d42939..4bd3be8 100644
--- a/src/Recipient/Membership.php
+++ b/src/Recipient/Membership.php
@@ -11,12 +11,12 @@
*/
namespace IP1\RESTClient\Recipient;
-use IP1\RESTClient\Core\ProcessableComponent;
+use IP1\RESTClient\Core\ProcessableComponentInterface;
/**
* Membership is the bridge between ProcessedGroup and ProcessedContact.
*/
-class Membership implements ProcessableComponent
+class Membership implements ProcessableComponentInterface
{
/**
diff --git a/src/SMS/OutGoingSMS.php b/src/SMS/OutGoingSMS.php
index e75474f..1ef0703 100644
--- a/src/SMS/OutGoingSMS.php
+++ b/src/SMS/OutGoingSMS.php
@@ -14,12 +14,12 @@ namespace IP1\RESTClient\SMS;
use IP1\RESTClient\Recipient\ProcessedContact;
use IP1\RESTClient\Recipient\Group;
-use IP1\RESTClient\Core\ProcessableComponent;
+use IP1\RESTClient\Core\ProcessableComponentInterface;
/**
* Class that is used when wanting to send SMSes to the API.
*/
-class OutGoingSMS extends SMS implements ProcessableComponent
+class OutGoingSMS extends SMS implements ProcessableComponentInterface
{
/**
* Contains all the phone numbers the SMS should be sent to.