cannotBeEmpty() at path "d_zunke_slack.identities" has no effect
mitch10593 opened this issue · comments
In Symfony 3.4, the cannotBeEmpty directive cause this message:
Using Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition::cannotBeEmpty() at path "d_zunke_slack.identities" has no effect, consider requiresAtLeastOneElement() instead. In 4.0 both methods will behave the same.
in DZunke/SlackBundle/DependencyInjection/Configuration.php:
/** @var $connectionNode ArrayNodeDefinition */
$microservicesNode = $node->requiresAtLeastOneElement()
->useAttributeAsKey('username')
->cannotBeEmpty()
->info('Usernames to use for Communication inside the Messaging')
->prototype('array');
Removing cannotBeEmpty() solve the deprecated alert (and I think requiresAtLeastOneElement and useAttributeAsKey should not be used at the same time).
The working version:
/** @var $connectionNode ArrayNodeDefinition */
$microservicesNode = $node->requiresAtLeastOneElement()
->useAttributeAsKey('username')
->info('Usernames to use for Communication inside the Messaging')
->prototype('array');