PluginProbe
Metricool – Social media and site statistics / trunk
Metricool – Social media and site statistics vtrunk
2.1.0 2.0.2 2.0.1 2.0.0 1.27 trunk
metricool / app / Features / Onboarding / OnboardingLoader.php

OnboardingLoader.php in Metricool – Social media and site statistics trunk, at app/Features/Onboarding/OnboardingLoader.php

42 lines 917 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\Onboarding;
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 use Metricool\Traits\HasAllowlistControl;
12
13 class OnboardingLoader extends AbstractLoader
14 {
15 use HasAllowlistControl;
16
17 private DashboardService $dashboard;
18
19 public function __construct(EnvironmentConfig $env, RequestStorage $request, DashboardService $dashboard)
20 {
21 parent::__construct($env, $request);
22
23 $this->dashboard = $dashboard;
24 }
25
26 /**
27 * @inheritDoc
28 */
29 public function isEnabled(): bool
30 {
31 return $this->dashboard->isOnboardingCompleted() === false;
32 }
33
34 /**
35 * @inheritDoc
36 */
37 public function inScope(): bool
38 {
39 return $this->userCanManage();
40 }
41 }
42