updated-packages
This commit is contained in:
@@ -20,14 +20,12 @@ use Sly\NotificationPusher\Model\PushInterface;
|
||||
use Sly\NotificationPusher\Model\ResponseInterface;
|
||||
|
||||
/**
|
||||
* PushManager.
|
||||
*
|
||||
* @uses \Sly\NotificationPusher\Collection\PushCollection
|
||||
* @author Cédric Dugat <cedric@dugat.me>
|
||||
*/
|
||||
class PushManager
|
||||
{
|
||||
const ENVIRONMENT_DEV = 'dev';
|
||||
const ENVIRONMENT_DEV = 'dev';
|
||||
const ENVIRONMENT_PROD = 'prod';
|
||||
|
||||
/**
|
||||
@@ -46,18 +44,16 @@ class PushManager
|
||||
private $response;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param string $environment Environment
|
||||
*/
|
||||
public function __construct($environment = self::ENVIRONMENT_DEV)
|
||||
{
|
||||
$this->environment = $environment;
|
||||
$this->environment = $environment;
|
||||
$this->pushCollection = new PushCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Sly\NotificationPusher\Model\PushInterface $push Push
|
||||
* @param PushInterface $push Push
|
||||
*/
|
||||
public function add(PushInterface $push)
|
||||
{
|
||||
@@ -65,8 +61,6 @@ class PushManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Get environment.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getEnvironment()
|
||||
@@ -75,8 +69,6 @@ class PushManager
|
||||
}
|
||||
|
||||
/**
|
||||
* Push.
|
||||
*
|
||||
* @return PushCollection
|
||||
*/
|
||||
public function push()
|
||||
@@ -93,17 +85,15 @@ class PushManager
|
||||
|
||||
if ($this->pushCollection && !$this->pushCollection->isEmpty()) {
|
||||
/** @var Push $push */
|
||||
$push = $this->pushCollection->first();
|
||||
$push = $this->pushCollection->first();
|
||||
$this->response = $push->getAdapter()->getResponse();
|
||||
}
|
||||
|
||||
|
||||
return $this->pushCollection;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get feedback.
|
||||
*
|
||||
* @param \Sly\NotificationPusher\Adapter\AdapterInterface $adapter Adapter
|
||||
* @param AdapterInterface $adapter Adapter
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
@@ -115,7 +105,7 @@ class PushManager
|
||||
throw new AdapterException(
|
||||
sprintf(
|
||||
'%s adapter has no dedicated "getFeedback" method',
|
||||
(string)$adapter
|
||||
(string) $adapter
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user