@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | try { |
| 41 | 41 | $rc = new \ReflectionClass($interface); |
| 42 | 42 | } catch(\ReflectionException $e) { |
| 43 | - throw new InvalidChatControlFactoryException("Interface $interface not found.", 0, $e); |
|
| 43 | + throw new InvalidChatControlFactoryException("interface $interface not found.", 0, $e); |
|
| 44 | 44 | } |
| 45 | 45 | if(!$rc->isInterface()) { |
| 46 | 46 | throw new InvalidChatControlFactoryException("$interface is not an interface."); |
@@ -48,10 +48,10 @@ discard block |
||
| 48 | 48 | try { |
| 49 | 49 | $rm = new \ReflectionMethod($interface, "create"); |
| 50 | 50 | } catch(\ReflectionException $e) { |
| 51 | - throw new InvalidChatControlFactoryException("Interface $interface does not contain method create.", 0, $e); |
|
| 51 | + throw new InvalidChatControlFactoryException("interface $interface does not contain method create.", 0, $e); |
|
| 52 | 52 | } |
| 53 | 53 | $returnType = $rm->getReturnType(); |
| 54 | - if(is_null($returnType) OR !is_subclass_of($returnType->getName(), ChatControl::class)) { |
|
| 54 | + if(is_null($returnType) or !is_subclass_of($returnType->getName(), ChatControl::class)) { |
|
| 55 | 55 | throw new InvalidChatControlFactoryException("Return type of $interface::create() is not a subtype of " . ChatControl::class . "."); |
| 56 | 56 | } |
| 57 | 57 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $config = $this->getConfig($this->defaults); |
| 81 | 81 | Validators::assertField($config, "messageProcessors", "array"); |
| 82 | 82 | foreach($config["messageProcessors"] as $name => $processor) { |
| 83 | - if(!class_exists($processor) OR !is_subclass_of($processor, IChatMessageProcessor::class)) { |
|
| 83 | + if(!class_exists($processor) or !is_subclass_of($processor, IChatMessageProcessor::class)) { |
|
| 84 | 84 | throw new InvalidMessageProcessorException("Invalid message processor $processor."); |
| 85 | 85 | } |
| 86 | 86 | $messageProcessors[$name] = $processor; |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | $config = $this->getConfig($this->defaults); |
| 97 | 97 | Validators::assertField($config, "databaseAdapter", "string"); |
| 98 | 98 | $adapter = $config["databaseAdapter"]; |
| 99 | - if(!class_exists($adapter) OR !is_subclass_of($adapter, IDatabaseAdapter::class)) { |
|
| 99 | + if(!class_exists($adapter) or !is_subclass_of($adapter, IDatabaseAdapter::class)) { |
|
| 100 | 100 | throw new InvalidDatabaseAdapterException("Invalid database adapter $adapter."); |
| 101 | 101 | } |
| 102 | 102 | return $adapter; |
@@ -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 | /** |