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