| Total Complexity | 3 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class AccountLink extends AbstractButton |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | protected $url; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * AccountLink constructor. |
||
| 16 | * |
||
| 17 | 1 | * @param string $url |
|
| 18 | * |
||
| 19 | 1 | * @throws \InvalidArgumentException |
|
| 20 | */ |
||
| 21 | 1 | public function __construct(string $url) |
|
| 22 | { |
||
| 23 | 1 | parent::__construct(self::TYPE_ACCOUNT_LINK); |
|
| 24 | 1 | ||
| 25 | $this->isValidUrl($url); |
||
| 26 | |||
| 27 | $this->url = $url; |
||
| 28 | } |
||
| 29 | 1 | ||
| 30 | /** |
||
| 31 | 1 | * @param string $url |
|
| 32 | * |
||
| 33 | 1 | * @throws \InvalidArgumentException |
|
| 34 | * |
||
| 35 | * @return \Kerox\Messenger\Model\Common\Button\AccountLink |
||
| 36 | 1 | */ |
|
| 37 | public static function create(string $url): self |
||
| 38 | { |
||
| 39 | return new self($url); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return array |
||
| 44 | */ |
||
| 45 | public function toArray(): array |
||
| 53 | } |
||
| 54 | } |
||
| 55 |