|
@@ -50,10 +50,10 @@ discard block |
|
|
block discarded – undo |
|
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
|
} |
|
@@ -86,7 +86,7 @@ discard block |
|
|
block discarded – undo |
|
86
|
86
|
/** @var \stdClass $config */ |
|
87
|
87
|
$config = $this->getConfig(); |
|
88
|
88
|
foreach($config->messageProcessors as $name => $processor) { |
|
89
|
|
- if(!class_exists($processor) OR !is_subclass_of($processor, IChatMessageProcessor::class)) { |
|
|
89
|
+ if(!class_exists($processor) or !is_subclass_of($processor, IChatMessageProcessor::class)) { |
|
90
|
90
|
throw new InvalidMessageProcessorException("Invalid message processor $processor."); |
|
91
|
91
|
} |
|
92
|
92
|
$messageProcessors[$name] = $processor; |
|
@@ -101,7 +101,7 @@ discard block |
|
|
block discarded – undo |
|
101
|
101
|
/** @var \stdClass $config */ |
|
102
|
102
|
$config = $this->getConfig(); |
|
103
|
103
|
$adapter = $config->databaseAdapter; |
|
104
|
|
- if(!class_exists($adapter) OR !is_subclass_of($adapter, IDatabaseAdapter::class)) { |
|
|
104
|
+ if(!class_exists($adapter) or !is_subclass_of($adapter, IDatabaseAdapter::class)) { |
|
105
|
105
|
throw new InvalidDatabaseAdapterException("Invalid database adapter $adapter."); |
|
106
|
106
|
} |
|
107
|
107
|
return $adapter; |