Skip to content

Commit

Permalink
Merge pull request #2 from midnite81/hotfix/fix_contracts
Browse files Browse the repository at this point in the history
Hotfix/fix contracts
  • Loading branch information
midnite81 committed Jul 15, 2022
2 parents decbda4 + b72e654 commit 664749c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 10 deletions.
26 changes: 20 additions & 6 deletions src/Contracts/Prowl.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace Midnite81\Prowl\Contracts;

use Http\Client\Exception;
use Midnite81\Prowl\Exceptions\IncorrectPriorityValueException;
use Midnite81\Prowl\Exceptions\ValueTooLongException;
use Midnite81\Prowl\Services\Notification;
use Midnite81\Prowl\Services\Response;

Expand All @@ -15,7 +18,7 @@ interface Prowl
*
* @param Notification $notification
* @return Response
* @throws \Http\Client\Exception
* @throws Exception
*/
public function add(Notification $notification);

Expand All @@ -24,7 +27,7 @@ public function add(Notification $notification);
*
* @param Notification $notification
* @return Response
* @throws \Http\Client\Exception
* @throws Exception
*/
public function push(Notification $notification);

Expand All @@ -33,7 +36,7 @@ public function push(Notification $notification);
*
* @param Notification $notification
* @return Response
* @throws \Http\Client\Exception
* @throws Exception
*/
public function send(Notification $notification);

Expand All @@ -48,7 +51,7 @@ public function send(Notification $notification);
* @param $apiKey
* @param $providerKey
* @return Response
* @throws \Http\Client\Exception
* @throws Exception
*/
public function verify($apiKey, $providerKey = null);

Expand All @@ -60,7 +63,7 @@ public function verify($apiKey, $providerKey = null);
*
* @param $providerKey
* @return Response|string
* @throws \Http\Client\Exception
* @throws Exception
*/
public function retrieveToken($providerKey);

Expand All @@ -75,7 +78,18 @@ public function retrieveToken($providerKey);
* @param $providerKey
* @param $token
* @return Response|string
* @throws \Http\Client\Exception
* @throws Exception
*/
public function retrieveApiKey($providerKey, $token);

/**
* Create a message
*
* @param array $attributes
* @param array $devices
* @return Notification
* @throws IncorrectPriorityValueException
* @throws ValueTooLongException
*/
public function createMessage($attributes = [], $devices = []);
}
10 changes: 6 additions & 4 deletions src/LaravelProwl.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
namespace Midnite81\Prowl;

use Http\Message\RequestFactory;
use Midnite81\Prowl\Exceptions\IncorrectPriorityValueException;
use Midnite81\Prowl\Exceptions\ValueTooLongException;
use Midnite81\Prowl\Services\LaravelNotification;
use Midnite81\Prowl\Services\Notification;

Expand All @@ -25,8 +27,8 @@ public function __construct($httpClient = null, RequestFactory $requestFactory =
* @param array $attributes
* @param array $devices
* @return Notification
* @throws Exceptions\IncorrectPriorityValueException
* @throws Exceptions\ValueTooLongException
* @throws IncorrectPriorityValueException
* @throws ValueTooLongException
*/
public function createMessage($attributes = [], $devices = [])
{
Expand All @@ -40,8 +42,8 @@ public function createMessage($attributes = [], $devices = [])
* @param array $attributes
* @param array $devices
* @return Notification
* @throws Exceptions\IncorrectPriorityValueException
* @throws Exceptions\ValueTooLongException
* @throws IncorrectPriorityValueException
* @throws ValueTooLongException
*/
public function createNotification($attributes = [], $devices = [])
{
Expand Down

0 comments on commit 664749c

Please sign in to comment.