Skip to content

Commit 6f7ae56

Browse files
committed
[WIP] Changes after review
1 parent 0826814 commit 6f7ae56

File tree

3 files changed

+766
-2445
lines changed

3 files changed

+766
-2445
lines changed

Diff for: DependencyInjection/Configuration.php

+8-86
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@ class Configuration implements ConfigurationInterface
424424
'logentries' => ['token', 'use_ssl', 'level', 'bubble', 'timeout', 'connection_timeout'],
425425
'insightops' => ['token', 'region', 'use_ssl', 'level', 'bubble'],
426426
'flowdock' => ['token', 'source', 'from_email', 'level', 'bubble'],
427+
'rollbar' => ['id', 'token', 'config', 'level', 'bubble'],
427428
'server_log' => ['host', 'level', 'bubble'],
428429
];
429430

@@ -1069,15 +1070,18 @@ private function handlerTypeAcceptedOptionsValidation(array $v)
10691070
return $v;
10701071
}
10711072

1072-
if (!array_key_exists(strtolower($v['type']), $this->acceptedParamsByHandlerType)) {
1073+
if (in_array($v['type'], ['config', 'id', 'service'])) {
1074+
return $v;
1075+
}
1076+
1077+
if (!array_key_exists($v['type'], $this->acceptedParamsByHandlerType)) {
10731078
return $v;
10741079
}
10751080

1076-
// @todo array_keys should be converted to lowercase?
10771081
$acceptableParamsForHandlers = array_intersect($this->provideAllConfigurationParams(), array_keys($v));
10781082
$unacceptableParamForHandler = array_diff(
10791083
$acceptableParamsForHandlers,
1080-
$this->acceptedParamsByHandlerType[strtolower($v['type'])]
1084+
$this->acceptedParamsByHandlerType[$v['type']]
10811085
);
10821086
if (!empty($unacceptableParamForHandler)) {
10831087
throw new InvalidConfigurationException(sprintf(
@@ -1093,88 +1097,6 @@ private function handlerTypeAcceptedOptionsValidation(array $v)
10931097

10941098
private function provideAllConfigurationParams()
10951099
{
1096-
return [
1097-
'accepted_levels',
1098-
'action_level',
1099-
'activation_strategy',
1100-
'api_version',
1101-
'app_name',
1102-
'auto_log_stacks',
1103-
'bubble',
1104-
'bot_name',
1105-
'buffer_size',
1106-
'channel',
1107-
'client_id',
1108-
'config',
1109-
'connection_string',
1110-
'connection_timeout',
1111-
'console_formater_options',
1112-
'content_type',
1113-
'date_format',
1114-
'deduplication_level',
1115-
'document_type',
1116-
'dsn',
1117-
'elasticsearch',
1118-
'email_prototype',
1119-
'environment',
1120-
'exchange',
1121-
'exchange_name',
1122-
'excluded_404s',
1123-
'excluded_http_codes',
1124-
'facility',
1125-
'filename_format',
1126-
'file_permission',
1127-
'flush_on_overflow',
1128-
'from_email',
1129-
'handler',
1130-
'headers',
1131-
'host',
1132-
'icon_emoji',
1133-
'id',
1134-
'ident',
1135-
'include_extra',
1136-
'index',
1137-
'lazy',
1138-
'level',
1139-
'logopts',
1140-
'mailer',
1141-
'max_files',
1142-
'max_level',
1143-
'message_format',
1144-
'message_type',
1145-
'min_level',
1146-
'members',
1147-
'mongo',
1148-
'nickname',
1149-
'notify',
1150-
'path',
1151-
'passthru_level',
1152-
'persistent',
1153-
'port',
1154-
'publisher',
1155-
'redis',
1156-
'release',
1157-
'region',
1158-
'room',
1159-
'source',
1160-
'stop_buffering',
1161-
'store',
1162-
'subject',
1163-
'tags',
1164-
'team',
1165-
'time',
1166-
'timeout',
1167-
'title',
1168-
'token',
1169-
'to_email',
1170-
'url',
1171-
'user',
1172-
'use_attachment',
1173-
'use_locking',
1174-
'use_short_attachment',
1175-
'use_ssl',
1176-
'verbosity_levels',
1177-
'webhook_url',
1178-
];
1100+
return array_unique(call_user_func_array('array_merge', $this->acceptedParamsByHandlerType));
11791101
}
11801102
}

0 commit comments

Comments
 (0)