| Total Complexity | 5 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | class SlackChannel |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | private $webhookUrl; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var string |
||
| 31 | */ |
||
| 32 | private $target; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @param string $webhookUrl |
||
| 36 | * @param string $target |
||
| 37 | */ |
||
| 38 | private function __construct($webhookUrl, $target) |
||
| 39 | { |
||
| 40 | $this->webhookUrl = $webhookUrl; |
||
| 41 | $this->target = $target; |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @param EntitySlackNotification $notification |
||
| 46 | * @return static |
||
| 47 | */ |
||
| 48 | public static function fromNotification(EntitySlackNotification $notification) |
||
| 49 | { |
||
| 50 | return new static( |
||
| 51 | $notification->getWebhookUrl(), |
||
| 52 | $notification->getTarget() |
||
| 53 | ); |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @param Channel $channel |
||
| 58 | * @return static |
||
| 59 | */ |
||
| 60 | public static function fromDefinition(Channel $channel) |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @return string |
||
| 67 | */ |
||
| 68 | public function getWebhookUrl() |
||
| 71 | } |
||
| 72 | |||
| 73 | /** |
||
| 74 | * @return string |
||
| 75 | */ |
||
| 76 | public function getTarget() |
||
| 81 |