{"action":"created","comment":{"url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/comments/89272998","pull_request_review_id":9818779,"id":89272998,"diff_hunk":"@@ -0,0 +1,138 @@\n+<?php\n+\n+/**\n+ * (c) FSi sp. z o.o. <info@fsi.pl>\n+ *\n+ * For the full copyright and license information, please view the LICENSE\n+ * file that was distributed with this source code.\n+ */\n+\n+namespace FSi\\Bundle\\DataSourceBundle\\DataSource\\Extension\\Symfony\\DependencyInjection\\Driver;\n+\n+use FSi\\Component\\DataSource\\Driver\\DriverAbstractExtension;\n+use Symfony\\Component\\DependencyInjection\\ContainerInterface;\n+\n+/**\n+ * DependencyInjection extension loads various types of extensions from Symfony's service container.\n+ */\n+class DriverExtension extends DriverAbstractExtension\n+{\n+    /**\n+     * @var ContainerInterface\n+     */\n+    protected $container;\n+\n+    /**\n+     * @var string\n+     */\n+    protected $driverType;\n+\n+    /**\n+     * @var array\n+     */\n+    protected $fieldServiceIds;\n+\n+    /**\n+     * @var array\n+     */\n+    protected $fieldExtensionServiceIds;\n+\n+    /**\n+     * @var array\n+     */\n+    protected $subscriberServiceIds;\n+\n+    /**\n+     * @param ContainerInterface $container\n+     * @param string $driverType\n+     * @param array $fieldServiceIds\n+     * @param array $fieldExtensionServiceIds\n+     * @param array $subscriberServiceIds\n+     */\n+    public function __construct(ContainerInterface $container, $driverType, array $fieldServiceIds, array $fieldExtensionServiceIds, array $subscriberServiceIds)\n+    {\n+        $this->container = $container;\n+        $this->driverType = $driverType;\n+        $this->fieldServiceIds = $fieldServiceIds;\n+        $this->fieldExtensionServiceIds = $fieldExtensionServiceIds;\n+        $this->subscriberServiceIds = $subscriberServiceIds;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function getExtendedDriverTypes()\n+    {\n+        return array($this->driverType);\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function hasFieldType($type)\n+    {\n+        return isset($this->fieldServiceIds[$type]);\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function getFieldType($type)\n+    {\n+        if (!isset($this->fieldServiceIds[$type])) {\n+            throw new \\InvalidArgumentException(sprintf('The field type \"%s\" is not registered within the service container.', $type));\n+        }\n+\n+        $type = $this->container->get($this->fieldServiceIds[$type]);\n+\n+        return $type;\n+    }\n+\n+    /**\n+     * {@inheritdoc}\n+     */\n+    public function hasFieldTypeExtensions($type)\n+    {\n+        foreach ($this->fieldExtensionServiceIds as $alias => $extensionName) {","path":"DataSource/Extension/Symfony/DependencyInjection/Driver/DriverExtension.php","position":96,"original_position":96,"commit_id":"9faa7286d1d0d2d7621f29fc13126b9d7daadef9","original_commit_id":"9faa7286d1d0d2d7621f29fc13126b9d7daadef9","user":{"login":"szymach","id":2230556,"avatar_url":"https://avatars.githubusercontent.com/u/2230556?v=3","gravatar_id":"","url":"https://api.github.com/users/szymach","html_url":"https://github.com/szymach","followers_url":"https://api.github.com/users/szymach/followers","following_url":"https://api.github.com/users/szymach/following{/other_user}","gists_url":"https://api.github.com/users/szymach/gists{/gist_id}","starred_url":"https://api.github.com/users/szymach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/szymach/subscriptions","organizations_url":"https://api.github.com/users/szymach/orgs","repos_url":"https://api.github.com/users/szymach/repos","events_url":"https://api.github.com/users/szymach/events{/privacy}","received_events_url":"https://api.github.com/users/szymach/received_events","type":"User","site_admin":false},"body":"You can substitute `array_keys($this->fieldExtensionServiceIds) as $alias` basically everywhere","created_at":"2016-11-23T08:43:58Z","updated_at":"2016-11-23T08:43:58Z","html_url":"https://github.com/fsi-open/datasource-bundle/pull/50#discussion_r89272998","pull_request_url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/comments/89272998"},"html":{"href":"https://github.com/fsi-open/datasource-bundle/pull/50#discussion_r89272998"},"pull_request":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50","id":94829898,"html_url":"https://github.com/fsi-open/datasource-bundle/pull/50","diff_url":"https://github.com/fsi-open/datasource-bundle/pull/50.diff","patch_url":"https://github.com/fsi-open/datasource-bundle/pull/50.patch","issue_url":"https://api.github.com/repos/fsi-open/datasource-bundle/issues/50","number":50,"state":"open","locked":false,"title":"Moved symfony extensions from component into bundle","user":{"login":"chives","id":1170578,"avatar_url":"https://avatars.githubusercontent.com/u/1170578?v=3","gravatar_id":"","url":"https://api.github.com/users/chives","html_url":"https://github.com/chives","followers_url":"https://api.github.com/users/chives/followers","following_url":"https://api.github.com/users/chives/following{/other_user}","gists_url":"https://api.github.com/users/chives/gists{/gist_id}","starred_url":"https://api.github.com/users/chives/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chives/subscriptions","organizations_url":"https://api.github.com/users/chives/orgs","repos_url":"https://api.github.com/users/chives/repos","events_url":"https://api.github.com/users/chives/events{/privacy}","received_events_url":"https://api.github.com/users/chives/received_events","type":"User","site_admin":false},"body":"Fixes #49 ","created_at":"2016-11-22T14:58:13Z","updated_at":"2016-11-23T08:54:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1425f4a0990df93082770816b3b62b86a01e5876","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50/commits","review_comments_url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50/comments","review_comment_url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fsi-open/datasource-bundle/issues/50/comments","statuses_url":"https://api.github.com/repos/fsi-open/datasource-bundle/statuses/9faa7286d1d0d2d7621f29fc13126b9d7daadef9","head":{"label":"chives:dev","ref":"dev","sha":"9faa7286d1d0d2d7621f29fc13126b9d7daadef9","user":{"login":"chives","id":1170578,"avatar_url":"https://avatars.githubusercontent.com/u/1170578?v=3","gravatar_id":"","url":"https://api.github.com/users/chives","html_url":"https://github.com/chives","followers_url":"https://api.github.com/users/chives/followers","following_url":"https://api.github.com/users/chives/following{/other_user}","gists_url":"https://api.github.com/users/chives/gists{/gist_id}","starred_url":"https://api.github.com/users/chives/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chives/subscriptions","organizations_url":"https://api.github.com/users/chives/orgs","repos_url":"https://api.github.com/users/chives/repos","events_url":"https://api.github.com/users/chives/events{/privacy}","received_events_url":"https://api.github.com/users/chives/received_events","type":"User","site_admin":false},"repo":{"id":11252779,"name":"datasource-bundle","full_name":"chives/datasource-bundle","owner":{"login":"chives","id":1170578,"avatar_url":"https://avatars.githubusercontent.com/u/1170578?v=3","gravatar_id":"","url":"https://api.github.com/users/chives","html_url":"https://github.com/chives","followers_url":"https://api.github.com/users/chives/followers","following_url":"https://api.github.com/users/chives/following{/other_user}","gists_url":"https://api.github.com/users/chives/gists{/gist_id}","starred_url":"https://api.github.com/users/chives/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chives/subscriptions","organizations_url":"https://api.github.com/users/chives/orgs","repos_url":"https://api.github.com/users/chives/repos","events_url":"https://api.github.com/users/chives/events{/privacy}","received_events_url":"https://api.github.com/users/chives/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chives/datasource-bundle","description":"Main purpose of this bundle is to register FSi DataSource Component service and twig datasource rendering functions","fork":true,"url":"https://api.github.com/repos/chives/datasource-bundle","forks_url":"https://api.github.com/repos/chives/datasource-bundle/forks","keys_url":"https://api.github.com/repos/chives/datasource-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chives/datasource-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chives/datasource-bundle/teams","hooks_url":"https://api.github.com/repos/chives/datasource-bundle/hooks","issue_events_url":"https://api.github.com/repos/chives/datasource-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/chives/datasource-bundle/events","assignees_url":"https://api.github.com/repos/chives/datasource-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/chives/datasource-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/chives/datasource-bundle/tags","blobs_url":"https://api.github.com/repos/chives/datasource-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chives/datasource-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chives/datasource-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/chives/datasource-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chives/datasource-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/chives/datasource-bundle/languages","stargazers_url":"https://api.github.com/repos/chives/datasource-bundle/stargazers","contributors_url":"https://api.github.com/repos/chives/datasource-bundle/contributors","subscribers_url":"https://api.github.com/repos/chives/datasource-bundle/subscribers","subscription_url":"https://api.github.com/repos/chives/datasource-bundle/subscription","commits_url":"https://api.github.com/repos/chives/datasource-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/chives/datasource-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/chives/datasource-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/chives/datasource-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/chives/datasource-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/chives/datasource-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chives/datasource-bundle/merges","archive_url":"https://api.github.com/repos/chives/datasource-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chives/datasource-bundle/downloads","issues_url":"https://api.github.com/repos/chives/datasource-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/chives/datasource-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/chives/datasource-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/chives/datasource-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chives/datasource-bundle/labels{/name}","releases_url":"https://api.github.com/repos/chives/datasource-bundle/releases{/id}","deployments_url":"https://api.github.com/repos/chives/datasource-bundle/deployments","created_at":"2013-07-08T11:33:00Z","updated_at":"2014-03-30T19:45:56Z","pushed_at":"2016-11-22T15:29:12Z","git_url":"git://github.com/chives/datasource-bundle.git","ssh_url":"git@github.com:chives/datasource-bundle.git","clone_url":"https://github.com/chives/datasource-bundle.git","svn_url":"https://github.com/chives/datasource-bundle","homepage":null,"size":156,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"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":"fsi-open:master","ref":"master","sha":"adda5041962623a3f017aef812e5ea028cf8bee0","user":{"login":"fsi-open","id":2317182,"avatar_url":"https://avatars.githubusercontent.com/u/2317182?v=3","gravatar_id":"","url":"https://api.github.com/users/fsi-open","html_url":"https://github.com/fsi-open","followers_url":"https://api.github.com/users/fsi-open/followers","following_url":"https://api.github.com/users/fsi-open/following{/other_user}","gists_url":"https://api.github.com/users/fsi-open/gists{/gist_id}","starred_url":"https://api.github.com/users/fsi-open/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsi-open/subscriptions","organizations_url":"https://api.github.com/users/fsi-open/orgs","repos_url":"https://api.github.com/users/fsi-open/repos","events_url":"https://api.github.com/users/fsi-open/events{/privacy}","received_events_url":"https://api.github.com/users/fsi-open/received_events","type":"Organization","site_admin":false},"repo":{"id":7560262,"name":"datasource-bundle","full_name":"fsi-open/datasource-bundle","owner":{"login":"fsi-open","id":2317182,"avatar_url":"https://avatars.githubusercontent.com/u/2317182?v=3","gravatar_id":"","url":"https://api.github.com/users/fsi-open","html_url":"https://github.com/fsi-open","followers_url":"https://api.github.com/users/fsi-open/followers","following_url":"https://api.github.com/users/fsi-open/following{/other_user}","gists_url":"https://api.github.com/users/fsi-open/gists{/gist_id}","starred_url":"https://api.github.com/users/fsi-open/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsi-open/subscriptions","organizations_url":"https://api.github.com/users/fsi-open/orgs","repos_url":"https://api.github.com/users/fsi-open/repos","events_url":"https://api.github.com/users/fsi-open/events{/privacy}","received_events_url":"https://api.github.com/users/fsi-open/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsi-open/datasource-bundle","description":"Main purpose of this bundle is to register FSi DataSource Component service and twig datasource rendering functions","fork":false,"url":"https://api.github.com/repos/fsi-open/datasource-bundle","forks_url":"https://api.github.com/repos/fsi-open/datasource-bundle/forks","keys_url":"https://api.github.com/repos/fsi-open/datasource-bundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsi-open/datasource-bundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsi-open/datasource-bundle/teams","hooks_url":"https://api.github.com/repos/fsi-open/datasource-bundle/hooks","issue_events_url":"https://api.github.com/repos/fsi-open/datasource-bundle/issues/events{/number}","events_url":"https://api.github.com/repos/fsi-open/datasource-bundle/events","assignees_url":"https://api.github.com/repos/fsi-open/datasource-bundle/assignees{/user}","branches_url":"https://api.github.com/repos/fsi-open/datasource-bundle/branches{/branch}","tags_url":"https://api.github.com/repos/fsi-open/datasource-bundle/tags","blobs_url":"https://api.github.com/repos/fsi-open/datasource-bundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsi-open/datasource-bundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsi-open/datasource-bundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsi-open/datasource-bundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsi-open/datasource-bundle/statuses/{sha}","languages_url":"https://api.github.com/repos/fsi-open/datasource-bundle/languages","stargazers_url":"https://api.github.com/repos/fsi-open/datasource-bundle/stargazers","contributors_url":"https://api.github.com/repos/fsi-open/datasource-bundle/contributors","subscribers_url":"https://api.github.com/repos/fsi-open/datasource-bundle/subscribers","subscription_url":"https://api.github.com/repos/fsi-open/datasource-bundle/subscription","commits_url":"https://api.github.com/repos/fsi-open/datasource-bundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsi-open/datasource-bundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsi-open/datasource-bundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsi-open/datasource-bundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/fsi-open/datasource-bundle/contents/{+path}","compare_url":"https://api.github.com/repos/fsi-open/datasource-bundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsi-open/datasource-bundle/merges","archive_url":"https://api.github.com/repos/fsi-open/datasource-bundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsi-open/datasource-bundle/downloads","issues_url":"https://api.github.com/repos/fsi-open/datasource-bundle/issues{/number}","pulls_url":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls{/number}","milestones_url":"https://api.github.com/repos/fsi-open/datasource-bundle/milestones{/number}","notifications_url":"https://api.github.com/repos/fsi-open/datasource-bundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsi-open/datasource-bundle/labels{/name}","releases_url":"https://api.github.com/repos/fsi-open/datasource-bundle/releases{/id}","deployments_url":"https://api.github.com/repos/fsi-open/datasource-bundle/deployments","created_at":"2013-01-11T13:30:56Z","updated_at":"2016-01-16T10:44:45Z","pushed_at":"2016-11-22T15:29:13Z","git_url":"git://github.com/fsi-open/datasource-bundle.git","ssh_url":"git@github.com:fsi-open/datasource-bundle.git","clone_url":"https://github.com/fsi-open/datasource-bundle.git","svn_url":"https://github.com/fsi-open/datasource-bundle","homepage":null,"size":141,"stargazers_count":6,"watchers_count":6,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":6,"forks":11,"open_issues":6,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50"},"html":{"href":"https://github.com/fsi-open/datasource-bundle/pull/50"},"issue":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/issues/50"},"comments":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/fsi-open/datasource-bundle/statuses/9faa7286d1d0d2d7621f29fc13126b9d7daadef9"}}}}
{"actor":{"display_login":"szymach"}}