| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Metricool\Features\TaskManagement\Tasks; |
| 6 |
|
| 7 |
use Metricool\Support\Helpers\MetricoolUrl; |
| 8 |
use Metricool\Support\Helpers\Storages\EnvironmentConfig; |
| 9 |
|
| 10 |
class LinkedInTask extends AbstractTask |
| 11 |
{ |
| 12 |
public const IDENTIFIER = 'connect_linkedin'; |
| 13 |
|
| 14 |
/** |
| 15 |
* @inheritDoc |
| 16 |
*/ |
| 17 |
protected bool $required = true; |
| 18 |
|
| 19 |
/** |
| 20 |
* @inheritDoc |
| 21 |
*/ |
| 22 |
protected bool $premium = true; |
| 23 |
|
| 24 |
private EnvironmentConfig $env; |
| 25 |
|
| 26 |
public function __construct(EnvironmentConfig $env) |
| 27 |
{ |
| 28 |
$this->env = $env; |
| 29 |
} |
| 30 |
|
| 31 |
/** |
| 32 |
* @inheritDoc |
| 33 |
*/ |
| 34 |
public function getText(): string |
| 35 |
{ |
| 36 |
return __('Connect your LinkedIn account', 'metricool'); |
| 37 |
} |
| 38 |
|
| 39 |
/** |
| 40 |
* @inheritDoc |
| 41 |
*/ |
| 42 |
public function getAction(): array |
| 43 |
{ |
| 44 |
return [ |
| 45 |
'text' => __('Connect', 'metricool'), |
| 46 |
'link' => MetricoolUrl::adminUrl($this->env->getUrl('metricool.connect_linkedin_url')), |
| 47 |
'target' => '_blank', |
| 48 |
]; |
| 49 |
} |
| 50 |
} |
| 51 |
|