@@ -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 | [ |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | namespace Monitor\Model; |
3 | 3 | /** |
4 | - * @Entity @Table(name="notification_triggers") |
|
5 | - **/ |
|
4 | + * @Entity @Table(name="notification_triggers") |
|
5 | + **/ |
|
6 | 6 | class Trigger |
7 | 7 | { |
8 | 8 | /** |
@@ -11,7 +11,7 @@ discard block |
||
11 | 11 | private $id; |
12 | 12 | /** |
13 | 13 | * @Column(type="integer") |
14 | - **/ |
|
14 | + **/ |
|
15 | 15 | private $notification_id; |
16 | 16 | /** |
17 | 17 | * @Column(type="integer") |
@@ -19,19 +19,19 @@ discard block |
||
19 | 19 | private $value; |
20 | 20 | /** |
21 | 21 | * @Column(type="string") |
22 | - **/ |
|
22 | + **/ |
|
23 | 23 | private $name; |
24 | 24 | /** |
25 | 25 | * @Column(type="string") |
26 | - **/ |
|
26 | + **/ |
|
27 | 27 | private $serviceName; |
28 | 28 | /** |
29 | 29 | * @Column(type="string") |
30 | - **/ |
|
30 | + **/ |
|
31 | 31 | private $operator; |
32 | 32 | /** |
33 | 33 | * @Column(type="string") |
34 | - **/ |
|
34 | + **/ |
|
35 | 35 | private $type; |
36 | 36 | |
37 | 37 | /** |
@@ -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 |