@@ -19,7 +19,9 @@ |
||
19 | 19 | { |
20 | 20 | if (!array_key_exists($key, $inventory) |
21 | 21 | || !is_array($inventory[$key]) |
22 | - ) return []; |
|
22 | + ) { |
|
23 | + return []; |
|
24 | + } |
|
23 | 25 | |
24 | 26 | $configs = $inventory[$key]; |
25 | 27 |
@@ -61,7 +61,9 @@ discard block |
||
61 | 61 | $file = File::getInstance(); |
62 | 62 | |
63 | 63 | $pluginDir = $documentRoot . 'wp-content/plugins'; |
64 | - if (!$file->isDir($pluginDir)) return []; |
|
64 | + if (!$file->isDir($pluginDir)) { |
|
65 | + return []; |
|
66 | + } |
|
65 | 67 | |
66 | 68 | $plugins = array_diff($file->scanDir($pluginDir), ['.', '..']); |
67 | 69 | $pluginArray = []; |
@@ -69,7 +71,9 @@ discard block |
||
69 | 71 | foreach ($plugins as $pluginFolder) { |
70 | 72 | $path = $pluginDir . '/' . $pluginFolder; |
71 | 73 | |
72 | - if (!$file->isDir($path)) continue; |
|
74 | + if (!$file->isDir($path)) { |
|
75 | + continue; |
|
76 | + } |
|
73 | 77 | |
74 | 78 | $entries = array_diff($file->scanDir($path), ['.', '..']); |
75 | 79 | |
@@ -125,7 +129,9 @@ discard block |
||
125 | 129 | if (isset($urlParts['path'])) { |
126 | 130 | $segments = explode('/', trim($urlParts['path'], '/')); |
127 | 131 | $lastSegment = end($segments); |
128 | - if ($lastSegment) return $lastSegment; |
|
132 | + if ($lastSegment) { |
|
133 | + return $lastSegment; |
|
134 | + } |
|
129 | 135 | } |
130 | 136 | } |
131 | 137 | |
@@ -137,10 +143,14 @@ discard block |
||
137 | 143 | { |
138 | 144 | $url = "https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request[slug]=" . urlencode($slug); |
139 | 145 | $response = @file_get_contents($url); |
140 | - if (!$response) return null; |
|
146 | + if (!$response) { |
|
147 | + return null; |
|
148 | + } |
|
141 | 149 | |
142 | 150 | $pluginData = json_decode($response, true); |
143 | - if (!isset($pluginData['version'])) return null; |
|
151 | + if (!isset($pluginData['version'])) { |
|
152 | + return null; |
|
153 | + } |
|
144 | 154 | |
145 | 155 | $latestVersion = $pluginData['version']; |
146 | 156 |
@@ -46,7 +46,9 @@ |
||
46 | 46 | $collector->setClient($client); |
47 | 47 | } |
48 | 48 | |
49 | - if ($debugMode) $start = time(); |
|
49 | + if ($debugMode) { |
|
50 | + $start = time(); |
|
51 | + } |
|
50 | 52 | |
51 | 53 | $collected = $collector->collect(); |
52 | 54 | if ($collected) { |