{"action":"opened","number":17719,"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/17719","id":58553306,"html_url":"https://github.com/symfony/symfony/pull/17719","diff_url":"https://github.com/symfony/symfony/pull/17719.diff","patch_url":"https://github.com/symfony/symfony/pull/17719.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/17719","number":17719,"state":"open","locked":false,"title":"[DependencyInjection] fixed exceptions thrown by get method of ContainerBuilder","user":{"login":"lukaszmakuch","id":11966621,"avatar_url":"https://avatars.githubusercontent.com/u/11966621?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaszmakuch","html_url":"https://github.com/lukaszmakuch","followers_url":"https://api.github.com/users/lukaszmakuch/followers","following_url":"https://api.github.com/users/lukaszmakuch/following{/other_user}","gists_url":"https://api.github.com/users/lukaszmakuch/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaszmakuch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaszmakuch/subscriptions","organizations_url":"https://api.github.com/users/lukaszmakuch/orgs","repos_url":"https://api.github.com/users/lukaszmakuch/repos","events_url":"https://api.github.com/users/lukaszmakuch/events{/privacy}","received_events_url":"https://api.github.com/users/lukaszmakuch/received_events","type":"User","site_admin":false},"body":"[DependencyInjection] fixed exceptions thrown by get method of ContainerBuilder \r\n\r\n Q             | A\r\n| ------------- | ---\r\n| Bug fix?      | yes\r\n| New feature?  | no\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\r\nThe ContainerBuilder class wasn't implementing the ContainerInterface interface as it should according to the Liskov substitution principle.\r\n\r\nIt caused dependency on implementation instead than on the interface when using an instance of the ContainerBuilder class.\r\n\r\nFor example this code:\r\n```php\r\n<?php\r\nuse Symfony\\Component\\DependencyInjection\\Exception\\ServiceNotFoundException;\r\nuse Symfony\\Component\\DependencyInjection\\ContainerInterface;\r\n\r\n/* @var $container ContainerInterface */\r\ntry {\r\n    $container->get(\"wrong_service_key\");\r\n} catch (ServiceNotFoundException $e) {\r\n    //action on a wrong key\r\n}\r\n```\r\nworks for correct implementations of the ContainerInterface interface, but the ContainerBuilder class was breaking that by throwing more abstract exceptions.\r\n\r\nAs the ServiceNotFoundException exceptions inherits from the InvalidArgumentException exception, this change shouldn't break code which catches the InvalidArgumentException exception while fetching values from a ContainerInterface interface implementation.","created_at":"2016-02-07T18:36:39Z","updated_at":"2016-02-07T18:36:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/17719/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/17719/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/17719/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/d9a6b6b97838785457b1450da1a94f13eac6df2c","head":{"label":"lukaszmakuch:container_builder_lsp","ref":"container_builder_lsp","sha":"d9a6b6b97838785457b1450da1a94f13eac6df2c","user":{"login":"lukaszmakuch","id":11966621,"avatar_url":"https://avatars.githubusercontent.com/u/11966621?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaszmakuch","html_url":"https://github.com/lukaszmakuch","followers_url":"https://api.github.com/users/lukaszmakuch/followers","following_url":"https://api.github.com/users/lukaszmakuch/following{/other_user}","gists_url":"https://api.github.com/users/lukaszmakuch/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaszmakuch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaszmakuch/subscriptions","organizations_url":"https://api.github.com/users/lukaszmakuch/orgs","repos_url":"https://api.github.com/users/lukaszmakuch/repos","events_url":"https://api.github.com/users/lukaszmakuch/events{/privacy}","received_events_url":"https://api.github.com/users/lukaszmakuch/received_events","type":"User","site_admin":false},"repo":{"id":51257961,"name":"symfony","full_name":"lukaszmakuch/symfony","owner":{"login":"lukaszmakuch","id":11966621,"avatar_url":"https://avatars.githubusercontent.com/u/11966621?v=3","gravatar_id":"","url":"https://api.github.com/users/lukaszmakuch","html_url":"https://github.com/lukaszmakuch","followers_url":"https://api.github.com/users/lukaszmakuch/followers","following_url":"https://api.github.com/users/lukaszmakuch/following{/other_user}","gists_url":"https://api.github.com/users/lukaszmakuch/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaszmakuch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaszmakuch/subscriptions","organizations_url":"https://api.github.com/users/lukaszmakuch/orgs","repos_url":"https://api.github.com/users/lukaszmakuch/repos","events_url":"https://api.github.com/users/lukaszmakuch/events{/privacy}","received_events_url":"https://api.github.com/users/lukaszmakuch/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lukaszmakuch/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/lukaszmakuch/symfony","forks_url":"https://api.github.com/repos/lukaszmakuch/symfony/forks","keys_url":"https://api.github.com/repos/lukaszmakuch/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lukaszmakuch/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lukaszmakuch/symfony/teams","hooks_url":"https://api.github.com/repos/lukaszmakuch/symfony/hooks","issue_events_url":"https://api.github.com/repos/lukaszmakuch/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/lukaszmakuch/symfony/events","assignees_url":"https://api.github.com/repos/lukaszmakuch/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/lukaszmakuch/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/lukaszmakuch/symfony/tags","blobs_url":"https://api.github.com/repos/lukaszmakuch/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lukaszmakuch/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lukaszmakuch/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/lukaszmakuch/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lukaszmakuch/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/lukaszmakuch/symfony/languages","stargazers_url":"https://api.github.com/repos/lukaszmakuch/symfony/stargazers","contributors_url":"https://api.github.com/repos/lukaszmakuch/symfony/contributors","subscribers_url":"https://api.github.com/repos/lukaszmakuch/symfony/subscribers","subscription_url":"https://api.github.com/repos/lukaszmakuch/symfony/subscription","commits_url":"https://api.github.com/repos/lukaszmakuch/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/lukaszmakuch/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/lukaszmakuch/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/lukaszmakuch/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/lukaszmakuch/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/lukaszmakuch/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lukaszmakuch/symfony/merges","archive_url":"https://api.github.com/repos/lukaszmakuch/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lukaszmakuch/symfony/downloads","issues_url":"https://api.github.com/repos/lukaszmakuch/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/lukaszmakuch/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/lukaszmakuch/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/lukaszmakuch/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lukaszmakuch/symfony/labels{/name}","releases_url":"https://api.github.com/repos/lukaszmakuch/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/lukaszmakuch/symfony/deployments","created_at":"2016-02-07T17:53:13Z","updated_at":"2016-02-07T17:53:27Z","pushed_at":"2016-02-07T18:12:29Z","git_url":"git://github.com/lukaszmakuch/symfony.git","ssh_url":"git@github.com:lukaszmakuch/symfony.git","clone_url":"https://github.com/lukaszmakuch/symfony.git","svn_url":"https://github.com/lukaszmakuch/symfony","homepage":"symfony.com","size":66998,"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":"master"}},"base":{"label":"symfony:2.3","ref":"2.3","sha":"01b562b2cdd96ab747f7918172a78eba4085caf2","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}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2016-02-07T17:13:30Z","pushed_at":"2016-02-07T17:16:17Z","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":101208,"stargazers_count":11703,"watchers_count":11703,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4593,"mirror_url":null,"open_issues_count":787,"forks":4593,"open_issues":787,"watchers":11703,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/17719"},"html":{"href":"https://github.com/symfony/symfony/pull/17719"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/17719"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/17719/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/17719/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/17719/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/d9a6b6b97838785457b1450da1a94f13eac6df2c"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":18,"deletions":12,"changed_files":2}}