@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | private function isClientValid() |
70 | 70 | { |
71 | - if (! $this->client) { |
|
71 | + if (!$this->client) { |
|
72 | 72 | throw new \Exception('Client is not valid'); |
73 | 73 | } |
74 | 74 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | { |
105 | 105 | $resources = $this->client->getResources(); |
106 | 106 | |
107 | - if (! $resources) { |
|
107 | + if (!$resources) { |
|
108 | 108 | $resources = json_encode( |
109 | 109 | array( |
110 | 110 | 'status' => 'offline' |
@@ -15,7 +15,7 @@ |
||
15 | 15 | |
16 | 16 | public function __construct( |
17 | 17 | ConfigInterface $config, |
18 | - DatabaseInterface &$db, |
|
18 | + DatabaseInterface&$db, |
|
19 | 19 | NotificationMgr $notificationMgr, |
20 | 20 | Triggers $triggers, |
21 | 21 | ServiceFactory $serviceFactory |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | * @param array $data |
12 | 12 | * @return |
13 | 13 | */ |
14 | - public function parse(Notification &$notification, array $data) |
|
14 | + public function parse(Notification&$notification, array $data) |
|
15 | 15 | { |
16 | 16 | $message = $notification->getMessageTemplate(); |
17 | 17 | //get all words in {} brackets |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | foreach ($vars[1] as $var) { |
20 | 20 | //if $data has key named as previous fetched word we replace it with $data value |
21 | 21 | if (isset($data[$var])) { |
22 | - $message = preg_replace("{{" . $var . "}}", $data[$var], $message); |
|
22 | + $message = preg_replace("{{".$var."}}", $data[$var], $message); |
|
23 | 23 | } |
24 | 24 | } |
25 | 25 | $notification->setMessage($message); |
@@ -27,7 +27,7 @@ |
||
27 | 27 | return $this->equal($value, $trigger->getValue()); |
28 | 28 | |
29 | 29 | case "!=": |
30 | - return ! $this->equal($value, $trigger->getValue()); |
|
30 | + return !$this->equal($value, $trigger->getValue()); |
|
31 | 31 | } |
32 | 32 | return false; |
33 | 33 | } |
@@ -10,7 +10,7 @@ |
||
10 | 10 | |
11 | 11 | public function compare(Trigger $trigger, array $serverData, array $services, PercentageHelper $percentageHelper, ComparatorInterface $comparator) |
12 | 12 | { |
13 | - if (! isset($serverData[$trigger->getServiceName()])) { |
|
13 | + if (!isset($serverData[$trigger->getServiceName()])) { |
|
14 | 14 | return false; |
15 | 15 | } |
16 | 16 |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $st = $this->link->prepare($query); |
51 | 51 | $st->execute(); |
52 | 52 | $rows = $st->fetchAll(PDO::FETCH_CLASS); |
53 | - foreach($rows as $row) { |
|
53 | + foreach ($rows as $row) { |
|
54 | 54 | $key = md5($row->name); |
55 | 55 | $services[$key] = |
56 | 56 | [ |
@@ -10,7 +10,7 @@ |
||
10 | 10 | public function compare(Trigger $trigger, array $serverData, array $services, PercentageHelper $percentageHelper, ComparatorInterface $comparator) |
11 | 11 | { |
12 | 12 | $serviceKey = md5($trigger->getServiceName()); |
13 | - if(!isset($services[$serviceKey])) { |
|
13 | + if (!isset($services[$serviceKey])) { |
|
14 | 14 | //$log->error('cant find service') |
15 | 15 | return false; |
16 | 16 | } |
@@ -28,10 +28,10 @@ discard block |
||
28 | 28 | $this->percentageHelper = $percentageHelper; |
29 | 29 | } |
30 | 30 | |
31 | - public function setRepository($repository, $autoload=true) |
|
31 | + public function setRepository($repository, $autoload = true) |
|
32 | 32 | { |
33 | 33 | $this->repository = $repository; |
34 | - if($autoload) { |
|
34 | + if ($autoload) { |
|
35 | 35 | $this->loadTriggers(); |
36 | 36 | } |
37 | 37 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | $this->notificationDelay = $delay; |
52 | 52 | } |
53 | 53 | |
54 | - public function setDb(DatabaseInterface &$db) |
|
54 | + public function setDb(DatabaseInterface&$db) |
|
55 | 55 | { |
56 | 56 | $this->db = $db; |
57 | 57 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | private function checkIsComparatorValid() |
149 | 149 | { |
150 | - if (! $this->comparator) { |
|
150 | + if (!$this->comparator) { |
|
151 | 151 | throw new \Exception('Comparator invalid'); |
152 | 152 | } |
153 | 153 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | */ |
163 | 163 | private function fireTrigger(Trigger $trigger, array $serverData, $msDelay) |
164 | 164 | { |
165 | - if (! $this->hasNotificationDelayExpired( |
|
165 | + if (!$this->hasNotificationDelayExpired( |
|
166 | 166 | $trigger->getId(), |
167 | 167 | $serverData['server_id'], |
168 | 168 | $msDelay |