protected function mergeMessages($source = null, string $caller = 'ModuleConfig'): void
    {
        $source = is_object($source) ? $source : new stdClass();

        if ($source instanceof InvalidArgumentException) {
            $this->errors = array_merge($this->errors, $this->formatMessages($source->getMessage(), $caller));

            return;
        }

        if ($source instanceof ErrorAwareInterface) {
            $this->errors = array_merge($this->errors, $this->formatMessages($source->getErrors(), $caller));
            $this->warnings = array_merge($this->warnings, $this->formatMessages($source->getWarnings(), $caller));

            return;
        }

        $this->errors[] = "Cannot merge messages from [" . get_class($source) . "]";
    }