protected function validateConfig(array $config)
    {
        $validator = Validator::make($config, $this->getConfigValidationRules());

        if ($validator->fails()) {

            throw new ServiceConfigurationException(
                'Invalid configuration: ' . print_r($validator->messages()->toArray(), true),
                $validator->messages()->toArray()
            );
        }
    }