@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | |
33 | 33 | public function check(): void |
34 | 34 | { |
35 | - foreach($this->results as $group) { |
|
35 | + foreach ($this->results as $group) { |
|
36 | 36 | $group->check(); |
37 | 37 | } |
38 | 38 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function hasErrors(): bool |
46 | 46 | { |
47 | 47 | $error = false; |
48 | - foreach($this->results as $group) { |
|
48 | + foreach ($this->results as $group) { |
|
49 | 49 | if ($group->hasErrors()) { |
50 | 50 | $error = true; |
51 | 51 | break; |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | { |
39 | 39 | $strings = []; |
40 | 40 | if (null !== $this->greaterEquals) { |
41 | - $strings[] = '>=' . $this->greaterEquals; |
|
41 | + $strings[] = '>='.$this->greaterEquals; |
|
42 | 42 | } |
43 | 43 | if (null !== $this->lessThan) { |
44 | - $strings[] = '<' . $this->lessThan; |
|
44 | + $strings[] = '<'.$this->lessThan; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | return implode(' and ', $strings); |
@@ -79,10 +79,10 @@ discard block |
||
79 | 79 | $version = $this->getExtensionVersion(); |
80 | 80 | if ((null !== $this->greaterEquals && !version_compare($this->greaterEquals, $version, '<=')) || |
81 | 81 | (null !== $this->lessThan && !version_compare($this->lessThan, $version, '>'))) { |
82 | - $result->setError('Extension ' . $this->extension . ' loaded, but version ' . $version . ' not supported<br/>Version must be ' . $this->getVersionConstraintString()); |
|
82 | + $result->setError('Extension '.$this->extension.' loaded, but version '.$version.' not supported<br/>Version must be '.$this->getVersionConstraintString()); |
|
83 | 83 | } |
84 | 84 | } else { |
85 | - $result->setError('Extension ' . $this->extension . ' is missing'); |
|
85 | + $result->setError('Extension '.$this->extension.' is missing'); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | return $result; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | if (count($this->collections) > 0) { |
42 | 42 | $this->checkCollections($databases); |
43 | 43 | } |
44 | - } catch(\Exception $e) { |
|
44 | + } catch (\Exception $e) { |
|
45 | 45 | $result->setError($e->getMessage()); |
46 | 46 | } |
47 | 47 | return $result; |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | private function checkDatabases($databases) |
72 | 72 | { |
73 | - foreach($this->databases as $database) { |
|
73 | + foreach ($this->databases as $database) { |
|
74 | 74 | if (!in_array($database, $databases)) { |
75 | 75 | throw new \RuntimeException('Database '.$database.' does not exist'); |
76 | 76 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | $version = $aliasResolver->resolveVersionAlias('latest'); |
24 | 24 | |
25 | 25 | $result = new Result($this->label); |
26 | - if ((string)$version !== '') { |
|
26 | + if ((string) $version !== '') { |
|
27 | 27 | $result->setDetails('current version: '.$version); |
28 | 28 | } |
29 | 29 | if ($count > 0) { |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * @param \Elasticsearch\Client|\Elastic\Elasticsearch\Client $client |
26 | 26 | * @param array $indices Indices to check for |
27 | 27 | */ |
28 | - public function __construct(string $label, \Elasticsearch\Client|\Elastic\Elasticsearch\Client $client, array $indices = []) |
|
28 | + public function __construct(string $label, \Elasticsearch\Client | \Elastic\Elasticsearch\Client $client, array $indices = []) |
|
29 | 29 | { |
30 | 30 | parent::__construct($label); |
31 | 31 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | try { |
45 | 45 | $info = $this->client->info(); |
46 | 46 | $versionParts = explode('.', $info['version']['number']); |
47 | - $esMajorVersion = (int)array_shift($versionParts); |
|
47 | + $esMajorVersion = (int) array_shift($versionParts); |
|
48 | 48 | if ($esMajorVersion >= 8) { |
49 | 49 | if ($this->client->ping()->asBool() !== true) { |
50 | 50 | $result->setError("Elasticsearch is not reachable (ping failed)"); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -require __DIR__ . '/../vendor/autoload.php'; |
|
2 | +require __DIR__.'/../vendor/autoload.php'; |
|
3 | 3 | |
4 | 4 | use BretRZaun\StatusPage\Check\PhpExtensionCheck; |
5 | 5 | use BretRZaun\StatusPage\Check\PhpIniCheck; |
@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | |
50 | 50 | // determine if the user is allowed to see the details (based on their IP) |
51 | 51 | $whitelistPattern = '.*'; // this intentionally matches everything |
52 | -$showDetails = (bool)preg_match('|(?mi-Us)' . $whitelistPattern . '|', $_SERVER['REMOTE_ADDR']); |
|
52 | +$showDetails = (bool) preg_match('|(?mi-Us)'.$whitelistPattern.'|', $_SERVER['REMOTE_ADDR']); |
|
53 | 53 | |
54 | 54 | // use the built-in Twig template |
55 | -$loader = new Twig\Loader\FilesystemLoader(__DIR__ . '/../resources/views/'); |
|
55 | +$loader = new Twig\Loader\FilesystemLoader(__DIR__.'/../resources/views/'); |
|
56 | 56 | $twig = new Twig\Environment($loader, ['autoescape' => false]); |
57 | 57 | |
58 | 58 | $content = $twig->render( |