PluginProbe
Metricool – Social media and site statistics / 2.0.2
Metricool – Social media and site statistics v2.0.2
2.1.0 2.0.2 2.0.1 2.0.0 1.27 trunk
metricool / app / Features / UserSettings / UserSettingsLoader.php

UserSettingsLoader.php in Metricool – Social media and site statistics 2.0.2, at app/Features/UserSettings/UserSettingsLoader.php

39 lines 861 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Metricool\Features\UserSettings;
6
7 use Metricool\Features\AbstractLoader;
8 use Metricool\Services\DashboardService;
9 use Metricool\Support\Helpers\Storages\EnvironmentConfig;
10 use Metricool\Support\Helpers\Storages\RequestStorage;
11
12 class UserSettingsLoader extends AbstractLoader
13 {
14 private DashboardService $dashboard;
15
16 public function __construct(EnvironmentConfig $env, RequestStorage $request, DashboardService $dashboard)
17 {
18 parent::__construct($env, $request);
19
20 $this->dashboard = $dashboard;
21 }
22
23 /**
24 * @inheritDoc
25 */
26 public function isEnabled(): bool
27 {
28 return $this->dashboard->isOnboardingCompleted() && current_user_can('metricool_manage');
29 }
30
31 /**
32 * @inheritDoc
33 */
34 public function inScope(): bool
35 {
36 return true;
37 }
38 }
39