{"action":"created","comment":{"url":"https://api.github.com/repos/slimphp/Slim/pulls/comments/37250102","id":37250102,"diff_hunk":"@@ -25,87 +24,58 @@\n     private $container;\n \n     /**\n-     * @var string\n-     */\n-    private $toResolve;\n-\n-    /**\n-     * @var callable\n-     */\n-    private $resolved;\n-\n-    /**\n      * @param ContainerInterface $container\n-     * @param string             $toResolve\n      */\n-    public function __construct(ContainerInterface $container, $toResolve = null)\n+    public function __construct(ContainerInterface $container)\n     {\n-        $this->toResolve = $toResolve;\n         $this->container = $container;\n     }\n \n-\n-    /**\n-     * Receive a string that is to be resolved to a callable\n-     *\n-     * @param  string $toResolve\n-     */\n-    public function setToResolve($toResolve)\n-    {\n-        $this->toResolve = $toResolve;\n-    }\n-\n     /**\n      * Resolve toResolve into a closure that that the router can dispatch.","path":"Slim/CallableResolver.php","position":46,"original_position":46,"commit_id":"bd8ee716f62ff853e616b6509df3b8e34b92423a","original_commit_id":"bd8ee716f62ff853e616b6509df3b8e34b92423a","user":{"login":"JoeBengalen","id":11173689,"avatar_url":"https://avatars.githubusercontent.com/u/11173689?v=3","gravatar_id":"","url":"https://api.github.com/users/JoeBengalen","html_url":"https://github.com/JoeBengalen","followers_url":"https://api.github.com/users/JoeBengalen/followers","following_url":"https://api.github.com/users/JoeBengalen/following{/other_user}","gists_url":"https://api.github.com/users/JoeBengalen/gists{/gist_id}","starred_url":"https://api.github.com/users/JoeBengalen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoeBengalen/subscriptions","organizations_url":"https://api.github.com/users/JoeBengalen/orgs","repos_url":"https://api.github.com/users/JoeBengalen/repos","events_url":"https://api.github.com/users/JoeBengalen/events{/privacy}","received_events_url":"https://api.github.com/users/JoeBengalen/received_events","type":"User","site_admin":false},"body":"Comment is outdated","created_at":"2015-08-17T23:38:28Z","updated_at":"2015-08-17T23:38:28Z","html_url":"https://github.com/slimphp/Slim/pull/1448#discussion_r37250102","pull_request_url":"https://api.github.com/repos/slimphp/Slim/pulls/1448","_links":{"self":{"href":"https://api.github.com/repos/slimphp/Slim/pulls/comments/37250102"},"html":{"href":"https://github.com/slimphp/Slim/pull/1448#discussion_r37250102"},"pull_request":{"href":"https://api.github.com/repos/slimphp/Slim/pulls/1448"}}},"pull_request":{"url":"https://api.github.com/repos/slimphp/Slim/pulls/1448","id":42636334,"html_url":"https://github.com/slimphp/Slim/pull/1448","diff_url":"https://github.com/slimphp/Slim/pull/1448.diff","patch_url":"https://github.com/slimphp/Slim/pull/1448.patch","issue_url":"https://api.github.com/repos/slimphp/Slim/issues/1448","number":1448,"state":"open","locked":false,"title":"Refactored CallableResolver into a stateless service focused on resolving callables only","user":{"login":"mnapoli","id":720328,"avatar_url":"https://avatars.githubusercontent.com/u/720328?v=3","gravatar_id":"","url":"https://api.github.com/users/mnapoli","html_url":"https://github.com/mnapoli","followers_url":"https://api.github.com/users/mnapoli/followers","following_url":"https://api.github.com/users/mnapoli/following{/other_user}","gists_url":"https://api.github.com/users/mnapoli/gists{/gist_id}","starred_url":"https://api.github.com/users/mnapoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnapoli/subscriptions","organizations_url":"https://api.github.com/users/mnapoli/orgs","repos_url":"https://api.github.com/users/mnapoli/repos","events_url":"https://api.github.com/users/mnapoli/events{/privacy}","received_events_url":"https://api.github.com/users/mnapoli/received_events","type":"User","site_admin":false},"body":"Per discussions on IRC, I refactored CallableResolver into a stateless service focused on resolving callables only (not wrapping and invoking them).\r\n\r\nThis will lead to less object instantiations (since the service is now stateless instead of wrapping every middleware/controller callable), as well as better separation of concerns since the class' responsibility is now only to resolve callables. It isn't responsible of invoking callables anymore (responsibility which was spread between here and also the invokation strategy and middleware stack too IIRC).\r\n\r\nOne detail is that I have moved the `$callable->bindTo($container)` calls into the CallableResolver itself since it belongs there IMO (because it's about preparing callables for being invokable correctly). That avoids having \"callable resolution\" code all over the place (App and Route).\r\n\r\nFeedback welcome. I'll probably be able to answer and update the PR in 2 days.","created_at":"2015-08-17T21:28:14Z","updated_at":"2015-08-17T23:38:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9d94a5c8e3e70f4f52badd3770d9f7b980de7728","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/slimphp/Slim/pulls/1448/commits","review_comments_url":"https://api.github.com/repos/slimphp/Slim/pulls/1448/comments","review_comment_url":"https://api.github.com/repos/slimphp/Slim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/slimphp/Slim/issues/1448/comments","statuses_url":"https://api.github.com/repos/slimphp/Slim/statuses/bd8ee716f62ff853e616b6509df3b8e34b92423a","head":{"label":"mnapoli:simpler_callable_handling","ref":"simpler_callable_handling","sha":"bd8ee716f62ff853e616b6509df3b8e34b92423a","user":{"login":"mnapoli","id":720328,"avatar_url":"https://avatars.githubusercontent.com/u/720328?v=3","gravatar_id":"","url":"https://api.github.com/users/mnapoli","html_url":"https://github.com/mnapoli","followers_url":"https://api.github.com/users/mnapoli/followers","following_url":"https://api.github.com/users/mnapoli/following{/other_user}","gists_url":"https://api.github.com/users/mnapoli/gists{/gist_id}","starred_url":"https://api.github.com/users/mnapoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnapoli/subscriptions","organizations_url":"https://api.github.com/users/mnapoli/orgs","repos_url":"https://api.github.com/users/mnapoli/repos","events_url":"https://api.github.com/users/mnapoli/events{/privacy}","received_events_url":"https://api.github.com/users/mnapoli/received_events","type":"User","site_admin":false},"repo":{"id":34150849,"name":"Slim","full_name":"mnapoli/Slim","owner":{"login":"mnapoli","id":720328,"avatar_url":"https://avatars.githubusercontent.com/u/720328?v=3","gravatar_id":"","url":"https://api.github.com/users/mnapoli","html_url":"https://github.com/mnapoli","followers_url":"https://api.github.com/users/mnapoli/followers","following_url":"https://api.github.com/users/mnapoli/following{/other_user}","gists_url":"https://api.github.com/users/mnapoli/gists{/gist_id}","starred_url":"https://api.github.com/users/mnapoli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnapoli/subscriptions","organizations_url":"https://api.github.com/users/mnapoli/orgs","repos_url":"https://api.github.com/users/mnapoli/repos","events_url":"https://api.github.com/users/mnapoli/events{/privacy}","received_events_url":"https://api.github.com/users/mnapoli/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mnapoli/Slim","description":"Slim Framework source code","fork":true,"url":"https://api.github.com/repos/mnapoli/Slim","forks_url":"https://api.github.com/repos/mnapoli/Slim/forks","keys_url":"https://api.github.com/repos/mnapoli/Slim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mnapoli/Slim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mnapoli/Slim/teams","hooks_url":"https://api.github.com/repos/mnapoli/Slim/hooks","issue_events_url":"https://api.github.com/repos/mnapoli/Slim/issues/events{/number}","events_url":"https://api.github.com/repos/mnapoli/Slim/events","assignees_url":"https://api.github.com/repos/mnapoli/Slim/assignees{/user}","branches_url":"https://api.github.com/repos/mnapoli/Slim/branches{/branch}","tags_url":"https://api.github.com/repos/mnapoli/Slim/tags","blobs_url":"https://api.github.com/repos/mnapoli/Slim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mnapoli/Slim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mnapoli/Slim/git/refs{/sha}","trees_url":"https://api.github.com/repos/mnapoli/Slim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mnapoli/Slim/statuses/{sha}","languages_url":"https://api.github.com/repos/mnapoli/Slim/languages","stargazers_url":"https://api.github.com/repos/mnapoli/Slim/stargazers","contributors_url":"https://api.github.com/repos/mnapoli/Slim/contributors","subscribers_url":"https://api.github.com/repos/mnapoli/Slim/subscribers","subscription_url":"https://api.github.com/repos/mnapoli/Slim/subscription","commits_url":"https://api.github.com/repos/mnapoli/Slim/commits{/sha}","git_commits_url":"https://api.github.com/repos/mnapoli/Slim/git/commits{/sha}","comments_url":"https://api.github.com/repos/mnapoli/Slim/comments{/number}","issue_comment_url":"https://api.github.com/repos/mnapoli/Slim/issues/comments{/number}","contents_url":"https://api.github.com/repos/mnapoli/Slim/contents/{+path}","compare_url":"https://api.github.com/repos/mnapoli/Slim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mnapoli/Slim/merges","archive_url":"https://api.github.com/repos/mnapoli/Slim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mnapoli/Slim/downloads","issues_url":"https://api.github.com/repos/mnapoli/Slim/issues{/number}","pulls_url":"https://api.github.com/repos/mnapoli/Slim/pulls{/number}","milestones_url":"https://api.github.com/repos/mnapoli/Slim/milestones{/number}","notifications_url":"https://api.github.com/repos/mnapoli/Slim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mnapoli/Slim/labels{/name}","releases_url":"https://api.github.com/repos/mnapoli/Slim/releases{/id}","created_at":"2015-04-18T03:26:51Z","updated_at":"2015-04-18T03:26:52Z","pushed_at":"2015-08-17T21:24:46Z","git_url":"git://github.com/mnapoli/Slim.git","ssh_url":"git@github.com:mnapoli/Slim.git","clone_url":"https://github.com/mnapoli/Slim.git","svn_url":"https://github.com/mnapoli/Slim","homepage":"http://slimframework.com","size":4528,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"slimphp:3.x","ref":"3.x","sha":"a76fa0166aa0e2f9ed44a3032e7e7a1bd39ab06d","user":{"login":"slimphp","id":11195762,"avatar_url":"https://avatars.githubusercontent.com/u/11195762?v=3","gravatar_id":"","url":"https://api.github.com/users/slimphp","html_url":"https://github.com/slimphp","followers_url":"https://api.github.com/users/slimphp/followers","following_url":"https://api.github.com/users/slimphp/following{/other_user}","gists_url":"https://api.github.com/users/slimphp/gists{/gist_id}","starred_url":"https://api.github.com/users/slimphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimphp/subscriptions","organizations_url":"https://api.github.com/users/slimphp/orgs","repos_url":"https://api.github.com/users/slimphp/repos","events_url":"https://api.github.com/users/slimphp/events{/privacy}","received_events_url":"https://api.github.com/users/slimphp/received_events","type":"Organization","site_admin":false},"repo":{"id":926544,"name":"Slim","full_name":"slimphp/Slim","owner":{"login":"slimphp","id":11195762,"avatar_url":"https://avatars.githubusercontent.com/u/11195762?v=3","gravatar_id":"","url":"https://api.github.com/users/slimphp","html_url":"https://github.com/slimphp","followers_url":"https://api.github.com/users/slimphp/followers","following_url":"https://api.github.com/users/slimphp/following{/other_user}","gists_url":"https://api.github.com/users/slimphp/gists{/gist_id}","starred_url":"https://api.github.com/users/slimphp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/slimphp/subscriptions","organizations_url":"https://api.github.com/users/slimphp/orgs","repos_url":"https://api.github.com/users/slimphp/repos","events_url":"https://api.github.com/users/slimphp/events{/privacy}","received_events_url":"https://api.github.com/users/slimphp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/slimphp/Slim","description":"Slim Framework source code","fork":false,"url":"https://api.github.com/repos/slimphp/Slim","forks_url":"https://api.github.com/repos/slimphp/Slim/forks","keys_url":"https://api.github.com/repos/slimphp/Slim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/slimphp/Slim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/slimphp/Slim/teams","hooks_url":"https://api.github.com/repos/slimphp/Slim/hooks","issue_events_url":"https://api.github.com/repos/slimphp/Slim/issues/events{/number}","events_url":"https://api.github.com/repos/slimphp/Slim/events","assignees_url":"https://api.github.com/repos/slimphp/Slim/assignees{/user}","branches_url":"https://api.github.com/repos/slimphp/Slim/branches{/branch}","tags_url":"https://api.github.com/repos/slimphp/Slim/tags","blobs_url":"https://api.github.com/repos/slimphp/Slim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/slimphp/Slim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/slimphp/Slim/git/refs{/sha}","trees_url":"https://api.github.com/repos/slimphp/Slim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/slimphp/Slim/statuses/{sha}","languages_url":"https://api.github.com/repos/slimphp/Slim/languages","stargazers_url":"https://api.github.com/repos/slimphp/Slim/stargazers","contributors_url":"https://api.github.com/repos/slimphp/Slim/contributors","subscribers_url":"https://api.github.com/repos/slimphp/Slim/subscribers","subscription_url":"https://api.github.com/repos/slimphp/Slim/subscription","commits_url":"https://api.github.com/repos/slimphp/Slim/commits{/sha}","git_commits_url":"https://api.github.com/repos/slimphp/Slim/git/commits{/sha}","comments_url":"https://api.github.com/repos/slimphp/Slim/comments{/number}","issue_comment_url":"https://api.github.com/repos/slimphp/Slim/issues/comments{/number}","contents_url":"https://api.github.com/repos/slimphp/Slim/contents/{+path}","compare_url":"https://api.github.com/repos/slimphp/Slim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/slimphp/Slim/merges","archive_url":"https://api.github.com/repos/slimphp/Slim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/slimphp/Slim/downloads","issues_url":"https://api.github.com/repos/slimphp/Slim/issues{/number}","pulls_url":"https://api.github.com/repos/slimphp/Slim/pulls{/number}","milestones_url":"https://api.github.com/repos/slimphp/Slim/milestones{/number}","notifications_url":"https://api.github.com/repos/slimphp/Slim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/slimphp/Slim/labels{/name}","releases_url":"https://api.github.com/repos/slimphp/Slim/releases{/id}","created_at":"2010-09-21T01:17:06Z","updated_at":"2015-08-17T21:37:43Z","pushed_at":"2015-08-17T22:13:55Z","git_url":"git://github.com/slimphp/Slim.git","ssh_url":"git@github.com:slimphp/Slim.git","clone_url":"https://github.com/slimphp/Slim.git","svn_url":"https://github.com/slimphp/Slim","homepage":"http://slimframework.com","size":9661,"stargazers_count":5610,"watchers_count":5610,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1045,"mirror_url":null,"open_issues_count":28,"forks":1045,"open_issues":28,"watchers":5610,"default_branch":"2.x"}},"_links":{"self":{"href":"https://api.github.com/repos/slimphp/Slim/pulls/1448"},"html":{"href":"https://github.com/slimphp/Slim/pull/1448"},"issue":{"href":"https://api.github.com/repos/slimphp/Slim/issues/1448"},"comments":{"href":"https://api.github.com/repos/slimphp/Slim/issues/1448/comments"},"review_comments":{"href":"https://api.github.com/repos/slimphp/Slim/pulls/1448/comments"},"review_comment":{"href":"https://api.github.com/repos/slimphp/Slim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/slimphp/Slim/pulls/1448/commits"},"statuses":{"href":"https://api.github.com/repos/slimphp/Slim/statuses/bd8ee716f62ff853e616b6509df3b8e34b92423a"}}}}