| Total Complexity | 7 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | class SlackBot |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | private $name; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var string |
||
| 32 | */ |
||
| 33 | private $avatar; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @param string $name |
||
| 37 | * @param string $avatar |
||
| 38 | */ |
||
| 39 | private function __construct(string $name, string $avatar) |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @param SlackNotification $notification |
||
| 47 | * @return static |
||
| 48 | */ |
||
| 49 | public static function fromNotification(SlackNotification $notification): self |
||
| 50 | { |
||
| 51 | return new static($notification->getName(), $notification->getAvatar()); |
||
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * @param Bot $bot |
||
| 56 | * @return static |
||
| 57 | */ |
||
| 58 | public static function fromBotDefinition(Bot $bot): self |
||
| 59 | { |
||
| 60 | return new static($bot->getName(), $bot->getAvatar()); |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return string |
||
| 65 | */ |
||
| 66 | public function getName(): string |
||
| 67 | { |
||
| 68 | return $this->name; |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @return string |
||
| 73 | */ |
||
| 74 | public function getAvatar(): string |
||
| 75 | { |
||
| 76 | return $this->avatar; |
||
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @return bool |
||
| 81 | */ |
||
| 82 | public function hasEmojiAvatar(): bool |
||
| 86 | } |
||
| 87 | } |
||
| 88 |