@@ -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; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | public function addCommand(IChatCommand $command): void { |
23 | 23 | $name = $command->getName(); |
24 | 24 | if($this->hasCommand($name)) { |
25 | - throw new CommandNameAlreadyUsedException("Command $name is already defined."); |
|
25 | + throw new CommandNameAlreadyUsedException("command $name is already defined."); |
|
26 | 26 | } |
27 | 27 | $this->commands[] = $command; |
28 | 28 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | * Extract parameters from text |
73 | 73 | */ |
74 | 74 | public function extractParameters(string $text): array { |
75 | - if(substr($text, 0, 1) != "/" OR !strpos($text, " ")) { |
|
75 | + if(substr($text, 0, 1) != "/" or !strpos($text, " ")) { |
|
76 | 76 | return []; |
77 | 77 | } |
78 | 78 | $params = explode(" ", $text); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | return $command; |
104 | 104 | } |
105 | 105 | } |
106 | - throw new CommandNotFoundException("Command $name is not defined."); |
|
106 | + throw new CommandNotFoundException("command $name is not defined."); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |