{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/41173859","id":41173859,"diff_hunk":"@@ -752,13 +752,25 @@ private function registerValidationConfiguration(array $config, ContainerBuilder\n \n         $container->setParameter('validator.translation_domain', $config['translation_domain']);\n \n-        list($xmlMappings, $yamlMappings) = $this->getValidatorMappingFiles($container);\n-        if (count($xmlMappings) > 0) {\n-            $validatorBuilder->addMethodCall('addXmlMappings', array($xmlMappings));\n+        $files = array('xml' => array(), 'yml' => array());\n+        foreach ($this->getValidatorMappingFiles($config, $container) as $file) {\n+            if (!is_file($file)) {\n+                throw new \\RuntimeException(sprintf('Could not load file \"%s\".', $file));\n+            }\n+            $container->addResource(new FileResource($file));\n+\n+            if (!in_array($ext = substr($file, -3), array('xml', 'yml'))) {\n+                throw new \\RuntimeException(sprintf('Unsupported mapping type in \"%s\".', $file));\n+            }\n+            $files[$ext][] = $file;\n+        }\n+\n+        if (count($files['xml']) > 0) {","path":"src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php","position":20,"original_position":20,"commit_id":"be2e58bd3d41273bbad2192a1a35c1e961b3cb00","original_commit_id":"be2e58bd3d41273bbad2192a1a35c1e961b3cb00","user":{"login":"stloyd","id":67402,"avatar_url":"https://avatars.githubusercontent.com/u/67402?v=3","gravatar_id":"","url":"https://api.github.com/users/stloyd","html_url":"https://github.com/stloyd","followers_url":"https://api.github.com/users/stloyd/followers","following_url":"https://api.github.com/users/stloyd/following{/other_user}","gists_url":"https://api.github.com/users/stloyd/gists{/gist_id}","starred_url":"https://api.github.com/users/stloyd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stloyd/subscriptions","organizations_url":"https://api.github.com/users/stloyd/orgs","repos_url":"https://api.github.com/users/stloyd/repos","events_url":"https://api.github.com/users/stloyd/events{/privacy}","received_events_url":"https://api.github.com/users/stloyd/received_events","type":"User","site_admin":false},"body":"IMO `!empty($files['xml'])` will be faster and more memory efficient.","created_at":"2015-10-05T17:44:47Z","updated_at":"2015-10-05T17:44:47Z","html_url":"https://github.com/symfony/symfony/pull/13878#discussion_r41173859","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/13878","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/41173859"},"html":{"href":"https://github.com/symfony/symfony/pull/13878#discussion_r41173859"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/13878"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/13878","id":30765981,"html_url":"https://github.com/symfony/symfony/pull/13878","diff_url":"https://github.com/symfony/symfony/pull/13878.diff","patch_url":"https://github.com/symfony/symfony/pull/13878.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/13878","number":13878,"state":"open","locked":false,"title":"[FrameworkBundle] \"mappings\" for validation","user":{"login":"davewwww","id":921303,"avatar_url":"https://avatars.githubusercontent.com/u/921303?v=3","gravatar_id":"","url":"https://api.github.com/users/davewwww","html_url":"https://github.com/davewwww","followers_url":"https://api.github.com/users/davewwww/followers","following_url":"https://api.github.com/users/davewwww/following{/other_user}","gists_url":"https://api.github.com/users/davewwww/gists{/gist_id}","starred_url":"https://api.github.com/users/davewwww/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davewwww/subscriptions","organizations_url":"https://api.github.com/users/davewwww/orgs","repos_url":"https://api.github.com/users/davewwww/repos","events_url":"https://api.github.com/users/davewwww/events{/privacy}","received_events_url":"https://api.github.com/users/davewwww/received_events","type":"User","site_admin":false},"body":"This feature allows you, to define additional validation files or directories which are not in the 'Bundle*/Resources/config/' directory.\r\n\r\n\r\n```yaml\r\n#config.yml\r\nframework:\r\n  validation:\r\n    mapping:\r\n      files:\r\n        - \"path/to/file/validation.yml\"\r\n        - \"path/to/file/validation.xml\"\r\n      dirs: \r\n        - \"path/to/another/directory\"\r\n```\r\n\r\n| Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | \r\n| License       | MIT\r\n| Doc PR        | \r\n\r\n","created_at":"2015-03-09T14:42:47Z","updated_at":"2015-10-05T17:44:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"01ac77c37185a899e72aab8c16481e6890ebd3d8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/13878/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/13878/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/13878/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/be2e58bd3d41273bbad2192a1a35c1e961b3cb00","head":{"label":"davewwww:2.7","ref":"2.7","sha":"be2e58bd3d41273bbad2192a1a35c1e961b3cb00","user":{"login":"davewwww","id":921303,"avatar_url":"https://avatars.githubusercontent.com/u/921303?v=3","gravatar_id":"","url":"https://api.github.com/users/davewwww","html_url":"https://github.com/davewwww","followers_url":"https://api.github.com/users/davewwww/followers","following_url":"https://api.github.com/users/davewwww/following{/other_user}","gists_url":"https://api.github.com/users/davewwww/gists{/gist_id}","starred_url":"https://api.github.com/users/davewwww/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davewwww/subscriptions","organizations_url":"https://api.github.com/users/davewwww/orgs","repos_url":"https://api.github.com/users/davewwww/repos","events_url":"https://api.github.com/users/davewwww/events{/privacy}","received_events_url":"https://api.github.com/users/davewwww/received_events","type":"User","site_admin":false},"repo":{"id":31898701,"name":"symfony","full_name":"davewwww/symfony","owner":{"login":"davewwww","id":921303,"avatar_url":"https://avatars.githubusercontent.com/u/921303?v=3","gravatar_id":"","url":"https://api.github.com/users/davewwww","html_url":"https://github.com/davewwww","followers_url":"https://api.github.com/users/davewwww/followers","following_url":"https://api.github.com/users/davewwww/following{/other_user}","gists_url":"https://api.github.com/users/davewwww/gists{/gist_id}","starred_url":"https://api.github.com/users/davewwww/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davewwww/subscriptions","organizations_url":"https://api.github.com/users/davewwww/orgs","repos_url":"https://api.github.com/users/davewwww/repos","events_url":"https://api.github.com/users/davewwww/events{/privacy}","received_events_url":"https://api.github.com/users/davewwww/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davewwww/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/davewwww/symfony","forks_url":"https://api.github.com/repos/davewwww/symfony/forks","keys_url":"https://api.github.com/repos/davewwww/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davewwww/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davewwww/symfony/teams","hooks_url":"https://api.github.com/repos/davewwww/symfony/hooks","issue_events_url":"https://api.github.com/repos/davewwww/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/davewwww/symfony/events","assignees_url":"https://api.github.com/repos/davewwww/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/davewwww/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/davewwww/symfony/tags","blobs_url":"https://api.github.com/repos/davewwww/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davewwww/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davewwww/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/davewwww/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davewwww/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/davewwww/symfony/languages","stargazers_url":"https://api.github.com/repos/davewwww/symfony/stargazers","contributors_url":"https://api.github.com/repos/davewwww/symfony/contributors","subscribers_url":"https://api.github.com/repos/davewwww/symfony/subscribers","subscription_url":"https://api.github.com/repos/davewwww/symfony/subscription","commits_url":"https://api.github.com/repos/davewwww/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/davewwww/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/davewwww/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/davewwww/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/davewwww/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/davewwww/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davewwww/symfony/merges","archive_url":"https://api.github.com/repos/davewwww/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davewwww/symfony/downloads","issues_url":"https://api.github.com/repos/davewwww/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/davewwww/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/davewwww/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/davewwww/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davewwww/symfony/labels{/name}","releases_url":"https://api.github.com/repos/davewwww/symfony/releases{/id}","created_at":"2015-03-09T13:07:04Z","updated_at":"2015-03-11T14:17:55Z","pushed_at":"2015-10-05T17:21:52Z","git_url":"git://github.com/davewwww/symfony.git","ssh_url":"git@github.com:davewwww/symfony.git","clone_url":"https://github.com/davewwww/symfony.git","svn_url":"https://github.com/davewwww/symfony","homepage":"symfony.com","size":52634,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"2.7"}},"base":{"label":"symfony:2.7","ref":"2.7","sha":"d657834bd0b4dedefc65d30e1921ae287d6eb313","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":458058,"name":"symfony","full_name":"symfony/symfony","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","created_at":"2010-01-04T14:21:21Z","updated_at":"2015-10-05T13:23:04Z","pushed_at":"2015-10-05T17:44:43Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"symfony.com","size":251787,"stargazers_count":10894,"watchers_count":10894,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4289,"mirror_url":null,"open_issues_count":779,"forks":4289,"open_issues":779,"watchers":10894,"default_branch":"2.8"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/13878"},"html":{"href":"https://github.com/symfony/symfony/pull/13878"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/13878"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/13878/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/13878/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/13878/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/be2e58bd3d41273bbad2192a1a35c1e961b3cb00"}}}}