@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Thinktomorrow\Chief\HealthMonitor\Notifiers; |
6 | 6 |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public static function allOnlineModels(bool $onlySingles = false, Model $ignoredModel = null): array |
21 | 21 | { |
22 | - return chiefMemoize('all-online-models', function () use ($onlySingles, $ignoredModel) { |
|
22 | + return chiefMemoize('all-online-models', function() use ($onlySingles, $ignoredModel) { |
|
23 | 23 | $builder = UrlRecord::whereNull('redirect_id') |
24 | 24 | ->select('model_type', 'model_id') |
25 | 25 | ->groupBy('model_type', 'model_id'); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | if ($ignoredModel) { |
32 | - $builder->whereNotIn('id', function ($query) use ($ignoredModel) { |
|
32 | + $builder->whereNotIn('id', function($query) use ($ignoredModel) { |
|
33 | 33 | $query->select('id') |
34 | 34 | ->from('chief_urls') |
35 | 35 | ->where('model_type', '=', $ignoredModel->getMorphClass()) |
@@ -37,14 +37,14 @@ discard block |
||
37 | 37 | }); |
38 | 38 | } |
39 | 39 | |
40 | - $liveUrlRecords = $builder->get()->mapToGroups(function ($record) { |
|
40 | + $liveUrlRecords = $builder->get()->mapToGroups(function($record) { |
|
41 | 41 | return [$record->model_type => $record->model_id]; |
42 | 42 | }); |
43 | 43 | |
44 | 44 | // Get model for each of these records... |
45 | - $models = $liveUrlRecords->map(function ($record, $key) { |
|
45 | + $models = $liveUrlRecords->map(function($record, $key) { |
|
46 | 46 | return Morphables::instance($key)->find($record->toArray()); |
47 | - })->map->reject(function ($model) { |
|
47 | + })->map->reject(function($model) { |
|
48 | 48 | // Invalid references to archived or removed models where url record still exists. |
49 | 49 | return is_null($model) || !$model->isPublished(); |
50 | 50 | })->flatten(); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Thinktomorrow\Chief\HealthMonitor; |
6 | 6 | |
@@ -17,14 +17,14 @@ discard block |
||
17 | 17 | |
18 | 18 | public static function check() |
19 | 19 | { |
20 | - foreach(static::$checks as $check => $notifier) |
|
20 | + foreach (static::$checks as $check => $notifier) |
|
21 | 21 | { |
22 | 22 | $checkInstance = app($check); |
23 | 23 | |
24 | - if(!$checkInstance->check()) { |
|
24 | + if (!$checkInstance->check()) { |
|
25 | 25 | app($notifier)->onFailure($checkInstance); |
26 | 26 | return; |
27 | - } else { |
|
27 | + }else { |
|
28 | 28 | app($notifier)->onSuccess($checkInstance); |
29 | 29 | } |
30 | 30 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Thinktomorrow\Chief\HealthMonitor\Checks; |
6 | 6 | |
@@ -17,6 +17,6 @@ discard block |
||
17 | 17 | |
18 | 18 | public function message(): string |
19 | 19 | { |
20 | - return 'Het lijkt erop dat er geen homepagina ingesteld is. Stel er een in hier: <a href="'. route('chief.back.settings.edit') .'" class="text-secondary-800 underline hover:text-white">Settings</a>'; |
|
20 | + return 'Het lijkt erop dat er geen homepagina ingesteld is. Stel er een in hier: <a href="'.route('chief.back.settings.edit').'" class="text-secondary-800 underline hover:text-white">Settings</a>'; |
|
21 | 21 | } |
22 | 22 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | { |
13 | 13 | $homepageValue = chiefSetting(Setting::HOMEPAGE, $locale); |
14 | 14 | |
15 | - if(!$homepageValue || !is_object($model) || !$model instanceof ProvidesFlatReference) { |
|
15 | + if (!$homepageValue || !is_object($model) || !$model instanceof ProvidesFlatReference) { |
|
16 | 16 | return false; |
17 | 17 | } |
18 | 18 | |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | public static function url($locale = null): string |
23 | 23 | { |
24 | - if($id = chiefSetting(Setting::HOMEPAGE, $locale)) |
|
24 | + if ($id = chiefSetting(Setting::HOMEPAGE, $locale)) |
|
25 | 25 | { |
26 | 26 | return FlatReferenceFactory::fromString($id)->instance()->url($locale); |
27 | 27 | } |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Thinktomorrow\Chief\Fields\Types; |
6 | 6 | |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | |
52 | 52 | public function required(): bool |
53 | 53 | { |
54 | - if(!$this->hasValidation()) return false; |
|
54 | + if (!$this->hasValidation()) return false; |
|
55 | 55 | |
56 | - foreach($this->values['validation'] as $rule){ |
|
57 | - if(false !== strpos($rule, 'required')) return true; |
|
56 | + foreach ($this->values['validation'] as $rule) { |
|
57 | + if (false !== strpos($rule, 'required')) return true; |
|
58 | 58 | }; |
59 | 59 | |
60 | 60 | return false; |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | } |
187 | 187 | |
188 | 188 | if (!in_array($name, ['label', 'key', 'description', 'column', 'name', 'prepend', 'append'])) { |
189 | - throw new \InvalidArgumentException('Cannot set value by ['. $name .'].'); |
|
189 | + throw new \InvalidArgumentException('Cannot set value by ['.$name.'].'); |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | $this->values[$name] = $arguments[0]; |
@@ -51,10 +51,14 @@ |
||
51 | 51 | |
52 | 52 | public function required(): bool |
53 | 53 | { |
54 | - if(!$this->hasValidation()) return false; |
|
54 | + if(!$this->hasValidation()) { |
|
55 | + return false; |
|
56 | + } |
|
55 | 57 | |
56 | 58 | foreach($this->values['validation'] as $rule){ |
57 | - if(false !== strpos($rule, 'required')) return true; |
|
59 | + if(false !== strpos($rule, 'required')) { |
|
60 | + return true; |
|
61 | + } |
|
58 | 62 | }; |
59 | 63 | |
60 | 64 | return false; |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types = 1); |
|
3 | +declare(strict_types=1); |
|
4 | 4 | |
5 | 5 | namespace Thinktomorrow\Chief\HealthMonitor\Checks; |
6 | 6 | |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | } |
15 | 15 | |
16 | 16 | private function get_http_response_code(string $url) { |
17 | - if($url =='') return false; |
|
17 | + if ($url == '') return false; |
|
18 | 18 | |
19 | 19 | // Avoid ssl errors: SSL operation failed with code 1 |
20 | 20 | stream_context_set_default([ |
@@ -30,6 +30,6 @@ discard block |
||
30 | 30 | |
31 | 31 | public function message(): string |
32 | 32 | { |
33 | - return 'Het lijkt erop dat de homepagina niet meer bereikbaar is. <a href="'. route('chief.back.settings.edit') .'" class="text-secondary-800 underline hover:text-white">Kies een nieuwe</a>.'; |
|
33 | + return 'Het lijkt erop dat de homepagina niet meer bereikbaar is. <a href="'.route('chief.back.settings.edit').'" class="text-secondary-800 underline hover:text-white">Kies een nieuwe</a>.'; |
|
34 | 34 | } |
35 | 35 | } |
@@ -14,7 +14,9 @@ |
||
14 | 14 | } |
15 | 15 | |
16 | 16 | private function get_http_response_code(string $url) { |
17 | - if($url =='') return false; |
|
17 | + if($url =='') { |
|
18 | + return false; |
|
19 | + } |
|
18 | 20 | |
19 | 21 | // Avoid ssl errors: SSL operation failed with code 1 |
20 | 22 | stream_context_set_default([ |