| Total Complexity | 3 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | 1 | abstract class BaseChatCommand implements IChatCommand { |
|
| 13 | use \Nette\SmartObject; |
||
| 14 | |||
| 15 | protected string $name = ""; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Defines default name for the chat command |
||
| 19 | * The class' name has to follow XCommand pattern |
||
| 20 | */ |
||
| 21 | public function getName(): string { |
||
| 22 | 1 | if($this->name !== "") { |
|
| 23 | 1 | return $this->name; |
|
| 24 | } |
||
| 25 | 1 | $className = join('', array_slice(explode('\\', static::class), -1)); |
|
| 26 | 1 | return strtolower(str_replace("Command", "", $className)); |
|
| 27 | } |
||
| 28 | |||
| 29 | public function setName(string $name): void { |
||
| 31 | 1 | } |
|
| 32 | } |
||
| 33 | ?> |