{"action":"created","issue":{"url":"https://api.github.com/repos/drupal-composer/drupal-scaffold/issues/4","labels_url":"https://api.github.com/repos/drupal-composer/drupal-scaffold/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/drupal-composer/drupal-scaffold/issues/4/comments","events_url":"https://api.github.com/repos/drupal-composer/drupal-scaffold/issues/4/events","html_url":"https://github.com/drupal-composer/drupal-scaffold/pull/4","id":120079497,"number":4,"title":"Scaffold command","user":{"login":"greg-1-anderson","id":612191,"avatar_url":"https://avatars.githubusercontent.com/u/612191?v=3","gravatar_id":"","url":"https://api.github.com/users/greg-1-anderson","html_url":"https://github.com/greg-1-anderson","followers_url":"https://api.github.com/users/greg-1-anderson/followers","following_url":"https://api.github.com/users/greg-1-anderson/following{/other_user}","gists_url":"https://api.github.com/users/greg-1-anderson/gists{/gist_id}","starred_url":"https://api.github.com/users/greg-1-anderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg-1-anderson/subscriptions","organizations_url":"https://api.github.com/users/greg-1-anderson/orgs","repos_url":"https://api.github.com/users/greg-1-anderson/repos","events_url":"https://api.github.com/users/greg-1-anderson/events{/privacy}","received_events_url":"https://api.github.com/users/greg-1-anderson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-03T02:11:16Z","updated_at":"2015-12-03T02:13:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/drupal-composer/drupal-scaffold/pulls/4","html_url":"https://github.com/drupal-composer/drupal-scaffold/pull/4","diff_url":"https://github.com/drupal-composer/drupal-scaffold/pull/4.diff","patch_url":"https://github.com/drupal-composer/drupal-scaffold/pull/4.patch"},"body":"This is a continuation of #3.  I didn't like the way the static methods were proliferating. It did not matter for some of the simple methods, but if one were to imaging the complexity of a composer installer expanding, it would become increasingly inconvenient to not have access to the plugin and handler instances in command callbacks. The catch-22 here is that the command callback must be static; as more of the functionality of a Composer plugin is exposed to custom commands, more of its implementation is forced into static methods. This did not feel right.\r\n\r\nIn this PR, the plugin manager is used like a service container to recover our Plugin instance. Also introduced is a dispatching pattern that can be used to add any number of commands, as needed. Again, possibly not needed here, but I prefer the more maintainable version presented here."},"comment":{"url":"https://api.github.com/repos/drupal-composer/drupal-scaffold/issues/comments/161494979","html_url":"https://github.com/drupal-composer/drupal-scaffold/pull/4#issuecomment-161494979","issue_url":"https://api.github.com/repos/drupal-composer/drupal-scaffold/issues/4","id":161494979,"user":{"login":"greg-1-anderson","id":612191,"avatar_url":"https://avatars.githubusercontent.com/u/612191?v=3","gravatar_id":"","url":"https://api.github.com/users/greg-1-anderson","html_url":"https://github.com/greg-1-anderson","followers_url":"https://api.github.com/users/greg-1-anderson/followers","following_url":"https://api.github.com/users/greg-1-anderson/following{/other_user}","gists_url":"https://api.github.com/users/greg-1-anderson/gists{/gist_id}","starred_url":"https://api.github.com/users/greg-1-anderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/greg-1-anderson/subscriptions","organizations_url":"https://api.github.com/users/greg-1-anderson/orgs","repos_url":"https://api.github.com/users/greg-1-anderson/repos","events_url":"https://api.github.com/users/greg-1-anderson/events{/privacy}","received_events_url":"https://api.github.com/users/greg-1-anderson/received_events","type":"User","site_admin":false},"created_at":"2015-12-03T02:13:23Z","updated_at":"2015-12-03T02:13:23Z","body":"There was no need for me to reimplement postCmd() or cache $io; these changes came about by other things I tried, and ended up backing out.  Visible in the commit history, if anyone is interested, but not particularly relevant to the final result."}}