- Updates remaining router endpoints to use constructor and new constants
This commit is contained in:
@@ -9,9 +9,14 @@ class Queue {
|
||||
const ENDPOINT = 'queue';
|
||||
const ACTION_RUN = 'run';
|
||||
public $allowed_actions = array(self::ACTION_RUN);
|
||||
public $data;
|
||||
|
||||
function run($data) {
|
||||
$queue = new Daemon($data);
|
||||
function __construct($data) {
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
function run() {
|
||||
$queue = new Daemon($this->data);
|
||||
$queue->run();
|
||||
}
|
||||
}
|
@@ -15,18 +15,23 @@ class Subscription {
|
||||
self::ACTION_MANAGE,
|
||||
self::ACTION_UNSUBSCRIBE
|
||||
);
|
||||
public $data;
|
||||
|
||||
function confirm($data) {
|
||||
$subscription = new UserSubscription\Pages('confirm', $data);
|
||||
function __construct($data) {
|
||||
$this->data = $data;
|
||||
}
|
||||
|
||||
function confirm() {
|
||||
$subscription = new UserSubscription\Pages('confirm', $this->data);
|
||||
$subscription->confirm();
|
||||
}
|
||||
|
||||
function manage($data) {
|
||||
$subscription = new UserSubscription\Pages('manage', $data);
|
||||
function manage() {
|
||||
$subscription = new UserSubscription\Pages('manage', $this->data);
|
||||
}
|
||||
|
||||
function unsubscribe($data) {
|
||||
$subscription = new UserSubscription\Pages('unsubscribe', $data);
|
||||
function unsubscribe() {
|
||||
$subscription = new UserSubscription\Pages('unsubscribe', $this->data);
|
||||
$subscription->unsubscribe();
|
||||
}
|
||||
}
|
@@ -14,7 +14,7 @@ class Track {
|
||||
const ENDPOINT = 'track';
|
||||
const ACTION_CLICK = 'click';
|
||||
const ACTION_OPEN = 'open';
|
||||
const ALLOWED_ACTIONS = array(
|
||||
public $allowed_actions = array(
|
||||
self::ACTION_CLICK,
|
||||
self::ACTION_OPEN
|
||||
);
|
||||
|
Reference in New Issue
Block a user