{"action":"created","comment":{"url":"https://api.github.com/repos/civicrm/civihr/pulls/comments/67710742","id":67710742,"diff_hunk":"@@ -308,28 +310,127 @@ public function getNumberOfWorkingDays()\n    *\n    * @return int\n    */\n-  public function getNumberOfWorkingDaysToWork($startDate, $endDate)\n-  {\n-    if(!CRM_HRLeaveAndAbsences_Validator_Date::isValid($startDate, 'Y-m-d')) {\n+  public function getNumberOfWorkingDaysToWork($startDate, $endDate) {\n+    if (!CRM_HRLeaveAndAbsences_Validator_Date::isValid($startDate, 'Y-m-d')) {\n       throw new InvalidArgumentException('getNumberOfWorkingDaysToWork expects a valid startDate in Y-m-d format');\n     }\n \n-    if(!CRM_HRLeaveAndAbsences_Validator_Date::isValid($endDate, 'Y-m-d')) {\n+    if (!CRM_HRLeaveAndAbsences_Validator_Date::isValid($endDate, 'Y-m-d')) {\n       throw new InvalidArgumentException('getNumberOfWorkingDaysToWork expects a valid endDate in Y-m-d format');\n     }\n \n-    if(strtotime($startDate) < strtotime($this->start_date)) {\n+    if (strtotime($startDate) < strtotime($this->start_date)) {\n       $startDate = $this->start_date;\n     }\n \n-    if(strtotime($endDate) > strtotime($this->end_date)) {\n+    if (strtotime($endDate) > strtotime($this->end_date)) {\n       $endDate = $this->end_date;\n     }\n \n-    $periodToWork = new CRM_HRLeaveAndAbsences_BAO_AbsencePeriod();\n+    $periodToWork             = new CRM_HRLeaveAndAbsences_BAO_AbsencePeriod();","path":"uk.co.compucorp.civicrm.hrleaveandabsences/CRM/HRLeaveAndAbsences/BAO/AbsencePeriod.php","position":null,"original_position":45,"commit_id":"f63687ecdd9161a3b48c908e16258877165e67ee","original_commit_id":"7ccd1072f233fa93bb9ff22090f76b8ed4e87f09","user":{"login":"davialexandre","id":388373,"avatar_url":"https://avatars.githubusercontent.com/u/388373?v=3","gravatar_id":"","url":"https://api.github.com/users/davialexandre","html_url":"https://github.com/davialexandre","followers_url":"https://api.github.com/users/davialexandre/followers","following_url":"https://api.github.com/users/davialexandre/following{/other_user}","gists_url":"https://api.github.com/users/davialexandre/gists{/gist_id}","starred_url":"https://api.github.com/users/davialexandre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davialexandre/subscriptions","organizations_url":"https://api.github.com/users/davialexandre/orgs","repos_url":"https://api.github.com/users/davialexandre/repos","events_url":"https://api.github.com/users/davialexandre/events{/privacy}","received_events_url":"https://api.github.com/users/davialexandre/received_events","type":"User","site_admin":false},"body":"I've changed this (and all the other similar cases) to new self()","created_at":"2016-06-20T15:31:05Z","updated_at":"2016-06-20T15:31:05Z","html_url":"https://github.com/civicrm/civihr/pull/978#discussion_r67710742","pull_request_url":"https://api.github.com/repos/civicrm/civihr/pulls/978","_links":{"self":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/comments/67710742"},"html":{"href":"https://github.com/civicrm/civihr/pull/978#discussion_r67710742"},"pull_request":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/978"}}},"pull_request":{"url":"https://api.github.com/repos/civicrm/civihr/pulls/978","id":74284537,"html_url":"https://github.com/civicrm/civihr/pull/978","diff_url":"https://github.com/civicrm/civihr/pull/978.diff","patch_url":"https://github.com/civicrm/civihr/pull/978.patch","issue_url":"https://api.github.com/repos/civicrm/civihr/issues/978","number":978,"state":"open","locked":false,"title":"PCHR-1060: Create the EntitlementCalculation class","user":{"login":"davialexandre","id":388373,"avatar_url":"https://avatars.githubusercontent.com/u/388373?v=3","gravatar_id":"","url":"https://api.github.com/users/davialexandre","html_url":"https://github.com/davialexandre","followers_url":"https://api.github.com/users/davialexandre/followers","following_url":"https://api.github.com/users/davialexandre/following{/other_user}","gists_url":"https://api.github.com/users/davialexandre/gists{/gist_id}","starred_url":"https://api.github.com/users/davialexandre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davialexandre/subscriptions","organizations_url":"https://api.github.com/users/davialexandre/orgs","repos_url":"https://api.github.com/users/davialexandre/repos","events_url":"https://api.github.com/users/davialexandre/events{/privacy}","received_events_url":"https://api.github.com/users/davialexandre/received_events","type":"User","site_admin":false},"body":"The EntitlementCalculation class encapsulates the whole algorithm to calculate the entitlement for a contract and absence type on a given absence period. \r\n\r\nThis is how the calculation is made:\r\n((Base contractual entitlement + Public Holidays) * (No. of working days to work / No. of working days in period)) = (Period pro rata) + (Brought Forward days) = Period Entitlement\r\n\r\nIn the class, the four main methods responsible to implement the calculation are: getBroughtForward(), getContractualEntitlement(), getProRata() and getProposedEntitlement().\r\n\r\nA more detailed explanation of the algorithm can be found at https://compucorp.atlassian.net/browse/PCHR-1060 and on the class documentation.\r\n","created_at":"2016-06-17T18:20:45Z","updated_at":"2016-06-20T15:31:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"228c4e64e3634fa5c6640daef4d6bf396c098638","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/civicrm/civihr/pulls/978/commits","review_comments_url":"https://api.github.com/repos/civicrm/civihr/pulls/978/comments","review_comment_url":"https://api.github.com/repos/civicrm/civihr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/civicrm/civihr/issues/978/comments","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/f63687ecdd9161a3b48c908e16258877165e67ee","head":{"label":"civicrm:PCHR-1060-create-entitlementcalculation-class","ref":"PCHR-1060-create-entitlementcalculation-class","sha":"f63687ecdd9161a3b48c908e16258877165e67ee","user":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"repo":{"id":10086903,"name":"civihr","full_name":"civicrm/civihr","owner":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/civicrm/civihr","description":"CiviHR","fork":false,"url":"https://api.github.com/repos/civicrm/civihr","forks_url":"https://api.github.com/repos/civicrm/civihr/forks","keys_url":"https://api.github.com/repos/civicrm/civihr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civihr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civihr/teams","hooks_url":"https://api.github.com/repos/civicrm/civihr/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civihr/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civihr/events","assignees_url":"https://api.github.com/repos/civicrm/civihr/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civihr/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civihr/tags","blobs_url":"https://api.github.com/repos/civicrm/civihr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civihr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civihr/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civihr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civihr/languages","stargazers_url":"https://api.github.com/repos/civicrm/civihr/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civihr/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civihr/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civihr/subscription","commits_url":"https://api.github.com/repos/civicrm/civihr/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civihr/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civihr/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civihr/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civihr/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civihr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civihr/merges","archive_url":"https://api.github.com/repos/civicrm/civihr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civihr/downloads","issues_url":"https://api.github.com/repos/civicrm/civihr/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civihr/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civihr/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civihr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civihr/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civihr/releases{/id}","deployments_url":"https://api.github.com/repos/civicrm/civihr/deployments","created_at":"2013-05-15T20:06:06Z","updated_at":"2016-05-12T03:42:48Z","pushed_at":"2016-06-20T15:30:14Z","git_url":"git://github.com/civicrm/civihr.git","ssh_url":"git@github.com:civicrm/civihr.git","clone_url":"https://github.com/civicrm/civihr.git","svn_url":"https://github.com/civicrm/civihr","homepage":null,"size":21763,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":7,"forks":21,"open_issues":7,"watchers":3,"default_branch":"develop"}},"base":{"label":"civicrm:PCHR-863-migrate-to-4.7","ref":"PCHR-863-migrate-to-4.7","sha":"412544935e19ec4a9a65f2dbeb22da2ff0ed8327","user":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"repo":{"id":10086903,"name":"civihr","full_name":"civicrm/civihr","owner":{"login":"civicrm","id":136373,"avatar_url":"https://avatars.githubusercontent.com/u/136373?v=3","gravatar_id":"","url":"https://api.github.com/users/civicrm","html_url":"https://github.com/civicrm","followers_url":"https://api.github.com/users/civicrm/followers","following_url":"https://api.github.com/users/civicrm/following{/other_user}","gists_url":"https://api.github.com/users/civicrm/gists{/gist_id}","starred_url":"https://api.github.com/users/civicrm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/civicrm/subscriptions","organizations_url":"https://api.github.com/users/civicrm/orgs","repos_url":"https://api.github.com/users/civicrm/repos","events_url":"https://api.github.com/users/civicrm/events{/privacy}","received_events_url":"https://api.github.com/users/civicrm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/civicrm/civihr","description":"CiviHR","fork":false,"url":"https://api.github.com/repos/civicrm/civihr","forks_url":"https://api.github.com/repos/civicrm/civihr/forks","keys_url":"https://api.github.com/repos/civicrm/civihr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/civicrm/civihr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/civicrm/civihr/teams","hooks_url":"https://api.github.com/repos/civicrm/civihr/hooks","issue_events_url":"https://api.github.com/repos/civicrm/civihr/issues/events{/number}","events_url":"https://api.github.com/repos/civicrm/civihr/events","assignees_url":"https://api.github.com/repos/civicrm/civihr/assignees{/user}","branches_url":"https://api.github.com/repos/civicrm/civihr/branches{/branch}","tags_url":"https://api.github.com/repos/civicrm/civihr/tags","blobs_url":"https://api.github.com/repos/civicrm/civihr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/civicrm/civihr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/civicrm/civihr/git/refs{/sha}","trees_url":"https://api.github.com/repos/civicrm/civihr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/civicrm/civihr/statuses/{sha}","languages_url":"https://api.github.com/repos/civicrm/civihr/languages","stargazers_url":"https://api.github.com/repos/civicrm/civihr/stargazers","contributors_url":"https://api.github.com/repos/civicrm/civihr/contributors","subscribers_url":"https://api.github.com/repos/civicrm/civihr/subscribers","subscription_url":"https://api.github.com/repos/civicrm/civihr/subscription","commits_url":"https://api.github.com/repos/civicrm/civihr/commits{/sha}","git_commits_url":"https://api.github.com/repos/civicrm/civihr/git/commits{/sha}","comments_url":"https://api.github.com/repos/civicrm/civihr/comments{/number}","issue_comment_url":"https://api.github.com/repos/civicrm/civihr/issues/comments{/number}","contents_url":"https://api.github.com/repos/civicrm/civihr/contents/{+path}","compare_url":"https://api.github.com/repos/civicrm/civihr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/civicrm/civihr/merges","archive_url":"https://api.github.com/repos/civicrm/civihr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/civicrm/civihr/downloads","issues_url":"https://api.github.com/repos/civicrm/civihr/issues{/number}","pulls_url":"https://api.github.com/repos/civicrm/civihr/pulls{/number}","milestones_url":"https://api.github.com/repos/civicrm/civihr/milestones{/number}","notifications_url":"https://api.github.com/repos/civicrm/civihr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/civicrm/civihr/labels{/name}","releases_url":"https://api.github.com/repos/civicrm/civihr/releases{/id}","deployments_url":"https://api.github.com/repos/civicrm/civihr/deployments","created_at":"2013-05-15T20:06:06Z","updated_at":"2016-05-12T03:42:48Z","pushed_at":"2016-06-20T15:30:14Z","git_url":"git://github.com/civicrm/civihr.git","ssh_url":"git@github.com:civicrm/civihr.git","clone_url":"https://github.com/civicrm/civihr.git","svn_url":"https://github.com/civicrm/civihr","homepage":null,"size":21763,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":7,"forks":21,"open_issues":7,"watchers":3,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/978"},"html":{"href":"https://github.com/civicrm/civihr/pull/978"},"issue":{"href":"https://api.github.com/repos/civicrm/civihr/issues/978"},"comments":{"href":"https://api.github.com/repos/civicrm/civihr/issues/978/comments"},"review_comments":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/978/comments"},"review_comment":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/civicrm/civihr/pulls/978/commits"},"statuses":{"href":"https://api.github.com/repos/civicrm/civihr/statuses/f63687ecdd9161a3b48c908e16258877165e67ee"}}}}
{"actor":{"display_login":"davialexandre"}}