public function FileUploadSecureValidatorServiceProvider::alter in File Upload Secure Validator 8
Modifies existing service definitions.
Parameters
ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.
Overrides ServiceModifierInterface::alter
File
- src/
FileUploadSecureValidatorServiceProvider.php, line 19
Class
- FileUploadSecureValidatorServiceProvider
- Dynamically register a fileinfo validator service.
Namespace
Drupal\file_upload_secure_validatorCode
public function alter(ContainerBuilder $container) {
if (!SymfonyFileinfoMimeTypeGuesser::isSupported()) {
$container
->removeDefinition('file_upload_secure_validator');
}
}