@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | $dir = dirname($fileName); |
57 | 57 | |
58 | - if (! file_exists($dir)) { |
|
58 | + if (!file_exists($dir)) { |
|
59 | 59 | mkdir($dir, 0775, true); |
60 | 60 | } |
61 | 61 | } |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | public function load() |
144 | 144 | { |
145 | - if (! file_exists($file = $this->getFileName())) { |
|
145 | + if (!file_exists($file = $this->getFileName())) { |
|
146 | 146 | return collect(); |
147 | 147 | } |
148 | 148 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $data = $this->database->toArray(); |
161 | 161 | } |
162 | 162 | |
163 | - if (! is_array($data)) { |
|
163 | + if (!is_array($data)) { |
|
164 | 164 | $data = $data->toArray(); |
165 | 165 | } |
166 | 166 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | /** |
34 | 34 | * Create base directory for files. |
35 | 35 | * |
36 | - * @param $fileName |
|
36 | + * @param string $fileName |
|
37 | 37 | */ |
38 | 38 | protected function makeDir($fileName) |
39 | 39 | { |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | /** |
70 | 70 | * Make a result from an exception. |
71 | 71 | * |
72 | - * @param $exception |
|
72 | + * @param \Exception $exception |
|
73 | 73 | * @return Result |
74 | 74 | */ |
75 | 75 | protected function makeResultFromException($exception) |
@@ -55,13 +55,13 @@ discard block |
||
55 | 55 | $messages = []; |
56 | 56 | |
57 | 57 | $result = collect($this->getFiles()) |
58 | - ->map(function ($files, $type) use (&$messages) { |
|
58 | + ->map(function($files, $type) use (&$messages) { |
|
59 | 59 | $isGood = true; |
60 | 60 | |
61 | 61 | $files = collect($files); |
62 | 62 | |
63 | 63 | foreach ($files as $file) { |
64 | - if (! is_null($file)) { |
|
64 | + if (!is_null($file)) { |
|
65 | 65 | foreach ($this->getCheckers($type) as $checker) { |
66 | 66 | if (is_string($message = $checker($file))) { |
67 | 67 | $messages[] = $message; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | return $isGood; |
75 | 75 | }) |
76 | - ->filter(function ($value) { |
|
76 | + ->filter(function($value) { |
|
77 | 77 | return $value === false; |
78 | 78 | }); |
79 | 79 | |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | */ |
98 | 98 | public function buildFileExistsChecker() |
99 | 99 | { |
100 | - return function ($file) { |
|
100 | + return function($file) { |
|
101 | 101 | return $this->fileExists($file); |
102 | 102 | }; |
103 | 103 | } |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function buildFileDoesNotExistsChecker() |
111 | 111 | { |
112 | - return function ($file) { |
|
112 | + return function($file) { |
|
113 | 113 | return $this->fileDoesNotExists($file); |
114 | 114 | }; |
115 | 115 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function buildIsDirectoryChecker() |
123 | 123 | { |
124 | - return function ($file) { |
|
124 | + return function($file) { |
|
125 | 125 | return $this->isDirectory($file); |
126 | 126 | }; |
127 | 127 | } |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function fileDoesNotExists($file) |
178 | 178 | { |
179 | - if (! file_exists($file)) { |
|
179 | + if (!file_exists($file)) { |
|
180 | 180 | return true; |
181 | 181 | } |
182 | 182 |
@@ -35,6 +35,9 @@ |
||
35 | 35 | return preg_match("|{$this->target->shouldReturn}|", $expressionResult); |
36 | 36 | } |
37 | 37 | |
38 | + /** |
|
39 | + * @return string |
|
40 | + */ |
|
38 | 41 | public function executeExpression($expression) |
39 | 42 | { |
40 | 43 | return eval("return {$expression} ;"); |
@@ -29,7 +29,7 @@ |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | if ($this->target->shouldReturn === false) { |
32 | - return ! $expressionResult; |
|
32 | + return !$expressionResult; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | return preg_match("|{$this->target->shouldReturn}|", $expressionResult); |
@@ -37,6 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | /** |
39 | 39 | * @param \Exception|\Throwable |
40 | + * @param \Throwable $exception |
|
40 | 41 | */ |
41 | 42 | protected function exceptionResult($exception) |
42 | 43 | { |
@@ -49,7 +50,7 @@ discard block |
||
49 | 50 | /** |
50 | 51 | * Target factory. |
51 | 52 | * |
52 | - * @param $resource |
|
53 | + * @param Resource $resource |
|
53 | 54 | * @param $data |
54 | 55 | * @return Target |
55 | 56 | */ |
@@ -172,7 +173,7 @@ discard block |
||
172 | 173 | /** |
173 | 174 | * Get result error message. |
174 | 175 | * |
175 | - * @return mixed |
|
176 | + * @return null|string |
|
176 | 177 | */ |
177 | 178 | public function getErrorMessage() |
178 | 179 | { |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('health_checks', function (Blueprint $table) { |
|
15 | + Schema::create('health_checks', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | |
18 | 18 | $table->string('resource_name'); |
@@ -69,7 +69,7 @@ |
||
69 | 69 | */ |
70 | 70 | private function sendMail() |
71 | 71 | { |
72 | - IlluminateMail::send($this->target->view, [], function ($message) { |
|
72 | + IlluminateMail::send($this->target->view, [], function($message) { |
|
73 | 73 | $fromAddress = array_get($this->target->config, 'from.address'); |
74 | 74 | |
75 | 75 | $message->returnPath($fromAddress); |
@@ -11,10 +11,10 @@ |
||
11 | 11 | */ |
12 | 12 | public function importProperties($data) |
13 | 13 | { |
14 | - $data->each(function ($value, $key) { |
|
14 | + $data->each(function($value, $key) { |
|
15 | 15 | $key = camel_case($key); |
16 | 16 | |
17 | - if (! property_exists($this, $key)) { |
|
17 | + if (!property_exists($this, $key)) { |
|
18 | 18 | $this->$key = $value; |
19 | 19 | } |
20 | 20 | }); |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $current['load_5'] > $this->target->maxLoad['load_5'] || |
21 | 21 | $current['load_15'] > $this->target->maxLoad['load_15']; |
22 | 22 | |
23 | - return $this->makeResult(! $inTrouble, $this->makeMessage($current)); |
|
23 | + return $this->makeResult(!$inTrouble, $this->makeMessage($current)); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | protected function makeMessage($current, $saved = null) |
@@ -33,7 +33,7 @@ |
||
33 | 33 | |
34 | 34 | protected function findFirstModel() |
35 | 35 | { |
36 | - collect($this->target->models)->each(function ($model) { |
|
36 | + collect($this->target->models)->each(function($model) { |
|
37 | 37 | instantiate($model)->first(); |
38 | 38 | }); |
39 | 39 |