dbMessageFactory->create($rawMessage); $tableMethod = 'handle'.$this->tableCamelize($message->getTableName()); if (method_exists($this, $tableMethod)) { $this->{$tableMethod}($message); } else { $this->handleDefault($message); } } private function tableCamelize($input, $separator = '_') { return str_replace($separator, '', ucwords($input, $separator)); } /** * Use in synchronization tasks. Service instances are persisted between runs. * * @return $this */ public function newInstance(): self { return clone $this; } }