{"action":"opened","number":1104,"pull_request":{"url":"https://api.github.com/repos/slimphp/Slim/pulls/1104","id":31356544,"html_url":"https://github.com/slimphp/Slim/pull/1104","diff_url":"https://github.com/slimphp/Slim/pull/1104.diff","patch_url":"https://github.com/slimphp/Slim/pull/1104.patch","issue_url":"https://api.github.com/repos/slimphp/Slim/issues/1104","number":1104,"state":"open","locked":false,"title":"Reopend Callback middleware","user":{"login":"kanellov","id":1442736,"avatar_url":"https://avatars.githubusercontent.com/u/1442736?v=3","gravatar_id":"","url":"https://api.github.com/users/kanellov","html_url":"https://github.com/kanellov","followers_url":"https://api.github.com/users/kanellov/followers","following_url":"https://api.github.com/users/kanellov/following{/other_user}","gists_url":"https://api.github.com/users/kanellov/gists{/gist_id}","starred_url":"https://api.github.com/users/kanellov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanellov/subscriptions","organizations_url":"https://api.github.com/users/kanellov/orgs","repos_url":"https://api.github.com/users/kanellov/repos","events_url":"https://api.github.com/users/kanellov/events{/privacy}","received_events_url":"https://api.github.com/users/kanellov/received_events","type":"User","site_admin":false},"body":"Hello,\r\nI'm opening a new PR (previous #1103) against master branch, instead develop, since it's use is  for Slim 3.\r\nI have created a middleware class for **Slim 2** that uses a callable in its call method. I have been using it for a while in my projects with Slim and I think it's very handy, especially in prototypes. Here's an example\r\n\r\n```php\r\n<?php\r\n\r\n$app = new Slim\\Slim();\r\n$app->add(new Slim\\Middleware\\Callback(function ($app, $next) {\r\n    // do some work ...\r\n    // call next middleware\r\n   $next->call(); \r\n   // do some extra work ...\r\n});\r\n```","created_at":"2015-03-17T17:13:50Z","updated_at":"2015-03-17T17:13:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/slimphp/Slim/pulls/1104/commits","review_comments_url":"https://api.github.com/repos/slimphp/Slim/pulls/1104/comments","review_comment_url":"https://api.github.com/repos/slimphp/Slim/pulls/comments{/number}","comments_url":"https://api.github.com/repos/slimphp/Slim/issues/1104/comments","statuses_url":"https://api.github.com/repos/slimphp/Slim/statuses/07e09477131547be4bdf4bcf6be6ac627d30ebe8","head":{"label":"kanellov:feature/callback_middleware","ref":"feature/callback_middleware","sha":"07e09477131547be4bdf4bcf6be6ac627d30ebe8","user":{"login":"kanellov","id":1442736,"avatar_url":"https://avatars.githubusercontent.com/u/1442736?v=3","gravatar_id":"","url":"https://api.github.com/users/kanellov","html_url":"https://github.com/kanellov","followers_url":"https://api.github.com/users/kanellov/followers","following_url":"https://api.github.com/users/kanellov/following{/other_user}","gists_url":"https://api.github.com/users/kanellov/gists{/gist_id}","starred_url":"https://api.github.com/users/kanellov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanellov/subscriptions","organizations_url":"https://api.github.com/users/kanellov/orgs","repos_url":"https://api.github.com/users/kanellov/repos","events_url":"https://api.github.com/users/kanellov/events{/privacy}","received_events_url":"https://api.github.com/users/kanellov/received_events","type":"User","site_admin":false},"repo":{"id":32400564,"name":"Slim","full_name":"kanellov/Slim","owner":{"login":"kanellov","id":1442736,"avatar_url":"https://avatars.githubusercontent.com/u/1442736?v=3","gravatar_id":"","url":"https://api.github.com/users/kanellov","html_url":"https://github.com/kanellov","followers_url":"https://api.github.com/users/kanellov/followers","following_url":"https://api.github.com/users/kanellov/following{/other_user}","gists_url":"https://api.github.com/users/kanellov/gists{/gist_id}","starred_url":"https://api.github.com/users/kanellov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kanellov/subscriptions","organizations_url":"https://api.github.com/users/kanellov/orgs","repos_url":"https://api.github.com/users/kanellov/repos","events_url":"https://api.github.com/users/kanellov/events{/privacy}","received_events_url":"https://api.github.com/users/kanellov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kanellov/Slim","description":"Slim Framework source code","fork":true,"url":"https://api.github.com/repos/kanellov/Slim","forks_url":"https://api.github.com/repos/kanellov/Slim/forks","keys_url":"https://api.github.com/repos/kanellov/Slim/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kanellov/Slim/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kanellov/Slim/teams","hooks_url":"https://api.github.com/repos/kanellov/Slim/hooks","issue_events_url":"https://api.github.com/repos/kanellov/Slim/issues/events{/number}","events_url":"https://api.github.com/repos/kanellov/Slim/events","assignees_url":"https://api.github.com/repos/kanellov/Slim/assignees{/user}","branches_url":"https://api.github.com/repos/kanellov/Slim/branches{/branch}","tags_url":"https://api.github.com/repos/kanellov/Slim/tags","blobs_url":"https://api.github.com/repos/kanellov/Slim/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kanellov/Slim/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kanellov/Slim/git/refs{/sha}","trees_url":"https://api.github.com/repos/kanellov/Slim/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kanellov/Slim/statuses/{sha}","languages_url":"https://api.github.com/repos/kanellov/Slim/languages","stargazers_url":"https://api.github.com/repos/kanellov/Slim/stargazers","contributors_url":"https://api.github.com/repos/kanellov/Slim/contributors","subscribers_url":"https://api.github.com/repos/kanellov/Slim/subscribers","subscription_url":"https://api.github.com/repos/kanellov/Slim/subscription","commits_url":"https://api.github.com/repos/kanellov/Slim/commits{/sha}","git_commits_url":"https://api.github.com/repos/kanellov/Slim/git/commits{/sha}","comments_url":"https://api.github.com/repos/kanellov/Slim/comments{/number}","issue_comment_url":"https://api.github.com/repos/kanellov/Slim/issues/comments{/number}","contents_url":"https://api.github.com/repos/kanellov/Slim/contents/{+path}","compare_url":"https://api.github.com/repos/kanellov/Slim/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kanellov/Slim/merges","archive_url":"https://api.github.com/repos/kanellov/Slim/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kanellov/Slim/downloads","issues_url":"https://api.github.com/repos/kanellov/Slim/issues{/number}","pulls_url":"https://api.github.com/repos/kanellov/Slim/pulls{/number}","milestones_url":"https://api.github.com/repos/kanellov/Slim/milestones{/number}","notifications_url":"https://api.github.com/repos/kanellov/Slim/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kanellov/Slim/labels{/name}","releases_url":"https://api.github.com/repos/kanellov/Slim/releases{/id}","created_at":"2015-03-17T15:06:13Z","updated_at":"2015-03-17T15:06:14Z","pushed_at":"2015-03-17T16:01:52Z","git_url":"git://github.com/kanellov/Slim.git","ssh_url":"git@github.com:kanellov/Slim.git","clone_url":"https://github.com/kanellov/Slim.git","svn_url":"https://github.com/kanellov/Slim","homepage":"http://slimframework.com","size":8296,"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:master","ref":"master","sha":"f2868820476a80323a468b1ba054c82d9419b7bd","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-03-17T14:53:25Z","pushed_at":"2015-03-17T14:35:16Z","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":8296,"stargazers_count":4820,"watchers_count":4820,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":870,"mirror_url":null,"open_issues_count":16,"forks":870,"open_issues":16,"watchers":4820,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/slimphp/Slim/pulls/1104"},"html":{"href":"https://github.com/slimphp/Slim/pull/1104"},"issue":{"href":"https://api.github.com/repos/slimphp/Slim/issues/1104"},"comments":{"href":"https://api.github.com/repos/slimphp/Slim/issues/1104/comments"},"review_comments":{"href":"https://api.github.com/repos/slimphp/Slim/pulls/1104/comments"},"review_comment":{"href":"https://api.github.com/repos/slimphp/Slim/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/slimphp/Slim/pulls/1104/commits"},"statuses":{"href":"https://api.github.com/repos/slimphp/Slim/statuses/07e09477131547be4bdf4bcf6be6ac627d30ebe8"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":192,"deletions":0,"changed_files":2}}