@@ -22,7 +22,7 @@ |
||
| 22 | 22 | public function setUp(): void |
| 23 | 23 | { |
| 24 | 24 | static $control = null; |
| 25 | - if ($control === null) { |
|
| 25 | + if($control === null) { |
|
| 26 | 26 | /** @var IExampleChatControlFactory $factory */ |
| 27 | 27 | $factory = $this->getService(IExampleChatControlFactory::class); |
| 28 | 28 | $control = $factory->create(); |
@@ -41,11 +41,11 @@ discard block |
||
| 41 | 41 | ], |
| 42 | 42 | ] |
| 43 | 43 | ]; |
| 44 | - Assert::exception(function () use ($config) { |
|
| 44 | + Assert::exception(function() use ($config) { |
|
| 45 | 45 | $this->refreshContainer($config); |
| 46 | 46 | }, InvalidChatControlFactoryException::class); |
| 47 | 47 | $config["chat"]["chats"]["abc"] = IFakeFactory::class; |
| 48 | - Assert::exception(function () use ($config) { |
|
| 48 | + Assert::exception(function() use ($config) { |
|
| 49 | 49 | $this->refreshContainer($config); |
| 50 | 50 | }, InvalidChatControlFactoryException::class); |
| 51 | 51 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | ], |
| 60 | 60 | ], |
| 61 | 61 | ]; |
| 62 | - Assert::exception(function () use ($config) { |
|
| 62 | + Assert::exception(function() use ($config) { |
|
| 63 | 63 | $this->refreshContainer($config); |
| 64 | 64 | }, InvalidMessageProcessorException::class); |
| 65 | 65 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | "databaseAdapter" => \stdClass::class, |
| 72 | 72 | ], |
| 73 | 73 | ]; |
| 74 | - Assert::exception(function () use ($config) { |
|
| 74 | + Assert::exception(function() use ($config) { |
|
| 75 | 75 | $this->refreshContainer($config); |
| 76 | 76 | }, InvalidDatabaseAdapterException::class); |
| 77 | 77 | } |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @author Jakub Konečný |
| 10 | 10 | */ |
| 11 | -interface IFakeFactory |
|
| 12 | -{ |
|
| 11 | +interface IFakeFactory { |
|
| 13 | 12 | public function create(): \stdClass; |
| 14 | 13 | } |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @author Jakub Konečný |
| 10 | 10 | */ |
| 11 | -interface IExampleChatControlFactory |
|
| 12 | -{ |
|
| 11 | +interface IExampleChatControlFactory { |
|
| 13 | 12 | public function create(): ExampleChatControl; |
| 14 | 13 | } |
@@ -3,8 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | namespace HeroesofAbenez\Chat; |
| 5 | 5 | |
| 6 | -final class TestCommand extends BaseChatCommand |
|
| 7 | -{ |
|
| 6 | +final class TestCommand extends BaseChatCommand { |
|
| 8 | 7 | /** @var string */ |
| 9 | 8 | protected string $name = "test1"; |
| 10 | 9 | |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | public function getTexts(string $column, $value, int $limit): ChatMessagesCollection |
| 19 | 19 | { |
| 20 | 20 | $texts = new ChatMessagesCollection(); |
| 21 | - for ($i = 1; $i <= $limit; $i++) { |
|
| 21 | + for($i = 1; $i <= $limit; $i++) { |
|
| 22 | 22 | $texts[] = new ChatMessage($i, "text", "now", $this->getFakeCharacter()); |
| 23 | 23 | } |
| 24 | 24 | return $texts; |
@@ -8,8 +8,7 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @author Jakub Konečný |
| 10 | 10 | */ |
| 11 | -final class FakeDatabaseAdapter implements DatabaseAdapter |
|
| 12 | -{ |
|
| 11 | +final class FakeDatabaseAdapter implements DatabaseAdapter { |
|
| 13 | 12 | protected function getFakeCharacter(): ChatCharacter |
| 14 | 13 | { |
| 15 | 14 | return new ChatCharacter(1, "fake"); |
@@ -8,10 +8,8 @@ |
||
| 8 | 8 | * |
| 9 | 9 | * @author Jakub Konečný |
| 10 | 10 | */ |
| 11 | -final class ExampleChatControl extends ChatControl |
|
| 12 | -{ |
|
| 13 | - public function __construct(DatabaseAdapter $databaseAdapter) |
|
| 14 | - { |
|
| 11 | +final class ExampleChatControl extends ChatControl { |
|
| 12 | + public function __construct(DatabaseAdapter $databaseAdapter) { |
|
| 15 | 13 | parent::__construct($databaseAdapter, "example", 1); |
| 16 | 14 | } |
| 17 | 15 | } |
@@ -3,8 +3,7 @@ |
||
| 3 | 3 | |
| 4 | 4 | namespace HeroesofAbenez\Chat; |
| 5 | 5 | |
| 6 | -final class Test2Command extends BaseChatCommand |
|
| 7 | -{ |
|
| 6 | +final class Test2Command extends BaseChatCommand { |
|
| 8 | 7 | public const NAME = "test2"; |
| 9 | 8 | |
| 10 | 9 | public function execute(): string |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | $model = clone $this->model; |
| 32 | 32 | $model->addCommand(new Test2Command()); |
| 33 | 33 | Assert::same("test", $model->parse("/" . Test2Command::NAME)); |
| 34 | - Assert::exception(function () use ($model) { |
|
| 34 | + Assert::exception(function() use ($model) { |
|
| 35 | 35 | $model->addCommand(new Test2Command()); |
| 36 | 36 | }, CommandNameAlreadyUsedException::class); |
| 37 | 37 | } |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | $model = clone $this->model; |
| 42 | 42 | $model->addAlias(self::COMMAND_NAME, "test"); |
| 43 | 43 | Assert::same("passed", $model->parse("/test")); |
| 44 | - Assert::exception(function () use ($model) { |
|
| 44 | + Assert::exception(function() use ($model) { |
|
| 45 | 45 | $model->addAlias("abc", "test"); |
| 46 | 46 | }, CommandNotFoundException::class); |
| 47 | - Assert::exception(function () use ($model) { |
|
| 47 | + Assert::exception(function() use ($model) { |
|
| 48 | 48 | $model->addAlias(self::COMMAND_NAME, "test"); |
| 49 | 49 | }, CommandNameAlreadyUsedException::class); |
| 50 | 50 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | public function getTexts(): array |
| 63 | 63 | { |
| 64 | 64 | return [ |
| 65 | - ["anagfdffd", "/anagfdffd",] |
|
| 65 | + ["anagfdffd", "/anagfdffd", ] |
|
| 66 | 66 | ]; |
| 67 | 67 | } |
| 68 | 68 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | public function testGetCommand(): void |
| 93 | 93 | { |
| 94 | 94 | Assert::type(IChatCommand::class, $this->model->getCommand(self::COMMAND_NAME)); |
| 95 | - Assert::exception(function () { |
|
| 95 | + Assert::exception(function() { |
|
| 96 | 96 | $this->model->getCommand("abc"); |
| 97 | 97 | }, CommandNotFoundException::class); |
| 98 | 98 | } |
@@ -20,8 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | protected ChatCommandsProcessor $model; |
| 22 | 22 | |
| 23 | - public function __construct() |
|
| 24 | - { |
|
| 23 | + public function __construct() { |
|
| 25 | 24 | $this->model = $this->getService(ChatCommandsProcessor::class); // @phpstan-ignore assign.propertyType |
| 26 | 25 | $this->model->addCommand(new TestCommand()); |
| 27 | 26 | } |