{"action":"created","comment":{"url":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls/comments/220022593","pull_request_review_id":158335527,"id":220022593,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDAyMjU5Mw==","diff_hunk":"@@ -0,0 +1,169 @@\n+<?php\n+\n+namespace Drupal\\hs_bugherd\\Form;\n+\n+use Drupal\\Core\\Entity\\EntityForm;\n+use Drupal\\Core\\Form\\FormStateInterface;\n+use Drupal\\hs_bugherd\\HsBugherd;\n+use Symfony\\Component\\DependencyInjection\\ContainerInterface;\n+\n+/**\n+ * Class BugherdConnectionForm.\n+ *\n+ * @package Drupal\\hs_bugherd\\Form\n+ */\n+class BugherdConnectionForm extends EntityForm {\n+\n+  /**\n+   * Bugherd API service.\n+   *\n+   * @var \\Drupal\\hs_bugherd\\HsBugherd\n+   */\n+  protected $bugherdApi;\n+\n+  /**\n+   * {@inheritdoc}\n+   */\n+  public static function create(ContainerInterface $container) {\n+    return new static(\n+      $container->get('hs_bugherd')\n+    );\n+  }\n+\n+  /**\n+   * {@inheritdoc}\n+   */\n+  public function __construct(HsBugherd $bugherd_api) {\n+    $this->bugherdApi = $bugherd_api;\n+  }\n+\n+  /**\n+   * {@inheritdoc}\n+   */\n+  public function form(array $form, FormStateInterface $form_state) {\n+    $form = parent::form($form, $form_state);\n+\n+    /** @var \\Drupal\\hs_bugherd\\Entity\\BugherdConnection $bugherd */\n+    $bugherd = $this->entity;\n+\n+    $form['label'] = [\n+      '#type' => 'textfield',\n+      '#title' => $this->t('Label'),\n+      '#maxlength' => 255,\n+      '#default_value' => $bugherd->label(),\n+      '#description' => $this->t(\"Label for the Bugherd Connection.\"),\n+      '#required' => TRUE,\n+    ];\n+    $form['id'] = [\n+      '#type' => 'machine_name',\n+      '#default_value' => $bugherd->id(),\n+      '#machine_name' => [\n+        'exists' => '\\Drupal\\hs_bugherd\\Entity\\BugherdConnection::load',\n+      ],\n+      '#disabled' => !$bugherd->isNew(),\n+    ];\n+\n+    $form['bugherdProject'] = [\n+      '#type' => 'select',\n+      '#title' => $this->t('Bugherd Project'),\n+      '#default_value' => $bugherd->getBugherdProject(),\n+      '#options' => $this->bugherdApi->getProjects(),\n+    ];\n+\n+    $form['jiraProject'] = [\n+      '#type' => 'textfield',\n+      '#title' => $this->t('Jira Project'),\n+      '#description' => $this->t('Which Jira project to connect with'),\n+      '#default_value' => $bugherd->getJiraProject(),\n+      '#required' => TRUE,\n+    ];\n+\n+    $form['urls'] = [\n+      '#type' => 'textarea',\n+      '#title' => $this->t('Website urls'),\n+      '#required' => TRUE,\n+      '#default_value' => implode(\"\\n\", $bugherd->getUrls()),\n+    ];\n+\n+    $form['statusMap'] = [\n+      '#type' => 'fieldset',\n+      '#title' => $this->t('Bugherd to Jira Mapping'),\n+      '#tree' => TRUE,\n+    ];\n+\n+    $statusMap = $bugherd->getStatusMap();\n+    $form['statusMap'][HsBugherd::BUGHERDAPI_BACKLOG] = [\n+      '#type' => 'textfield',\n+      '#title' => $this->t('Backlog Status'),\n+      '#description' => $this->t('The JIRA status code for a \"Backlog\" status. Use comma separated numbers for multiple states.'),\n+      '#required' => TRUE,\n+      '#default_value' => $statusMap[HsBugherd::BUGHERDAPI_BACKLOG] ?? '',\n+    ];\n+    $form['statusMap'][HsBugherd::BUGHERDAPI_TODO] = [\n+      '#type' => 'textfield',\n+      '#title' => $this->t('ToDo Status'),\n+      '#description' => $this->t('The JIRA status code for a \"To Do\" status. Use comma separated numbers for multiple states.'),\n+      '#required' => TRUE,\n+      '#default_value' => $statusMap[HsBugherd::BUGHERDAPI_TODO] ?? '',\n+    ];\n+\n+    $form['statusMap'][HsBugherd::BUGHERDAPI_DOING] = [\n+      '#type' => 'textfield',\n+      '#title' => $this->t('Doing Status'),\n+      '#description' => $this->t('The JIRA status code for a \"Doing\" status. Use comma separated numbers for multiple states.'),\n+      '#required' => TRUE,\n+      '#default_value' => $statusMap[HsBugherd::BUGHERDAPI_DOING] ?? '',\n+    ];\n+\n+    $form['statusMap'][HsBugherd::BUGHERDAPI_DONE] = [","path":"docroot/modules/humsci/hs_bugherd/src/Form/BugherdConnectionForm.php","position":118,"original_position":118,"commit_id":"8231960ce163e781f41ce2699c0306e1920fe680","original_commit_id":"8231960ce163e781f41ce2699c0306e1920fe680","user":{"login":"codeclimate[bot]","id":36754821,"node_id":"MDM6Qm90MzY3NTQ4MjE=","avatar_url":"https://avatars0.githubusercontent.com/in/9403?v=4","gravatar_id":"","url":"https://api.github.com/users/codeclimate%5Bbot%5D","html_url":"https://github.com/apps/codeclimate","followers_url":"https://api.github.com/users/codeclimate%5Bbot%5D/followers","following_url":"https://api.github.com/users/codeclimate%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/codeclimate%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/codeclimate%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeclimate%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/codeclimate%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/codeclimate%5Bbot%5D/repos","events_url":"https://api.github.com/users/codeclimate%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/codeclimate%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"Similar blocks of code found in 5 locations. Consider refactoring.","created_at":"2018-09-24T23:45:32Z","updated_at":"2018-09-24T23:45:33Z","html_url":"https://github.com/SU-HSDO/suhumsci/pull/107#discussion_r220022593","pull_request_url":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls/107","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls/comments/220022593"},"html":{"href":"https://github.com/SU-HSDO/suhumsci/pull/107#discussion_r220022593"},"pull_request":{"href":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls/107"}}},"pull_request":{"url":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls/107","id":217817640,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3ODE3NjQw","html_url":"https://github.com/SU-HSDO/suhumsci/pull/107","diff_url":"https://github.com/SU-HSDO/suhumsci/pull/107.diff","patch_url":"https://github.com/SU-HSDO/suhumsci/pull/107.patch","issue_url":"https://api.github.com/repos/SU-HSDO/suhumsci/issues/107","number":107,"state":"open","locked":false,"title":"Hsd8 370 rearchitect bugherd","user":{"login":"pookmish","id":7185045,"node_id":"MDQ6VXNlcjcxODUwNDU=","avatar_url":"https://avatars0.githubusercontent.com/u/7185045?v=4","gravatar_id":"","url":"https://api.github.com/users/pookmish","html_url":"https://github.com/pookmish","followers_url":"https://api.github.com/users/pookmish/followers","following_url":"https://api.github.com/users/pookmish/following{/other_user}","gists_url":"https://api.github.com/users/pookmish/gists{/gist_id}","starred_url":"https://api.github.com/users/pookmish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pookmish/subscriptions","organizations_url":"https://api.github.com/users/pookmish/orgs","repos_url":"https://api.github.com/users/pookmish/repos","events_url":"https://api.github.com/users/pookmish/events{/privacy}","received_events_url":"https://api.github.com/users/pookmish/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-09-24T23:36:14Z","updated_at":"2018-09-24T23:45:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b0c37211e211ef4e8970e71bbd479a37b79cbce","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls/107/commits","review_comments_url":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls/107/comments","review_comment_url":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SU-HSDO/suhumsci/issues/107/comments","statuses_url":"https://api.github.com/repos/SU-HSDO/suhumsci/statuses/8231960ce163e781f41ce2699c0306e1920fe680","head":{"label":"SU-HSDO:HSD8-370-rearchitect-bugherd","ref":"HSD8-370-rearchitect-bugherd","sha":"8231960ce163e781f41ce2699c0306e1920fe680","user":{"login":"SU-HSDO","id":14912945,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTEyOTQ1","avatar_url":"https://avatars0.githubusercontent.com/u/14912945?v=4","gravatar_id":"","url":"https://api.github.com/users/SU-HSDO","html_url":"https://github.com/SU-HSDO","followers_url":"https://api.github.com/users/SU-HSDO/followers","following_url":"https://api.github.com/users/SU-HSDO/following{/other_user}","gists_url":"https://api.github.com/users/SU-HSDO/gists{/gist_id}","starred_url":"https://api.github.com/users/SU-HSDO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SU-HSDO/subscriptions","organizations_url":"https://api.github.com/users/SU-HSDO/orgs","repos_url":"https://api.github.com/users/SU-HSDO/repos","events_url":"https://api.github.com/users/SU-HSDO/events{/privacy}","received_events_url":"https://api.github.com/users/SU-HSDO/received_events","type":"Organization","site_admin":false},"repo":{"id":129976545,"node_id":"MDEwOlJlcG9zaXRvcnkxMjk5NzY1NDU=","name":"suhumsci","full_name":"SU-HSDO/suhumsci","private":false,"owner":{"login":"SU-HSDO","id":14912945,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTEyOTQ1","avatar_url":"https://avatars0.githubusercontent.com/u/14912945?v=4","gravatar_id":"","url":"https://api.github.com/users/SU-HSDO","html_url":"https://github.com/SU-HSDO","followers_url":"https://api.github.com/users/SU-HSDO/followers","following_url":"https://api.github.com/users/SU-HSDO/following{/other_user}","gists_url":"https://api.github.com/users/SU-HSDO/gists{/gist_id}","starred_url":"https://api.github.com/users/SU-HSDO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SU-HSDO/subscriptions","organizations_url":"https://api.github.com/users/SU-HSDO/orgs","repos_url":"https://api.github.com/users/SU-HSDO/repos","events_url":"https://api.github.com/users/SU-HSDO/events{/privacy}","received_events_url":"https://api.github.com/users/SU-HSDO/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/SU-HSDO/suhumsci","description":"Acquia BLT tool for H&S Acquia Product","fork":false,"url":"https://api.github.com/repos/SU-HSDO/suhumsci","forks_url":"https://api.github.com/repos/SU-HSDO/suhumsci/forks","keys_url":"https://api.github.com/repos/SU-HSDO/suhumsci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SU-HSDO/suhumsci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SU-HSDO/suhumsci/teams","hooks_url":"https://api.github.com/repos/SU-HSDO/suhumsci/hooks","issue_events_url":"https://api.github.com/repos/SU-HSDO/suhumsci/issues/events{/number}","events_url":"https://api.github.com/repos/SU-HSDO/suhumsci/events","assignees_url":"https://api.github.com/repos/SU-HSDO/suhumsci/assignees{/user}","branches_url":"https://api.github.com/repos/SU-HSDO/suhumsci/branches{/branch}","tags_url":"https://api.github.com/repos/SU-HSDO/suhumsci/tags","blobs_url":"https://api.github.com/repos/SU-HSDO/suhumsci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SU-HSDO/suhumsci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SU-HSDO/suhumsci/git/refs{/sha}","trees_url":"https://api.github.com/repos/SU-HSDO/suhumsci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SU-HSDO/suhumsci/statuses/{sha}","languages_url":"https://api.github.com/repos/SU-HSDO/suhumsci/languages","stargazers_url":"https://api.github.com/repos/SU-HSDO/suhumsci/stargazers","contributors_url":"https://api.github.com/repos/SU-HSDO/suhumsci/contributors","subscribers_url":"https://api.github.com/repos/SU-HSDO/suhumsci/subscribers","subscription_url":"https://api.github.com/repos/SU-HSDO/suhumsci/subscription","commits_url":"https://api.github.com/repos/SU-HSDO/suhumsci/commits{/sha}","git_commits_url":"https://api.github.com/repos/SU-HSDO/suhumsci/git/commits{/sha}","comments_url":"https://api.github.com/repos/SU-HSDO/suhumsci/comments{/number}","issue_comment_url":"https://api.github.com/repos/SU-HSDO/suhumsci/issues/comments{/number}","contents_url":"https://api.github.com/repos/SU-HSDO/suhumsci/contents/{+path}","compare_url":"https://api.github.com/repos/SU-HSDO/suhumsci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SU-HSDO/suhumsci/merges","archive_url":"https://api.github.com/repos/SU-HSDO/suhumsci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SU-HSDO/suhumsci/downloads","issues_url":"https://api.github.com/repos/SU-HSDO/suhumsci/issues{/number}","pulls_url":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls{/number}","milestones_url":"https://api.github.com/repos/SU-HSDO/suhumsci/milestones{/number}","notifications_url":"https://api.github.com/repos/SU-HSDO/suhumsci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SU-HSDO/suhumsci/labels{/name}","releases_url":"https://api.github.com/repos/SU-HSDO/suhumsci/releases{/id}","deployments_url":"https://api.github.com/repos/SU-HSDO/suhumsci/deployments","created_at":"2018-04-17T23:30:11Z","updated_at":"2018-09-21T20:34:16Z","pushed_at":"2018-09-24T23:44:41Z","git_url":"git://github.com/SU-HSDO/suhumsci.git","ssh_url":"git@github.com:SU-HSDO/suhumsci.git","clone_url":"https://github.com/SU-HSDO/suhumsci.git","svn_url":"https://github.com/SU-HSDO/suhumsci","homepage":null,"size":2361,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":1,"open_issues":10,"watchers":1,"default_branch":"develop"}},"base":{"label":"SU-HSDO:develop","ref":"develop","sha":"25bcfaacfc6043c0cd059ed99d10fc096044cfa7","user":{"login":"SU-HSDO","id":14912945,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTEyOTQ1","avatar_url":"https://avatars0.githubusercontent.com/u/14912945?v=4","gravatar_id":"","url":"https://api.github.com/users/SU-HSDO","html_url":"https://github.com/SU-HSDO","followers_url":"https://api.github.com/users/SU-HSDO/followers","following_url":"https://api.github.com/users/SU-HSDO/following{/other_user}","gists_url":"https://api.github.com/users/SU-HSDO/gists{/gist_id}","starred_url":"https://api.github.com/users/SU-HSDO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SU-HSDO/subscriptions","organizations_url":"https://api.github.com/users/SU-HSDO/orgs","repos_url":"https://api.github.com/users/SU-HSDO/repos","events_url":"https://api.github.com/users/SU-HSDO/events{/privacy}","received_events_url":"https://api.github.com/users/SU-HSDO/received_events","type":"Organization","site_admin":false},"repo":{"id":129976545,"node_id":"MDEwOlJlcG9zaXRvcnkxMjk5NzY1NDU=","name":"suhumsci","full_name":"SU-HSDO/suhumsci","private":false,"owner":{"login":"SU-HSDO","id":14912945,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0OTEyOTQ1","avatar_url":"https://avatars0.githubusercontent.com/u/14912945?v=4","gravatar_id":"","url":"https://api.github.com/users/SU-HSDO","html_url":"https://github.com/SU-HSDO","followers_url":"https://api.github.com/users/SU-HSDO/followers","following_url":"https://api.github.com/users/SU-HSDO/following{/other_user}","gists_url":"https://api.github.com/users/SU-HSDO/gists{/gist_id}","starred_url":"https://api.github.com/users/SU-HSDO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SU-HSDO/subscriptions","organizations_url":"https://api.github.com/users/SU-HSDO/orgs","repos_url":"https://api.github.com/users/SU-HSDO/repos","events_url":"https://api.github.com/users/SU-HSDO/events{/privacy}","received_events_url":"https://api.github.com/users/SU-HSDO/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/SU-HSDO/suhumsci","description":"Acquia BLT tool for H&S Acquia Product","fork":false,"url":"https://api.github.com/repos/SU-HSDO/suhumsci","forks_url":"https://api.github.com/repos/SU-HSDO/suhumsci/forks","keys_url":"https://api.github.com/repos/SU-HSDO/suhumsci/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SU-HSDO/suhumsci/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SU-HSDO/suhumsci/teams","hooks_url":"https://api.github.com/repos/SU-HSDO/suhumsci/hooks","issue_events_url":"https://api.github.com/repos/SU-HSDO/suhumsci/issues/events{/number}","events_url":"https://api.github.com/repos/SU-HSDO/suhumsci/events","assignees_url":"https://api.github.com/repos/SU-HSDO/suhumsci/assignees{/user}","branches_url":"https://api.github.com/repos/SU-HSDO/suhumsci/branches{/branch}","tags_url":"https://api.github.com/repos/SU-HSDO/suhumsci/tags","blobs_url":"https://api.github.com/repos/SU-HSDO/suhumsci/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SU-HSDO/suhumsci/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SU-HSDO/suhumsci/git/refs{/sha}","trees_url":"https://api.github.com/repos/SU-HSDO/suhumsci/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SU-HSDO/suhumsci/statuses/{sha}","languages_url":"https://api.github.com/repos/SU-HSDO/suhumsci/languages","stargazers_url":"https://api.github.com/repos/SU-HSDO/suhumsci/stargazers","contributors_url":"https://api.github.com/repos/SU-HSDO/suhumsci/contributors","subscribers_url":"https://api.github.com/repos/SU-HSDO/suhumsci/subscribers","subscription_url":"https://api.github.com/repos/SU-HSDO/suhumsci/subscription","commits_url":"https://api.github.com/repos/SU-HSDO/suhumsci/commits{/sha}","git_commits_url":"https://api.github.com/repos/SU-HSDO/suhumsci/git/commits{/sha}","comments_url":"https://api.github.com/repos/SU-HSDO/suhumsci/comments{/number}","issue_comment_url":"https://api.github.com/repos/SU-HSDO/suhumsci/issues/comments{/number}","contents_url":"https://api.github.com/repos/SU-HSDO/suhumsci/contents/{+path}","compare_url":"https://api.github.com/repos/SU-HSDO/suhumsci/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SU-HSDO/suhumsci/merges","archive_url":"https://api.github.com/repos/SU-HSDO/suhumsci/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SU-HSDO/suhumsci/downloads","issues_url":"https://api.github.com/repos/SU-HSDO/suhumsci/issues{/number}","pulls_url":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls{/number}","milestones_url":"https://api.github.com/repos/SU-HSDO/suhumsci/milestones{/number}","notifications_url":"https://api.github.com/repos/SU-HSDO/suhumsci/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SU-HSDO/suhumsci/labels{/name}","releases_url":"https://api.github.com/repos/SU-HSDO/suhumsci/releases{/id}","deployments_url":"https://api.github.com/repos/SU-HSDO/suhumsci/deployments","created_at":"2018-04-17T23:30:11Z","updated_at":"2018-09-21T20:34:16Z","pushed_at":"2018-09-24T23:44:41Z","git_url":"git://github.com/SU-HSDO/suhumsci.git","ssh_url":"git@github.com:SU-HSDO/suhumsci.git","clone_url":"https://github.com/SU-HSDO/suhumsci.git","svn_url":"https://github.com/SU-HSDO/suhumsci","homepage":null,"size":2361,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":1,"open_issues":10,"watchers":1,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls/107"},"html":{"href":"https://github.com/SU-HSDO/suhumsci/pull/107"},"issue":{"href":"https://api.github.com/repos/SU-HSDO/suhumsci/issues/107"},"comments":{"href":"https://api.github.com/repos/SU-HSDO/suhumsci/issues/107/comments"},"review_comments":{"href":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls/107/comments"},"review_comment":{"href":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SU-HSDO/suhumsci/pulls/107/commits"},"statuses":{"href":"https://api.github.com/repos/SU-HSDO/suhumsci/statuses/8231960ce163e781f41ce2699c0306e1920fe680"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"codeclimate"}}