{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/63196831","id":63196831,"diff_hunk":"@@ -24,22 +24,51 @@\n     public function __construct(array $config = array())\n     {\n         $resolver = new OptionsResolver();\n+\n+        $this->configureOptions($resolver);\n+\n+        $this->config = $resolver->resolve($config);\n+    }\n+\n+    /**\n+     * Configures the adapter's options.\n+     *\n+     * @param OptionsResolver $resolver An OptionsResolver instance\n+     */\n+    protected function configureOptions(OptionsResolver $resolver)\n+    {\n         $resolver->setDefaults(array(\n-            'host' => null,\n+            'host' => 'localhost',\n             'port' => 389,\n             'version' => 3,\n-            'useSsl' => false,\n-            'useStartTls' => false,\n-            'optReferrals' => false,\n+            'connectionString' => null,\n+            'ssl' => false,\n+            'tls' => false,\n+            'options' => array(),\n         ));\n-        $resolver->setNormalizer('host', function (Options $options, $value) {\n-            if ($value && $options['useSsl']) {\n-                return 'ldaps://'.$value;\n-            }\n \n-            return $value;\n+        $resolver->setAllowedTypes('host', 'string');\n+        $resolver->setAllowedTypes('port', 'numeric');\n+        $resolver->setAllowedTypes('version', 'numeric');\n+        $resolver->setAllowedTypes('ssl', 'bool');\n+        $resolver->setAllowedTypes('tls', 'bool');\n+        $resolver->setAllowedTypes('options', 'array');\n+\n+        $resolver->setNormalizer('port', function (Options $options, $value) {\n+            return (389 === $value && $options['ssl']) ? 636 : $value;","path":"src/Symfony/Component/Ldap/Adapter/AbstractConnection.php","position":44,"original_position":44,"commit_id":"d61cf07b3cc48829c2a63f8ee6e295caf9b0fa0a","original_commit_id":"d61cf07b3cc48829c2a63f8ee6e295caf9b0fa0a","user":{"login":"fabpot","id":47313,"avatar_url":"https://avatars.githubusercontent.com/u/47313?v=3","gravatar_id":"","url":"https://api.github.com/users/fabpot","html_url":"https://github.com/fabpot","followers_url":"https://api.github.com/users/fabpot/followers","following_url":"https://api.github.com/users/fabpot/following{/other_user}","gists_url":"https://api.github.com/users/fabpot/gists{/gist_id}","starred_url":"https://api.github.com/users/fabpot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabpot/subscriptions","organizations_url":"https://api.github.com/users/fabpot/orgs","repos_url":"https://api.github.com/users/fabpot/repos","events_url":"https://api.github.com/users/fabpot/events{/privacy}","received_events_url":"https://api.github.com/users/fabpot/received_events","type":"User","site_admin":false},"body":"parenthesis can be removed.","created_at":"2016-05-13T14:54:39Z","updated_at":"2016-05-13T14:54:39Z","html_url":"https://github.com/symfony/symfony/pull/18725#discussion_r63196831","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/18725","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/63196831"},"html":{"href":"https://github.com/symfony/symfony/pull/18725#discussion_r63196831"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18725"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/18725","id":69276965,"html_url":"https://github.com/symfony/symfony/pull/18725","diff_url":"https://github.com/symfony/symfony/pull/18725.diff","patch_url":"https://github.com/symfony/symfony/pull/18725.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/18725","number":18725,"state":"open","locked":false,"title":"[Ldap] Added the possibility to configure all available Ldap options for connection","user":{"login":"csarrazi","id":465798,"avatar_url":"https://avatars.githubusercontent.com/u/465798?v=3","gravatar_id":"","url":"https://api.github.com/users/csarrazi","html_url":"https://github.com/csarrazi","followers_url":"https://api.github.com/users/csarrazi/followers","following_url":"https://api.github.com/users/csarrazi/following{/other_user}","gists_url":"https://api.github.com/users/csarrazi/gists{/gist_id}","starred_url":"https://api.github.com/users/csarrazi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csarrazi/subscriptions","organizations_url":"https://api.github.com/users/csarrazi/orgs","repos_url":"https://api.github.com/users/csarrazi/repos","events_url":"https://api.github.com/users/csarrazi/events{/privacy}","received_events_url":"https://api.github.com/users/csarrazi/received_events","type":"User","site_admin":false},"body":"| Q             | A\r\n| ------------- | ---\r\n| Branch?       | master\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 | #18448\r\n| License       | MIT\r\n| Doc PR        | \r\n\r\nThis PR lets a user configure [all documented Ldap options](http://php.net/manual/fr/function.ldap-get-option.php), as well as a few undocumented ones (back-ported from the [OpenLdap C library](http://linux.die.net/man/3/ldap_set_option), as well as the [Ldap client specification](https://www.ietf.org/proceedings/50/I-D/ldapext-ldap-c-api-05.txt)).","created_at":"2016-05-08T19:26:15Z","updated_at":"2016-05-13T14:54:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a538b5e225149dac4f8920c5b5d263c74c7c87de","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/18725/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/18725/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/18725/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/d61cf07b3cc48829c2a63f8ee6e295caf9b0fa0a","head":{"label":"csarrazi:feature/ldap-options","ref":"feature/ldap-options","sha":"d61cf07b3cc48829c2a63f8ee6e295caf9b0fa0a","user":{"login":"csarrazi","id":465798,"avatar_url":"https://avatars.githubusercontent.com/u/465798?v=3","gravatar_id":"","url":"https://api.github.com/users/csarrazi","html_url":"https://github.com/csarrazi","followers_url":"https://api.github.com/users/csarrazi/followers","following_url":"https://api.github.com/users/csarrazi/following{/other_user}","gists_url":"https://api.github.com/users/csarrazi/gists{/gist_id}","starred_url":"https://api.github.com/users/csarrazi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csarrazi/subscriptions","organizations_url":"https://api.github.com/users/csarrazi/orgs","repos_url":"https://api.github.com/users/csarrazi/repos","events_url":"https://api.github.com/users/csarrazi/events{/privacy}","received_events_url":"https://api.github.com/users/csarrazi/received_events","type":"User","site_admin":false},"repo":{"id":16704730,"name":"symfony","full_name":"csarrazi/symfony","owner":{"login":"csarrazi","id":465798,"avatar_url":"https://avatars.githubusercontent.com/u/465798?v=3","gravatar_id":"","url":"https://api.github.com/users/csarrazi","html_url":"https://github.com/csarrazi","followers_url":"https://api.github.com/users/csarrazi/followers","following_url":"https://api.github.com/users/csarrazi/following{/other_user}","gists_url":"https://api.github.com/users/csarrazi/gists{/gist_id}","starred_url":"https://api.github.com/users/csarrazi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csarrazi/subscriptions","organizations_url":"https://api.github.com/users/csarrazi/orgs","repos_url":"https://api.github.com/users/csarrazi/repos","events_url":"https://api.github.com/users/csarrazi/events{/privacy}","received_events_url":"https://api.github.com/users/csarrazi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/csarrazi/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/csarrazi/symfony","forks_url":"https://api.github.com/repos/csarrazi/symfony/forks","keys_url":"https://api.github.com/repos/csarrazi/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/csarrazi/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/csarrazi/symfony/teams","hooks_url":"https://api.github.com/repos/csarrazi/symfony/hooks","issue_events_url":"https://api.github.com/repos/csarrazi/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/csarrazi/symfony/events","assignees_url":"https://api.github.com/repos/csarrazi/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/csarrazi/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/csarrazi/symfony/tags","blobs_url":"https://api.github.com/repos/csarrazi/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/csarrazi/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/csarrazi/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/csarrazi/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/csarrazi/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/csarrazi/symfony/languages","stargazers_url":"https://api.github.com/repos/csarrazi/symfony/stargazers","contributors_url":"https://api.github.com/repos/csarrazi/symfony/contributors","subscribers_url":"https://api.github.com/repos/csarrazi/symfony/subscribers","subscription_url":"https://api.github.com/repos/csarrazi/symfony/subscription","commits_url":"https://api.github.com/repos/csarrazi/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/csarrazi/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/csarrazi/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/csarrazi/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/csarrazi/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/csarrazi/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/csarrazi/symfony/merges","archive_url":"https://api.github.com/repos/csarrazi/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/csarrazi/symfony/downloads","issues_url":"https://api.github.com/repos/csarrazi/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/csarrazi/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/csarrazi/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/csarrazi/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/csarrazi/symfony/labels{/name}","releases_url":"https://api.github.com/repos/csarrazi/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/csarrazi/symfony/deployments","created_at":"2014-02-10T18:26:10Z","updated_at":"2015-03-24T15:55:17Z","pushed_at":"2016-05-08T21:10:49Z","git_url":"git://github.com/csarrazi/symfony.git","ssh_url":"git@github.com:csarrazi/symfony.git","clone_url":"https://github.com/csarrazi/symfony.git","svn_url":"https://github.com/csarrazi/symfony","homepage":"symfony.com","size":70561,"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:master","ref":"master","sha":"b85ab60b70f0dcff62ac8438e91e7a93c44823da","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-05-13T13:33:13Z","pushed_at":"2016-05-13T14:49:42Z","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":129616,"stargazers_count":12311,"watchers_count":12311,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4830,"mirror_url":null,"open_issues_count":760,"forks":4830,"open_issues":760,"watchers":12311,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18725"},"html":{"href":"https://github.com/symfony/symfony/pull/18725"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/18725"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/18725/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18725/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18725/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/d61cf07b3cc48829c2a63f8ee6e295caf9b0fa0a"}}}}