public function addValidationMapping(BaseValidatorBuilderInterface $builder, $dirs)
    {
        if (empty($dirs)) {
            return;
        }

        $finder = Finder::create()
            ->files()
            ->filter(function (\SplFileInfo $file) {
                return 1 === substr_count($file->getBasename(), '.') && preg_match('/validation\.(yml|yaml|xml)$/', $file->getBasename());
            })
            ->in($dirs)
        ;

        foreach ($finder as $file) {
            list($basename, $extension) = $parts = explode('.', $file->getBasename(), 3);

            switch ($extension) {
                case 'yml':
                case 'yaml':
                    $builder->addYamlMapping($file->getPathname());
                    break;
                case 'xml':
                    $builder->addXmlMapping($file->getPathname());
                    break;
            }
        }
    }