@@ -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' |
@@ -6,7 +6,6 @@ |
||
6 | 6 | use Monitor\Client\ClientInterface; |
7 | 7 | use Monitor\Format\FormatInterface; |
8 | 8 | use Monitor\Config\ConfigInterface; |
9 | -use Monitor\Model\Server; |
|
10 | 9 | use Monitor\Service\ServerHistory as ServerHistoryService; |
11 | 10 | |
12 | 11 | class Monitor |
@@ -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 |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | public function __construct() |
13 | 13 | { |
14 | - if (! is_callable('curl_init')) { |
|
14 | + if (!is_callable('curl_init')) { |
|
15 | 15 | throw new Exception('Curl function is not callable'); |
16 | 16 | } |
17 | 17 |
@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | private function isFileReadable($fullPath) |
50 | 50 | { |
51 | - if (! is_readable($fullPath)) { |
|
51 | + if (!is_readable($fullPath)) { |
|
52 | 52 | throw new \Exception('config is not readable'); |
53 | 53 | } |
54 | 54 | } |
@@ -13,7 +13,7 @@ |
||
13 | 13 | public function convertToArray($data) |
14 | 14 | { |
15 | 15 | $array = json_decode($data, true); |
16 | - if (! is_array($array)) { |
|
16 | + if (!is_array($array)) { |
|
17 | 17 | $array = []; |
18 | 18 | } |
19 | 19 | return $array; |
@@ -13,11 +13,11 @@ |
||
13 | 13 | public function convertToArray($data) |
14 | 14 | { |
15 | 15 | $xml = simplexml_load_string($data); |
16 | - if (! $xml) { |
|
16 | + if (!$xml) { |
|
17 | 17 | throw new \Exception('Cant\'t parse xml'); |
18 | 18 | } |
19 | 19 | $array = json_decode(json_encode((array) $xml), true); |
20 | - if (! is_array($array)) { |
|
20 | + if (!is_array($array)) { |
|
21 | 21 | $array = []; |
22 | 22 | } |
23 | 23 | return $array; |
@@ -7,7 +7,7 @@ |
||
7 | 7 | public function getService($className) |
8 | 8 | { |
9 | 9 | $className = __NAMESPACE__.'\\'.$className; |
10 | - if (! class_exists($className)) { |
|
10 | + if (!class_exists($className)) { |
|
11 | 11 | throw new \Exception($className.' Service class not found'); |
12 | 12 | } |
13 | 13 | return new $className; |