{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/510","labels_url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/510/labels{/name}","comments_url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/510/comments","events_url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/510/events","html_url":"https://github.com/facebook/facebook-php-sdk-v4/pull/510","id":111292198,"number":510,"title":"[RFC] Complexity reduction","user":{"login":"EmanueleMinotto","id":417201,"avatar_url":"https://avatars.githubusercontent.com/u/417201?v=3","gravatar_id":"","url":"https://api.github.com/users/EmanueleMinotto","html_url":"https://github.com/EmanueleMinotto","followers_url":"https://api.github.com/users/EmanueleMinotto/followers","following_url":"https://api.github.com/users/EmanueleMinotto/following{/other_user}","gists_url":"https://api.github.com/users/EmanueleMinotto/gists{/gist_id}","starred_url":"https://api.github.com/users/EmanueleMinotto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EmanueleMinotto/subscriptions","organizations_url":"https://api.github.com/users/EmanueleMinotto/orgs","repos_url":"https://api.github.com/users/EmanueleMinotto/repos","events_url":"https://api.github.com/users/EmanueleMinotto/events{/privacy}","received_events_url":"https://api.github.com/users/EmanueleMinotto/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/labels/CLA%20Signed","name":"CLA Signed","color":"009900"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-10-13T23:27:04Z","updated_at":"2015-10-15T01:44:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/pulls/510","html_url":"https://github.com/facebook/facebook-php-sdk-v4/pull/510","diff_url":"https://github.com/facebook/facebook-php-sdk-v4/pull/510.diff","patch_url":"https://github.com/facebook/facebook-php-sdk-v4/pull/510.patch"},"body":"To solve the `Facebook\\Facebook` constructor complexity problem (defined on [Scrutinizer]()), I've splitted it into different factories:\r\n\r\n* `Facebook\\PseudoRandomString\\PseudoRandomStringGeneratorFactory`\r\n* `Facebook\\HttpClients\\HttpClientsFactory`\r\n* `Facebook\\PersistentData\\PersistentDataFactory`\r\n\r\nThis should also allow you to move different detection logic into these factories and keeping some other classes' focus on their behaviour and responsabilities.\r\n\r\nAnother small change I did is the removal of an `\\InvalidArgumentException` exception replicating a setter logic (afaik).\r\n\r\nOf course I'll add related tests and documentation if the RFC is accepted."},"comment":{"url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/comments/148251978","html_url":"https://github.com/facebook/facebook-php-sdk-v4/pull/510#issuecomment-148251978","issue_url":"https://api.github.com/repos/facebook/facebook-php-sdk-v4/issues/510","id":148251978,"user":{"login":"gfosco","id":406732,"avatar_url":"https://avatars.githubusercontent.com/u/406732?v=3","gravatar_id":"","url":"https://api.github.com/users/gfosco","html_url":"https://github.com/gfosco","followers_url":"https://api.github.com/users/gfosco/followers","following_url":"https://api.github.com/users/gfosco/following{/other_user}","gists_url":"https://api.github.com/users/gfosco/gists{/gist_id}","starred_url":"https://api.github.com/users/gfosco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfosco/subscriptions","organizations_url":"https://api.github.com/users/gfosco/orgs","repos_url":"https://api.github.com/users/gfosco/repos","events_url":"https://api.github.com/users/gfosco/events{/privacy}","received_events_url":"https://api.github.com/users/gfosco/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T01:44:38Z","updated_at":"2015-10-15T01:44:38Z","body":"You have my :+1:  :smiley: "}}