| Conditions | 1 |
| Paths | 1 |
| Total Lines | 24 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 24 | protected function convertPullRequest(array $data) |
||
| 25 | { |
||
| 26 | return new GithubPullRequestSource( |
||
| 27 | new GithubPullRequestId($data['id']), |
||
| 28 | $this->githubRepo, |
||
|
|
|||
| 29 | $data['number'], |
||
| 30 | GithubPullRequestStateFactory::create($data['state']), |
||
| 31 | $data['locked'], |
||
| 32 | $data['merged_at'], |
||
| 33 | $data['title'], |
||
| 34 | $data['body'], |
||
| 35 | new GithubCommitId( |
||
| 36 | $this->githubRepo->getId(), |
||
| 37 | new GithubCommitSha($data['head']['sha']) |
||
| 38 | ), |
||
| 39 | $this->getUser($data['user']), |
||
| 40 | $this->getUserIfExists($data['assignee']), |
||
| 41 | $this->getMilestoneIfExists($data['milestone']), |
||
| 42 | new DateTime($data['created_at']), |
||
| 43 | new DateTime($data['updated_at']), |
||
| 44 | $this->getDateIfExists($data['closed_at']) |
||
| 45 | |||
| 46 | ); |
||
| 47 | } |
||
| 48 | } |
||
| 49 |
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: