Conditions | 1 |
Paths | 1 |
Total Lines | 24 |
Code Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
23 | protected function convertPullRequest($data) |
||
24 | { |
||
25 | return new GithubPullRequestSource( |
||
26 | new GithubPullRequestId($data['id']), |
||
27 | $this->githubRepo, |
||
|
|||
28 | $data['number'], |
||
29 | GithubPullRequestStateFactory::create($data['state']), |
||
30 | $data['locked'], |
||
31 | $data['merged_at'], |
||
32 | $data['title'], |
||
33 | $data['body'], |
||
34 | new GithubCommitId( |
||
35 | $this->githubRepo->getId(), |
||
36 | new GithubCommitSha($data['head']['sha']) |
||
37 | ), |
||
38 | $this->getUser($data['user']), |
||
39 | $this->getUserIfExists($data['assignee']), |
||
40 | $this->getMilestoneIfExists($data['milestone']), |
||
41 | new DateTime($data['created_at']), |
||
42 | new DateTime($data['updated_at']), |
||
43 | $this->getDateIfExists($data['closed_at']) |
||
44 | |||
45 | ); |
||
46 | } |
||
47 | } |
||
48 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: