@@ -2,8 +2,8 @@ |
||
| 2 | 2 | declare(strict_types=1); |
| 3 | 3 | |
| 4 | 4 | require __DIR__ . "/../vendor/autoload.php"; |
| 5 | -Testbench\Bootstrap::setup(__DIR__ . '/_temp', function (\Nette\Configurator $configurator) { |
|
| 6 | - $configurator->addParameters(["appDir" => __DIR__,]); |
|
| 5 | +Testbench\Bootstrap::setup(__DIR__ . '/_temp', function(\Nette\Configurator $configurator) { |
|
| 6 | + $configurator->addParameters(["appDir" => __DIR__, ]); |
|
| 7 | 7 | $configurator->addConfig(__DIR__ . "/tests.neon"); |
| 8 | 8 | }); |
| 9 | 9 | ?> |
| 10 | 10 | \ No newline at end of file |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | public function addCommand(IChatCommand $command): void { |
| 25 | 25 | $name = $command->getName(); |
| 26 | 26 | if($this->hasCommand($name)) { |
| 27 | - throw new CommandNameAlreadyUsedException("Command $name is already defined."); |
|
| 27 | + throw new CommandNameAlreadyUsedException("command $name is already defined."); |
|
| 28 | 28 | } |
| 29 | 29 | $this->commands[] = $command; |
| 30 | 30 | } |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * Extract parameters from text |
| 75 | 75 | */ |
| 76 | 76 | public function extractParameters(string $text): array { |
| 77 | - if(!Strings::startsWith($text, "/") OR !Strings::contains($text, " ")) { |
|
| 77 | + if(!Strings::startsWith($text, "/") or !Strings::contains($text, " ")) { |
|
| 78 | 78 | return []; |
| 79 | 79 | } |
| 80 | 80 | $params = explode(" ", $text); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | return $command; |
| 106 | 106 | } |
| 107 | 107 | } |
| 108 | - throw new CommandNotFoundException("Command $name is not defined."); |
|
| 108 | + throw new CommandNotFoundException("command $name is not defined."); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | public function parse(string $text): ?string { |
@@ -50,10 +50,10 @@ |
||
| 50 | 50 | try { |
| 51 | 51 | $rm = new \ReflectionMethod($interface, "create"); |
| 52 | 52 | } catch(\ReflectionException $e) { |
| 53 | - throw new InvalidChatControlFactoryException("Interface $interface does not contain method create.", 0, $e); |
|
| 53 | + throw new InvalidChatControlFactoryException("interface $interface does not contain method create.", 0, $e); |
|
| 54 | 54 | } |
| 55 | 55 | $returnType = $rm->getReturnType(); |
| 56 | - if(is_null($returnType) OR !is_subclass_of($returnType->getName(), ChatControl::class)) { |
|
| 56 | + if(is_null($returnType) or !is_subclass_of($returnType->getName(), ChatControl::class)) { |
|
| 57 | 57 | throw new InvalidChatControlFactoryException("Return type of $interface::create() is not a subtype of " . ChatControl::class . "."); |
| 58 | 58 | } |
| 59 | 59 | } |