{"action":"created","comment":{"url":"https://api.github.com/repos/box/bart/pulls/comments/47324356","id":47324356,"diff_hunk":"@@ -9,52 +9,122 @@\n  */\n class Job\n {\n-\tprivate $base_job_url;\n-\tprivate $default_params = array();\n+\tprivate $baseJobUrl;\n+\tprivate $default_params = [];\n \tprivate $my_build_id;\n \tprivate $metadata;\n \t/** @var \\Logger */\n \tprivate $logger;\n \n+\t/** @var array $curlOptions */\n+\tprivate $curlOptions;\n+\t/** @var string $port */\n+\tprivate $port;\n+\n+\n+\n \t/**\n-\t * Load metadata about a project\n-\t */\n-\tpublic function __construct($domain, $job_name)\n+\t * Job constructor. Loads metadata about a project.\n+\t * @param string $domain The\n+\t * @param string $baseProject The top-level name of your Project.\n+\t * @param array $subProjects If your Jenkins Job is not defined in the top-level project,\n+\t * this parameter must be passed in. For example, if your Job is defined in the following\n+\t * third level project: Base->Build->Example, you must pass in 'Base' as the $baseProject\n+\t * parameter, and the array ['Build', 'Example'] as the $subProjects parameter. The order\n+\t * of the array is maintained when loading the metadata, and hence it's critical.\n+\t * @param string $protocol 'http' or 'https'.\n+\t * @param string $user User to authenticate against.\n+\t * @param string $token API token corresponding to user.\n+\t * NOTE: The $user and $token must be passed in if the Jenkins instance doesn't support\n+\t * anonymous connections.\n+\t * @param int $port The port can be generally be determined by the $protocol. 'http' corresponds\n+\t * to port 8080, while 'https' corresponds to 443. If the $port is passed in, it will override\n+\t * that determination.\n+     */\n+\tpublic function __construct(\n+\t\t$domain,\n+\t\t$baseProject,\n+\t\tarray $subProjects = [],\n+\t\t$protocol = 'http',\n+\t\t$user = null,","path":"src/Bart/Jenkins/Job.php","position":46,"original_position":46,"commit_id":"30c03426d8df164febda517a0431add1b9d43808","original_commit_id":"30c03426d8df164febda517a0431add1b9d43808","user":{"login":"asheepapart","id":821115,"avatar_url":"https://avatars.githubusercontent.com/u/821115?v=3","gravatar_id":"","url":"https://api.github.com/users/asheepapart","html_url":"https://github.com/asheepapart","followers_url":"https://api.github.com/users/asheepapart/followers","following_url":"https://api.github.com/users/asheepapart/following{/other_user}","gists_url":"https://api.github.com/users/asheepapart/gists{/gist_id}","starred_url":"https://api.github.com/users/asheepapart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asheepapart/subscriptions","organizations_url":"https://api.github.com/users/asheepapart/orgs","repos_url":"https://api.github.com/users/asheepapart/repos","events_url":"https://api.github.com/users/asheepapart/events{/privacy}","received_events_url":"https://api.github.com/users/asheepapart/received_events","type":"User","site_admin":false},"body":"This is a lot of arguments (>4). It might be easier to have a `setAuth()` method, or provide a `JenkinsJobBuilder` class that creates a `Job` and that class can expose setter methods, a la Effective Java section 1. ","created_at":"2015-12-11T06:06:50Z","updated_at":"2015-12-11T06:06:50Z","html_url":"https://github.com/box/bart/pull/31#discussion_r47324356","pull_request_url":"https://api.github.com/repos/box/bart/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/box/bart/pulls/comments/47324356"},"html":{"href":"https://github.com/box/bart/pull/31#discussion_r47324356"},"pull_request":{"href":"https://api.github.com/repos/box/bart/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/box/bart/pulls/31","id":53345488,"html_url":"https://github.com/box/bart/pull/31","diff_url":"https://github.com/box/bart/pull/31.diff","patch_url":"https://github.com/box/bart/pull/31.patch","issue_url":"https://api.github.com/repos/box/bart/issues/31","number":31,"state":"open","locked":false,"title":"Make Jenkins Job class more flexible","user":{"login":"nadeemahmad","id":8113548,"avatar_url":"https://avatars.githubusercontent.com/u/8113548?v=3","gravatar_id":"","url":"https://api.github.com/users/nadeemahmad","html_url":"https://github.com/nadeemahmad","followers_url":"https://api.github.com/users/nadeemahmad/followers","following_url":"https://api.github.com/users/nadeemahmad/following{/other_user}","gists_url":"https://api.github.com/users/nadeemahmad/gists{/gist_id}","starred_url":"https://api.github.com/users/nadeemahmad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nadeemahmad/subscriptions","organizations_url":"https://api.github.com/users/nadeemahmad/orgs","repos_url":"https://api.github.com/users/nadeemahmad/repos","events_url":"https://api.github.com/users/nadeemahmad/events{/privacy}","received_events_url":"https://api.github.com/users/nadeemahmad/received_events","type":"User","site_admin":false},"body":"This commit allow the Jenkins Job class to handle both HTTP as well as\r\nHTTPS protocol. In addition, it allows us the specification of lower\r\nlevel Jenkins projects, in addition to just top-level projects. Finally,\r\nsupport for user authentication is also added.","created_at":"2015-12-11T02:09:07Z","updated_at":"2015-12-11T06:06:50Z","closed_at":null,"merged_at":null,"merge_commit_sha":"218ab183dbd040f9ce2747a0deaa264fb1f83ce4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/box/bart/pulls/31/commits","review_comments_url":"https://api.github.com/repos/box/bart/pulls/31/comments","review_comment_url":"https://api.github.com/repos/box/bart/pulls/comments{/number}","comments_url":"https://api.github.com/repos/box/bart/issues/31/comments","statuses_url":"https://api.github.com/repos/box/bart/statuses/30c03426d8df164febda517a0431add1b9d43808","head":{"label":"box:jenkins-job","ref":"jenkins-job","sha":"30c03426d8df164febda517a0431add1b9d43808","user":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"repo":{"id":2546281,"name":"bart","full_name":"box/bart","owner":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/box/bart","description":"A collection of our critical PHP tools","fork":false,"url":"https://api.github.com/repos/box/bart","forks_url":"https://api.github.com/repos/box/bart/forks","keys_url":"https://api.github.com/repos/box/bart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/box/bart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/box/bart/teams","hooks_url":"https://api.github.com/repos/box/bart/hooks","issue_events_url":"https://api.github.com/repos/box/bart/issues/events{/number}","events_url":"https://api.github.com/repos/box/bart/events","assignees_url":"https://api.github.com/repos/box/bart/assignees{/user}","branches_url":"https://api.github.com/repos/box/bart/branches{/branch}","tags_url":"https://api.github.com/repos/box/bart/tags","blobs_url":"https://api.github.com/repos/box/bart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/box/bart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/box/bart/git/refs{/sha}","trees_url":"https://api.github.com/repos/box/bart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/box/bart/statuses/{sha}","languages_url":"https://api.github.com/repos/box/bart/languages","stargazers_url":"https://api.github.com/repos/box/bart/stargazers","contributors_url":"https://api.github.com/repos/box/bart/contributors","subscribers_url":"https://api.github.com/repos/box/bart/subscribers","subscription_url":"https://api.github.com/repos/box/bart/subscription","commits_url":"https://api.github.com/repos/box/bart/commits{/sha}","git_commits_url":"https://api.github.com/repos/box/bart/git/commits{/sha}","comments_url":"https://api.github.com/repos/box/bart/comments{/number}","issue_comment_url":"https://api.github.com/repos/box/bart/issues/comments{/number}","contents_url":"https://api.github.com/repos/box/bart/contents/{+path}","compare_url":"https://api.github.com/repos/box/bart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/box/bart/merges","archive_url":"https://api.github.com/repos/box/bart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/box/bart/downloads","issues_url":"https://api.github.com/repos/box/bart/issues{/number}","pulls_url":"https://api.github.com/repos/box/bart/pulls{/number}","milestones_url":"https://api.github.com/repos/box/bart/milestones{/number}","notifications_url":"https://api.github.com/repos/box/bart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/box/bart/labels{/name}","releases_url":"https://api.github.com/repos/box/bart/releases{/id}","created_at":"2011-10-10T06:13:32Z","updated_at":"2015-12-09T13:14:26Z","pushed_at":"2015-12-11T02:09:08Z","git_url":"git://github.com/box/bart.git","ssh_url":"git@github.com:box/bart.git","clone_url":"https://github.com/box/bart.git","svn_url":"https://github.com/box/bart","homepage":"","size":540,"stargazers_count":111,"watchers_count":111,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":6,"forks":11,"open_issues":6,"watchers":111,"default_branch":"master"}},"base":{"label":"box:master","ref":"master","sha":"08137e26df962af90ab2b7f7e4649fd178cbd5f5","user":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"repo":{"id":2546281,"name":"bart","full_name":"box/bart","owner":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/box/bart","description":"A collection of our critical PHP tools","fork":false,"url":"https://api.github.com/repos/box/bart","forks_url":"https://api.github.com/repos/box/bart/forks","keys_url":"https://api.github.com/repos/box/bart/keys{/key_id}","collaborators_url":"https://api.github.com/repos/box/bart/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/box/bart/teams","hooks_url":"https://api.github.com/repos/box/bart/hooks","issue_events_url":"https://api.github.com/repos/box/bart/issues/events{/number}","events_url":"https://api.github.com/repos/box/bart/events","assignees_url":"https://api.github.com/repos/box/bart/assignees{/user}","branches_url":"https://api.github.com/repos/box/bart/branches{/branch}","tags_url":"https://api.github.com/repos/box/bart/tags","blobs_url":"https://api.github.com/repos/box/bart/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/box/bart/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/box/bart/git/refs{/sha}","trees_url":"https://api.github.com/repos/box/bart/git/trees{/sha}","statuses_url":"https://api.github.com/repos/box/bart/statuses/{sha}","languages_url":"https://api.github.com/repos/box/bart/languages","stargazers_url":"https://api.github.com/repos/box/bart/stargazers","contributors_url":"https://api.github.com/repos/box/bart/contributors","subscribers_url":"https://api.github.com/repos/box/bart/subscribers","subscription_url":"https://api.github.com/repos/box/bart/subscription","commits_url":"https://api.github.com/repos/box/bart/commits{/sha}","git_commits_url":"https://api.github.com/repos/box/bart/git/commits{/sha}","comments_url":"https://api.github.com/repos/box/bart/comments{/number}","issue_comment_url":"https://api.github.com/repos/box/bart/issues/comments{/number}","contents_url":"https://api.github.com/repos/box/bart/contents/{+path}","compare_url":"https://api.github.com/repos/box/bart/compare/{base}...{head}","merges_url":"https://api.github.com/repos/box/bart/merges","archive_url":"https://api.github.com/repos/box/bart/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/box/bart/downloads","issues_url":"https://api.github.com/repos/box/bart/issues{/number}","pulls_url":"https://api.github.com/repos/box/bart/pulls{/number}","milestones_url":"https://api.github.com/repos/box/bart/milestones{/number}","notifications_url":"https://api.github.com/repos/box/bart/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/box/bart/labels{/name}","releases_url":"https://api.github.com/repos/box/bart/releases{/id}","created_at":"2011-10-10T06:13:32Z","updated_at":"2015-12-09T13:14:26Z","pushed_at":"2015-12-11T02:09:08Z","git_url":"git://github.com/box/bart.git","ssh_url":"git@github.com:box/bart.git","clone_url":"https://github.com/box/bart.git","svn_url":"https://github.com/box/bart","homepage":"","size":540,"stargazers_count":111,"watchers_count":111,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":6,"forks":11,"open_issues":6,"watchers":111,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/box/bart/pulls/31"},"html":{"href":"https://github.com/box/bart/pull/31"},"issue":{"href":"https://api.github.com/repos/box/bart/issues/31"},"comments":{"href":"https://api.github.com/repos/box/bart/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/box/bart/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/box/bart/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/box/bart/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/box/bart/statuses/30c03426d8df164febda517a0431add1b9d43808"}}}}