@@ -21,7 +21,7 @@ |
||
| 21 | 21 | */ |
| 22 | 22 | public function getName(): string |
| 23 | 23 | { |
| 24 | - if ($this->name !== "") { |
|
| 24 | + if($this->name !== "") { |
|
| 25 | 25 | return $this->name; |
| 26 | 26 | } |
| 27 | 27 | $className = join('', array_slice(explode('\\', static::class), -1)); |
@@ -9,8 +9,7 @@ |
||
| 9 | 9 | * @author Jakub Konečný |
| 10 | 10 | * @property string $name |
| 11 | 11 | */ |
| 12 | -abstract class BaseChatCommand implements IChatCommand |
|
| 13 | -{ |
|
| 12 | +abstract class BaseChatCommand implements IChatCommand { |
|
| 14 | 13 | use \Nette\SmartObject; |
| 15 | 14 | |
| 16 | 15 | protected string $name = ""; |
@@ -8,8 +8,7 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @author Jakub Konečný |
| 10 | 10 | */ |
| 11 | -interface IChatCommand |
|
| 12 | -{ |
|
| 11 | +interface IChatCommand { |
|
| 13 | 12 | public function getName(): string; |
| 14 | 13 | public function setName(string $name): void; |
| 15 | 14 | public function execute(): string; |
@@ -8,8 +8,7 @@ discard block |
||
| 8 | 8 | * |
| 9 | 9 | * @author Jakub Konečný |
| 10 | 10 | */ |
| 11 | -class ChatCharacter |
|
| 12 | -{ |
|
| 11 | +class ChatCharacter { |
|
| 13 | 12 | use \Nette\SmartObject; |
| 14 | 13 | |
| 15 | 14 | /** @var int|string */ |
@@ -18,8 +17,7 @@ discard block |
||
| 18 | 17 | /** |
| 19 | 18 | * @param int|string $id |
| 20 | 19 | */ |
| 21 | - public function __construct($id, public string $name) |
|
| 22 | - { |
|
| 20 | + public function __construct($id, public string $name) { |
|
| 23 | 21 | $this->id = $id; |
| 24 | 22 | } |
| 25 | 23 | |
@@ -27,8 +25,7 @@ discard block |
||
| 27 | 25 | * @return int|string |
| 28 | 26 | * @deprecated Access the property directly |
| 29 | 27 | */ |
| 30 | - public function getId() |
|
| 31 | - { |
|
| 28 | + public function getId() { |
|
| 32 | 29 | return $this->id; |
| 33 | 30 | } |
| 34 | 31 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | $form->addSubmit("send", "chat.newMessageForm.submitButton.label"); |
| 27 | 27 | $form->addComponent($chatControl, "chat"); |
| 28 | 28 | // @phpstan-ignore assign.propertyType |
| 29 | - $form->onSuccess[] = function (Form $form, array $values): void { |
|
| 29 | + $form->onSuccess[] = function(Form $form, array $values): void { |
|
| 30 | 30 | /** @var ChatControl $chat */ |
| 31 | 31 | $chat = $form->getComponent("chat"); |
| 32 | 32 | $chat->newMessage($values["message"]); |
@@ -11,10 +11,8 @@ |
||
| 11 | 11 | * |
| 12 | 12 | * @author Jakub Konečný |
| 13 | 13 | */ |
| 14 | -final class NewChatMessageFormFactory |
|
| 15 | -{ |
|
| 16 | - public function __construct(private readonly Translator $translator) |
|
| 17 | - { |
|
| 14 | +final class NewChatMessageFormFactory { |
|
| 15 | + public function __construct(private readonly Translator $translator) { |
|
| 18 | 16 | } |
| 19 | 17 | |
| 20 | 18 | public function create(ChatControl $chatControl): Form |