diff options
Diffstat (limited to 'src/Core')
-rw-r--r-- | src/Core/Communicator.php | 32 | ||||
-rw-r--r-- | src/Core/ProcessableComponentInterface.php (renamed from src/Core/ProcessableComponent.php) | 2 | ||||
-rw-r--r-- | src/Core/ProcessedComponentInterface.php (renamed from src/Core/ProcessedComponent.php) | 2 | ||||
-rw-r--r-- | src/Core/UpdatableComponentInterface.php (renamed from src/Core/UpdatableComponent.php) | 2 |
4 files changed, 19 insertions, 19 deletions
diff --git a/src/Core/Communicator.php b/src/Core/Communicator.php index cfaaf38..0764df1 100644 --- a/src/Core/Communicator.php +++ b/src/Core/Communicator.php @@ -12,9 +12,9 @@ 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\ProcessedComponentInterface; +use IP1\RESTClient\Core\UpdatableComponentInterface; +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. - * @return ProcessedComponent ProcessedContact, ProcessedGroup, PrcessedMembership or a ClassValidatinArray + * @param ProcessableComponentInterface $component A Contact, Group, Membership or OutGoingSMS. + * @return ProcessedComponentInterface 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): ProcessedComponentInterface { switch (get_class($component)) { case "IP1\RESTClient\Recipient\Contact": @@ -69,12 +69,12 @@ class Communicator } /** * Removes the param to the API and returns the response as the corresponding object. - * @param ProcessedComponent $component A Contact, Group, Membership. - * @return ProcessedComponent ProcessedContact, ProcessedGroup, PrcessedMembership or a ClassValidatinArray + * @param ProcessedComponentInterface $component A Contact, Group, Membership. + * @return ProcessedComponentInterface 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 remove(ProcessedComponent $component): ProcessedComponent + public function remove(ProcessedComponentInterface $component): ProcessedComponentInterface { switch (get_class($component)) { case "IP1\RESTClient\Recipient\ProcessedContact": @@ -94,11 +94,11 @@ class Communicator } /** * Edits the param to the API and returns the response as the corresponding object. - * @param UpdatableComponent $component A Contact, Group, Membership. - * @return UpdatableComponent ProcessedContact, ProcessedGroup or PrcessedMembership. + * @param UpdatableComponentInterface $component A Contact, Group, Membership. + * @return UpdatableComponentInterface ProcessedContact, ProcessedGroup or PrcessedMembership. * @throws \InvalidArgumentException When param isn't any of the classes listed in param args. */ - public function edit(UpdatableComponent $component): UpdatableComponent + public function edit(UpdatableComponentInterface $component): UpdatableComponentInterface { switch (get_class($component)) { case "IP1\RESTClient\Recipient\ProcessedContact": @@ -122,7 +122,7 @@ class Communicator } /** - * Fetches a ProcessedComponent(s) from the given URI. + * Fetches a ProcessedComponentInterface(s) from the given URI. * @param string $endPoint API URI. * @return string JSON API Response. */ @@ -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 @@ -153,7 +153,7 @@ class Communicator return $this->sendRequest($parsedEndPoint, "DELETE"); } /** - * Replaces a ProcessedComponent with the arguments given. + * Replaces a ProcessedComponentInterface with the arguments given. * @param string $endPoint API URI. * @param \JsonSerializable $content The JsonSerializable that is to be PUT to the API. * @return string JSON API Response. @@ -161,7 +161,7 @@ class Communicator public function put(string $endPoint, \JsonSerializable $content): string { $parsedEndPoint = self::parseEndPoint($endPoint); - return $this->sendRequest($parsedEndPoint, "PUT", json_encode($component)); + return $this->sendRequest($parsedEndPoint, "PUT", json_encode($content)); } /** * Turns the given endPoint string into a usable. 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/ProcessedComponentInterface.php index e593600..5e14e83 100644 --- a/src/Core/ProcessedComponent.php +++ b/src/Core/ProcessedComponentInterface.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 ProcessedComponentInterface extends ProcessableComponentInterface { /** diff --git a/src/Core/UpdatableComponent.php b/src/Core/UpdatableComponentInterface.php index 993a569..7ed353f 100644 --- a/src/Core/UpdatableComponent.php +++ b/src/Core/UpdatableComponentInterface.php @@ -16,7 +16,7 @@ namespace IP1\RESTClient\Core; * that class implements this interface. * @package \IP1\RESTClient\Core */ -interface UpdatableComponent extends ProcessedComponent +interface UpdatableComponentInterface extends ProcessedComponentInterface { /** * Returns when the component was updated last. |