1 | <?php |
||
14 | class Configuration implements ConfigurationInterface |
||
15 | { |
||
16 | /** |
||
17 | * {@inheritdoc} |
||
18 | */ |
||
19 | 3 | public function getConfigTreeBuilder() |
|
38 | |||
39 | /** |
||
40 | * @param ArrayNodeDefinition $node |
||
41 | */ |
||
42 | 3 | private function addSpamAlertsSection(ArrayNodeDefinition $node) |
|
43 | { |
||
44 | 1 | $node |
|
45 | 3 | ->children() |
|
46 | 3 | ->arrayNode(AzineMailgunWebhooksExtension::SPAM_ALERTS_PREFIX) |
|
47 | 3 | ->addDefaultsIfNotSet() |
|
48 | 3 | ->canBeUnset() |
|
49 | 3 | ->children() |
|
50 | 3 | ->booleanNode(AzineMailgunWebhooksExtension::SEND_ENABLED)->defaultFalse()->info('Whether to send email notifications after receiving spam complaints')->end() |
|
51 | 3 | ->scalarNode(AzineMailgunWebhooksExtension::SEND_INTERVAL)->defaultValue('60')->info('Interval in minutes between sending of email notifications after receiving spam complaints')->end() |
|
52 | 3 | ->scalarNode(AzineMailgunWebhooksExtension::TICKET_ID)->defaultValue('')->info('Mailgun helpdesk ticket ID to request new IP address in case of spam complains')->end() |
|
53 | 3 | ->scalarNode(AzineMailgunWebhooksExtension::TICKET_SUBJECT)->defaultValue('IP on spam-list, please fix.')->info('Mailgun HelpDesk ticket subject')->end() |
|
54 | 3 | ->scalarNode(AzineMailgunWebhooksExtension::TICKET_MESSAGE)->defaultValue('It looks like my ip is on a spam-list. Please, assign a clean IP to my domain.')->info('Mailgun HelpDesk ticket subject')->end() |
|
55 | 3 | ->scalarNode(AzineMailgunWebhooksExtension::ALERTS_RECIPIENT_EMAIL)->defaultValue('')->info('Admin E-Mail to send notification about spam complaints')->end() |
|
56 | 3 | ->end(); |
|
57 | 3 | } |
|
58 | |||
59 | /** |
||
60 | * @param ArrayNodeDefinition $node |
||
61 | */ |
||
62 | 3 | private function addBlacklistCheckSection(ArrayNodeDefinition $node) |
|
74 | |||
75 | /** |
||
76 | * @param TreeBuilder $treeBuilder |
||
77 | * @param $name |
||
78 | */ |
||
79 | 3 | private function getRootNode(TreeBuilder $treeBuilder, $name) |
|
88 | } |
||
89 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.