@@ -87,7 +87,7 @@ |
||
87 | 87 | */ |
88 | 88 | private function isFileReadable($fullPath) |
89 | 89 | { |
90 | - if ( ! is_readable($fullPath)) { |
|
90 | + if (!is_readable($fullPath)) { |
|
91 | 91 | throw new \Exception('Config is not readable'); |
92 | 92 | } |
93 | 93 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | public function build($type) |
8 | 8 | { |
9 | 9 | $className = 'Monitor\Format\\'.ucwords($type); |
10 | - if ( ! class_exists($className)) { |
|
10 | + if (!class_exists($className)) { |
|
11 | 11 | throw new BadFormatException($type.' format class not found'); |
12 | 12 | } |
13 | 13 | return new $className; |
@@ -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; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | private function isClientValid() |
127 | 127 | { |
128 | - if ( ! $this->client) { |
|
128 | + if (!$this->client) { |
|
129 | 129 | throw new \Exception('Client is not valid'); |
130 | 130 | } |
131 | 131 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | { |
193 | 193 | $resources = $this->client->getResources(); |
194 | 194 | |
195 | - if ( ! $resources) { |
|
195 | + if (!$resources) { |
|
196 | 196 | $resources = json_encode( |
197 | 197 | ['status' => 'offline'] |
198 | 198 | ); |
@@ -95,7 +95,7 @@ |
||
95 | 95 | $triggerId, |
96 | 96 | $serverId |
97 | 97 | ); |
98 | - if ( ! $queryResult) { |
|
98 | + if (!$queryResult) { |
|
99 | 99 | return true; |
100 | 100 | } |
101 | 101 | $timeOfLastFiredUpTrigger = $queryResult[0]['created']; |
@@ -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; |
@@ -25,7 +25,7 @@ |
||
25 | 25 | PercentageHelper $percentageHelper, |
26 | 26 | ComparatorInterface $comparator |
27 | 27 | ) { |
28 | - if ( ! isset($serverData[$trigger->getServiceName()])) { |
|
28 | + if (!isset($serverData[$trigger->getServiceName()])) { |
|
29 | 29 | return false; |
30 | 30 | } |
31 | 31 |
@@ -27,7 +27,7 @@ |
||
27 | 27 | ) { |
28 | 28 | $service = $serviceRepository->findOneBy(['name' => $trigger->getServiceName()]); |
29 | 29 | |
30 | - if ( ! $service) { |
|
30 | + if (!$service) { |
|
31 | 31 | //$log->error('cant find service') |
32 | 32 | return false; |
33 | 33 | } |