| Total Complexity | 8 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Coverage | 42.86% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class Attachment implements Activator |
||
| 12 | { |
||
| 13 | protected $type; |
||
| 14 | |||
| 15 | 10 | protected function __construct(string $type = null) |
|
| 18 | 10 | } |
|
| 19 | |||
| 20 | 10 | public static function make(string $type = null) |
|
| 23 | } |
||
| 24 | |||
| 25 | public function file(): self |
||
| 26 | { |
||
| 27 | $this->type = Template::TYPE_FILE; |
||
| 28 | |||
| 29 | return $this; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function image(): self |
||
| 33 | { |
||
| 34 | $this->type = Template::TYPE_IMAGE; |
||
| 35 | |||
| 36 | return $this; |
||
| 37 | } |
||
| 38 | |||
| 39 | public function audio(): self |
||
| 40 | { |
||
| 41 | $this->type = Template::TYPE_AUDIO; |
||
| 42 | |||
| 43 | return $this; |
||
| 44 | } |
||
| 45 | |||
| 46 | public function video(): self |
||
| 47 | { |
||
| 48 | $this->type = Template::TYPE_VIDEO; |
||
| 49 | |||
| 50 | return $this; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * Result of matching activator. |
||
| 55 | * |
||
| 56 | * @param MessageReceived $message |
||
| 57 | * |
||
| 58 | * @return bool |
||
| 59 | */ |
||
| 60 | 10 | public function matches(MessageReceived $message): bool |
|
| 67 | } |
||
| 68 | } |
||
| 69 |