Rebase and add public modifiers
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
aa61f40d51
commit
532118ef06
|
@ -34,8 +34,6 @@ use RuntimeException;
|
|||
use stdClass;
|
||||
|
||||
class PollService {
|
||||
private $logService;
|
||||
|
||||
private $pollRepository;
|
||||
private $slotRepository;
|
||||
private $voteRepository;
|
||||
|
@ -53,8 +51,12 @@ class PollService {
|
|||
*/
|
||||
private $purgeService;
|
||||
|
||||
public function __construct(Connection $connect, LogService $logService, NotificationService $notificationService, SessionService $sessionService, PurgeService $purgeService) {
|
||||
$this->connect = $connect;
|
||||
/**
|
||||
* @var LogService
|
||||
*/
|
||||
private $logService;
|
||||
|
||||
public function __construct(LogService $logService, NotificationService $notificationService, SessionService $sessionService, PurgeService $purgeService) {
|
||||
$this->logService = $logService;
|
||||
$this->notificationService = $notificationService;
|
||||
$this->sessionService = $sessionService;
|
||||
|
|
|
@ -24,68 +24,68 @@ class Services {
|
|||
private static $securityService;
|
||||
private static $sessionService;
|
||||
|
||||
static function init(Connection $connect, \Smarty $smarty) {
|
||||
public static function init(Connection $connect, \Smarty $smarty) {
|
||||
self::$connect = $connect;
|
||||
self::$smarty = $smarty;
|
||||
}
|
||||
|
||||
static function adminPoll() {
|
||||
public static function adminPoll() {
|
||||
if (self::$adminPollService === null) {
|
||||
self::$adminPollService = new AdminPollService(self::$connect, self::poll(), self::log());
|
||||
}
|
||||
return self::$adminPollService;
|
||||
}
|
||||
|
||||
static function input() {
|
||||
public static function input() {
|
||||
if (self::$inputService === null) {
|
||||
self::$inputService = new InputService();
|
||||
}
|
||||
return self::$inputService;
|
||||
}
|
||||
|
||||
static function log() {
|
||||
public static function log() {
|
||||
if (self::$logService === null) {
|
||||
self::$logService = new LogService();
|
||||
}
|
||||
return self::$logService;
|
||||
}
|
||||
|
||||
static function mail() {
|
||||
public static function mail() {
|
||||
if (self::$mailService === null) {
|
||||
self::$mailService = new MailService($config['use_smtp'], $config['smtp_options'], $config['use_sendmail']);
|
||||
}
|
||||
return self::$mailService;
|
||||
}
|
||||
|
||||
static function notification() {
|
||||
public static function notification() {
|
||||
if (self::$notificationService === null) {
|
||||
self::$notificationService = new NotificationService(self::mail(), self::$smarty);
|
||||
}
|
||||
return self::$notificationService;
|
||||
}
|
||||
|
||||
static function poll() {
|
||||
public static function poll() {
|
||||
if (self::$pollService === null) {
|
||||
self::$pollService = new PollService(self::$connect, self::log(), self::notification(), self::session(), self::purge());
|
||||
self::$pollService = new PollService(self::log(), self::notification(), self::session(), self::purge());
|
||||
}
|
||||
return self::$pollService;
|
||||
}
|
||||
|
||||
static function purge() {
|
||||
public static function purge() {
|
||||
if (self::$purgeService === null) {
|
||||
self::$purgeService = new PurgeService(self::$connect, self::log());
|
||||
}
|
||||
return self::$purgeService;
|
||||
}
|
||||
|
||||
static function session() {
|
||||
public static function session() {
|
||||
if (self::$sessionService === null) {
|
||||
self::$sessionService = new SessionService();
|
||||
}
|
||||
return self::$sessionService;
|
||||
}
|
||||
|
||||
static function security() {
|
||||
public static function security() {
|
||||
if (self::$securityService === null) {
|
||||
self::$securityService = new SecurityService();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue